x = 50;
y = 50;
MSIE = false;
var divs_transparentDiv;	
if(navigator.userAgent.indexOf('MSIE')>=0) MSIE = true;
var xmlhttp;
if(window.XMLHttpRequest){
	xmlhttp=new XMLHttpRequest();
}
else if(window.ActiveXObject){
	try{
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e){
		try{
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){}
	}
}

function Invite(name,email){
	var email=document.getElementById('pemail').value;
	var tdMessage=document.getElementById('tdMessage');
	var tdInfo=document.getElementById('tdInfo');
	tdInfo.style.display='none';
	var params="name="+name+"&email="+email+"&opr=IN"; //Invitation
	var viewer = document.getElementById('test');
	
	tdMessage.innerHTML = '<div class="loading"></div>';
	xmlhttp.open('GET','content.php?'+params,true);
	xmlhttp.onreadystatechange =function(){
		handleInvite(tdMessage);
	}
    xmlhttp.send(null);
	
}
function handleInvite(tdMessage){
	//var tdMessage=document.getElementById('tdMessage');
	if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
		var response = xmlhttp.responseText;
		tdMessage.innerHTML="<br><p style='padding-top:25px;'><b>"+response+"</b></p>";
	}	
	  //tdMessage.innerHTML="<br><p><b>Thanks For Registering...</b></p>";
}

getBrowserSize=function(){
	var bodyWidth = document.documentElement.clientWidth;
	var bodyHeight = document.documentElement.clientHeight;
	
	if(self.innerHeight){
		bodyWidth = self.innerWidth; 
		bodyHeight = self.innerHeight; 	
	}else if(document.documentElement && document.documentElement.clientHeight){
		bodyWidth = document.documentElement.clientWidth; 
		bodyHeight = document.documentElement.clientHeight;
	}else if(document.body){
		bodyWidth = document.body.clientWidth; 
		bodyHeight = document.body.clientHeight; 
	}
	return [bodyWidth,bodyHeight];
}

repositionTransDiv=function(){
	if(this.divs_transparentDiv){
		var arrSize=getBrowserSize();
		this.divs_transparentDiv.style.width = arrSize[0]+'px';
		this.divs_transparentDiv.style.height = arrSize[1]+'px';
		this.divs_transparentDiv.style.top = Math.max(document.body.scrollTop,document.documentElement.scrollTop) + 'px';
		this.divs_transparentDiv.style.left = Math.max(document.body.scrollLeft,document.documentElement.scrollLeft) + 'px';
	}
}
create_transparent=function(){
		this.divs_transparentDiv = document.createElement('DIV');
		this.divs_transparentDiv.className='transparentDiv';
		this.divs_transparentDiv.style.zIndex = 1;
		repositionTransDiv();
		document.body.appendChild(this.divs_transparentDiv);	
}
function openwin(obj)
{	
	placeIt(obj);
	
}
function closewin(obj)
{
	obj = document.getElementById(obj);
	obj.style.visibility = 'hidden';
	divs_transparentDiv.style.display='none';
	
}
function placeIt(obj)
{
	this.create_transparent();
	var arrSize=getBrowserSize();
	obj = document.getElementById(obj);
	//alert(arrSize[0]+":"+arrSize[1]);
	theLeft =(arrSize[0]/2)-(620/2);
	theTop =(arrSize[1]/2)-(500/2)+Math.max(document.body.scrollTop,document.documentElement.scrollTop);
	obj.style.left = theLeft + 'px' ;
	obj.style.top = theTop + 'px' ;
	obj.style.visibility = 'visible';
	return false;
}
window.onscroll = function(){
	repositionTransDiv();
};
