// random frontpage picture
function randomImage(size){
	// starts from 0 to size - 1
	var random_id = Math.floor(Math.random() * size);
	document.write("<img src='/images/resource/main_" + random_id + ".jpg' alt='welcome to PopularWorld.com'>");
}
//end of random frontpage picture

function popup_sb(url,name,x,y) {
	window.open(url,name,"menubar=1,resizable=1,scrollbars=1,width="+x+",height="+y+",top=40,left=40").focus();
}

//pop up new window
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features).focus();
}
function clearForm()
{
	for(count=0; count<document.forms.length; count++)
		document.forms[count].reset();
}

function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }

