// Set Focus
function fokus(){
	try
	{
		document.frmQLogin.username.focus();
	}
	catch(err)
	{}
}

// Redundant Check
function check(){
	document.frmQLogin.login.value = "Please Wait...";
	document.frmQLogin.login.disabled = true;
	document.frmQLogin.submit();
}

// Google Tracker
//var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write("\<script src='http://www.google-analytics.com/ga.js' type='text/javascript'>\<\/script>" );

if (typeof(_gat) == "object") { 
	var pageTracker = _gat._getTracker("UA-3216877-1");
	pageTracker._initData();
	pageTracker._trackPageview();
}
function getXMLHttpRequest11(){
	try{
		req = new XMLHttpRequest();
	}
	catch(err1){
		try{
			req = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(err2){
			try{
				req = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(err3){
				req = false;
			}
		}
	}
	return req;
}

var xmlhttp11 = getXMLHttpRequest11();

function invite(){ 
	if(xmlhttp11){
		var name = document.getElementById('nm').value;
		var usr = document.getElementById('usr').value;
		var email = document.getElementById('email').value;
		
		if(name.length < 1){
			output = '<font color=\'red\'>Enter name </font>';
			document.getElementById('x').innerHTML = output;
		}else if(email.length < 1){
			output = '<font color=\'red\'>Enter Email</font>';
			document.getElementById('x').innerHTML = output;	
		}else{
			var myurl = 'scripts/invite.php?name=' + escape(name) + 
			'&email=' + escape(email) + '&usr=' + escape(usr);
			myRand = parseInt(Math.random()*999999999999999); 
			var modurl = myurl + '&rand=' + myRand;
			xmlhttp11.open('GET', modurl, true);
			xmlhttp11.onreadystatechange = useHttpResponse11;
			xmlhttp11.send(null);
		}
	}
}

function useHttpResponse11(){
	var timeoutSet = false;
	var downloadOK = false;
	if(xmlhttp11.readyState == 1){
		if(!timeoutSet){
			toolongg = window.setTimeout(function(){
						   if(!downloadOK){
							xmlhttp11.abort();
							document.getElementById('x').innerHTML = '<font color=red>Server took long to respond <b>try sending Again</b></font>';
						    }
							}, 25000);
			timeoutSet = true;
			}
	}
	if(xmlhttp11.readyState == 4){
		if(xmlhttp11.status == 200){
		output11 = xmlhttp11.responseText;
		window.clearTimeout( toolongg );
		document.getElementById('x').innerHTML = output11;
		document.getElementById('nm').value ='Name...';
		document.getElementById('email').value ='Email..';
		}
	}else{
		document.getElementById('x').innerHTML = 'Sending invitation to '+ document.getElementById('nm').value + '...';
	
		}
}



