function GetNewImage(a,b)
{
var StrPattern=genPattern(6);
b.value=StrPattern;
a.src="../common/human_detector/doimg.php?qtext="+StrPattern+"&q="+Math.floor((4 - 1 + 1) * Math.random() + 1);

}
 function charFromCharCode (charCode) 
{
   if(charCode<3)
   { 
		if(charCode%2==0)
		{
			charCode=123-charCode;
		}
		else
		{
			charCode=118-charCode;
		}
		   
   }
   else if(charCode>3 && charCode<6)
   { 
		if(charCode%2==0)
		{
			charCode=58-charCode; 
		}
		else
		{
			charCode=54-charCode; 
		}
   }
   else
   { 
		if(charCode%2==0)
		{
			charCode=78-charCode;
		}
		else
		{
			charCode=72-charCode;
		}
   }
   return unescape('%' + charCode.toString(16));
  
}
  
 
function genPattern(pintLen)
{
    var strRet = "";
    var iCntr  = 0;
    var rndNo  = 0;

    for (iCntr = 0; iCntr < pintLen; iCntr++)
    {
        rndNo = Math.floor(Math.random() * 9);
		while(rndNo==0)
		{
		rndNo=Math.floor(Math.random() * 9);
		}
		strRet	 +=charFromCharCode(rndNo);
    }
	//alert(strRet);
	return strRet;
}

function rnd()
{
rnd.today=new Date();
rnd.seed=rnd.today.getTime();
rnd.seed = (rnd.seed*9301+49297) % 233280;
return rnd.seed/(233280.0);
}

function rand(number)
{
return Math.ceil(rnd()*number);
}


