	var time_total = 30;
	var time_status;
	function quiz_countdown()	{
		document.getElementById('countdown').innerHTML = time_total;
		
		if(time_total < 1)	{
			document.quiz.submit();
			time_total = 30;
			time_status = setTimeout("quiz_countdown();", 1000);
		}else	{
			time_total = time_total - 1;
			time_status = setTimeout("quiz_countdown();", 1000);
		}
	}
	
	function disable_rclick()	{
		if (event.button == 2)	{
			alert("Sorry no rightclick on this page.");
		}
		return false;
	}

	function check_ans(obj)	{
		for (op = 0;op < obj.useropt.length;op++)	{
			if (obj.useropt[op].checked)	{
				return true;
			}
		}
		alert("Please select an option.");
		return false;		
	}
	
	function response_ok(frmObj)	{
		if(check_ans(frmObj))	{
			frmObj.status.value = 1;
			frmObj.submit();
		}
		return false;
	}
	function response_skip(frmObj)	{
		frmObj.status.value = 2;
		total_skip = parseInt(frmObj.tskip.value) + 1;
		alert("You have skiped "+total_skip+" Questions.\n Total 10 skips Allowed.");
		frmObj.submit();
		return false;
	}
	function response_quit(frmObj)	{
		frmObj.status.value = 3;
		frmObj.submit();
		return false;
	}
	function response_logout(frmObj)	{
		frmObj.status.value = 3;
		frmObj.submit();
		return false;
	}
	
	function mystatus(dId)	{
			var myWidth = 0, myHeight = 0;
	  if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = (window.innerWidth-16);
		myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = (document.documentElement.clientWidth+4);
		myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = (document.body.clientWidth+4);
		myHeight = document.body.clientHeight;
	  }
	  
	  var scrOfX = 0, scrOfY = 0;
	  if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	  }
		
		div_id = document.getElementById(dId);
		if(div_id.style.display=='')	{
			div_id.style.display='none';
			if(document.getElementById('maintop'))	{
				document.getElementById('maintop').style.display='';
				document.getElementById('mainstop').style.display='';
			}
			sendRequest('user_scorer.php?logout=1', 'navwin_res');
			return false;
		}else	{
			div_id.style.display='';
			div_id.style.left = (myWidth+scrOfX-446)/2+'px';
			if(document.getElementById('maintop'))	{
				document.getElementById('maintop').style.display='none';
				document.getElementById('mainstop').style.display='none';
			}
			sendRequest('user_scorer.php?req=1', 'navwin_res');
			return false;
		}		
		return false;
	}	
	
	function openpopup(pgname)	{		
		window.open('top_scorer.php', "scorer", "location=0,status=0,scrollbars=0,menubar=0,resizable=0,width=550,height=560");
		return false;
	}
	
	function changeOpac(opacity, id) { 
		var object = document.getElementById(id).style; 
		object.opacity = (opacity / 100); 
		object.MozOpacity = (opacity / 100); 
		object.KhtmlOpacity = (opacity / 100); 
		object.filter = "alpha(opacity=" + opacity + ")";
		return true;
	}	
	function quiz_topers()	{
		divobj = document.getElementById('ebiz_toppers');		
		divobj.innerHTML = eBIZ_MSG[toppers_index];		
		timer = setTimeout("changeOpac(10, 'ebiz_toppers')", 1000);
		timer = setTimeout("changeOpac(100, 'ebiz_toppers')", 1500);
		if(toppers_index >= parseInt(eBIZ_MSG.length-1))	{
			toppers_index = 0;
			timer = setTimeout("quiz_topers()", 1500);			
		}else	{
			toppers_index = toppers_index + 1;
			timer = setTimeout("quiz_topers()", 1500);
		}
		//clearTimeout(timer);
	}	
	function startdisp()	{
		window.onload=quiz_topers;	
	}
	function enable_flash()	{
		alert("To enable, please logout!");
		return false;
	}
	
	
	

var xmlHttp;
var divId;
function sendRequest(pageName,divid)	{
	divId = divid;
	returnSendData = sendData(pageName);
	return false;
}

function formRequest(pageName,divid,formObj)	{
	divId = divid;
	var GetStr='';
	totalControl = parseInt(formObj.length);
	
	for(i = 0;i < totalControl;i++) 		{
		fField = formObj[i];
		fValue = fField.value;
		fName = fField.name;
		
		if (fField.type == "radio") {
        	if(fField.checked)	{
              	GetStr += String(fName + "=" + fValue + "&");
         	}
		}else if(fField.type == "checkbox")	{
			if(fField.checked)	{
              	GetStr += String(fName + "=" + fValue + "&");
         	}
		}else	{
			GetStr += String(fName + "=" + fValue + "&");
		}
	}
	
	if(pageName.indexOf("?") >= 0)	{
		var formData = String(pageName + "&" + GetStr);
	} else	{
		var formData = String(pageName + "?" + GetStr);
	}

	returnSendData = sendData(formData);		
	return false;
}

function sendData(str)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)	  {
	  alert ("Your browser does not support AJAX!");
	  return
	}
	var url=str+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");	// Added 22 Nov 2007
	xmlHttp.setRequestHeader("Connection", "close");	// Added 3 Nov 2007
	xmlHttp.send(null);
	return true;
}

function stateChanged()
{
	if (xmlHttp.readyState == 3){	document.getElementById(divId).innerHTML='<img src="Scripts/loading.gif" />';	}
	if (xmlHttp.readyState == 4 && (xmlHttp.status==200 || window.location.href.indexOf("http")==-1))
	{ 	
		if(xmlHttp.status == 401) 	{
			document.getElementById(divId).innerHTML='Error: Bad HTTP request.';
		}else if(xmlHttp.status == 402) 	{
			document.getElementById(divId).innerHTML='Error: Not authorized.';
		}else if(xmlHttp.status == 403) 	{
			document.getElementById(divId).innerHTML='Error: Access forbidden.';
		}else if(xmlHttp.status == 404) 	{
			document.getElementById(divId).innerHTML='Error: Web address does not exist.';
		}else if(xmlHttp.status == 1000) 	{
			document.getElementById(divId).innerHTML='Error: Invalid response.';
		}else if(xmlHttp.status == 1001) 	{
			document.getElementById(divId).innerHTML='Error: A network error occurred. Check that you are connected to the internet';
		}else if(xmlHttp.responseText=='')	{
			document.getElementById(divId).innerHTML='Error: The server returned an empty response.';
		}else 	{
			var resptxt = xmlHttp.responseText.replace(/^\s*|\s*$/g,"");			
			document.getElementById(divId).innerHTML = resptxt;
						
			// Added 12 April 2008
			indx_from = resptxt.indexOf('<script type="text/javascript">')+31;
			indx_to = resptxt.indexOf('</script>');

			if(indx_from > 0 && indx_to > 0)	{
				if (window.execScript)	{	/*  If MSIE  */
					execScript(resptxt.substr(indx_from, indx_to-indx_from), "javascript");				
				}else if (window.eval)	{	/*  If Mozilla, FireFox, Netscape, etc.  */
					setTimeout(eval(resptxt.substr(indx_from, indx_to-indx_from)), 0);
				}else	{	/*  If Safari or other  */
					setTimeout(resptxt.substr(indx_from, indx_to-indx_from), 0);
				};
			}
		}	
		//changeOpac(100, divId);
	}
}
function GetXmlHttpObject()	{
	var xmlHttp=null;
	if(typeof XMLHttpRequest != 'undefined'){
		xmlHttp = new XMLHttpRequest();
	} else if(typeof window.ActiveXObject != 'undefined'){
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP.5.0");
		} catch(e){	// catch 1 Start
			try {
				xmlHttp = new ActiveXObject("Msxml2.XMLHTTP.4.0");
			} catch(e){	// catch 2 Start
				try {
					xmlHttp = new ActiveXObject("Msxml2.XMLHTTP.3.0");
				} catch(e){	// catch 3 Start
					try {
						xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
					} catch(e){	// catch 4 Start
						try {
							xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
						} catch(e){	// catch 5 Start
							xmlHttp = null;
						}	// catch 5 End
					}	// catch 4 End
				}	// catch 3 End
			}	// catch 2 End
		}	// catch 1 End
	}
	//xmlHttp.onload = displayState;
	if (xmlHttp.overrideMimeType) { xmlHttp.overrideMimeType('text/xml'); }	// Added 2nd November 2007 (plain xml)
	return xmlHttp;
}
	
