var xmlHttp
function GetXmlHttpObject()	{
	var xmlHttp=null;
	try	{
		xmlHttp=new XMLHttpRequest();
	} catch (e)	{
		try	{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e)	{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}
function add_popup(obj){
  
 
	 var win_width = 0;
	 var win_height=0;
        if (self.innerHeight)
        {
                win_height = self.innerHeight;
				win_width = self.innerWidth;				
        }
        else if (document.documentElement && document.documentElement.clientHeight)
        {
                win_height = document.documentElement.clientHeight;
				win_width = document.documentElement.clientWidth;
        }
        else if (document.body)
        {
                win_height = document.body.clientHeight;
				win_width = document.body.clientWidth;
        }
		var main_div=document.getElementById('emailcontent').offsetHeight;
		var new_height=win_height-main_div;
		var new_top=((win_height-520)/2);
		if(new_height<0)
		{
			new_height=5;
		}
		else
		{
			new_height=new_height+5;
		}
	document.getElementById('window_trans').style.display="block";
	document.getElementById('window_trans').style.height=document.getElementById('emailcontent').offsetHeight+220+"px";
	swf_x = document.documentElement.clientWidth;
	if(document.documentElement.clientWidth>800)
		document.getElementById(obj).style.left=(swf_x-440)/2+"px";
	else
		document.getElementById(obj).style.left=165+"px";

	document.getElementById('window_trans').style.width=win_width+"px";
	document.getElementById(obj).style.top=document.documentElement.scrollTop+new_top+'px';
	document.getElementById(obj).style.display="block";
 
	
}

function close_popup(obj){
 

	document.getElementById('window_trans').style.display="none";
	document.getElementById(obj).style.display="none";
	
}


function fnvalidate(){
 
 
 if(isNull(document.mail_form.txtname,"Name")){return false;}
 if(isNull(document.mail_form.txtemail,"Email")){return false;}
 if(document.mail_form.txtemail.value!=""){
  if(notEmail(document.mail_form.txtemail,"Email")){return false;}
 }
 if(isNull(document.mail_form.txtfriendname,"Friend Name")){return false;}
 if(isNull(document.mail_form.txtfriendemail,"Friend Email")){return false;}
 //if(document.mail_form.txtfriendemail.value!=""){
  //if(notEmail(document.mail_form.txtfriendemail,"Friend Email")){return false;}
 //}
 if(isNull(document.mail_form.txtmessage,"Message")){return false;}
 
 
}
 
 
function sendpage(title,page){
  xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	} 
	
	var url="sendmail.php?title="+title+"&page="+page;
	xmlHttp.onreadystatechange=pinrange_change;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function pinrange_change() {
  
	if (xmlHttp.readyState==4)
	{ 
	  var result = xmlHttp.responseText;
	  document.getElementById('mypage').style.display="block";
	  document.getElementById('mypage').innerHTML=result;
	  //document.getElementById('window_trans').style.display="block";
	  add_popup('ASSADDID');
	  
	  
	 // alert(result);
	  //document.getElementById('ASSADDID').style.display="none";
	  //document.location.href="ngc_hours_tickets.html";
	}
}

function fncancel(page){
  document.mail_form.txtname.value="";
  document.mail_form.txtemail.value="";
  document.mail_form.txtfriendname.value="";
  document.mail_form.txtfriendemail.value="";
  document.mail_form.txtmessage.value="";
  document.getElementById('ASSADDID').style.display="none";
  document.location.href=page;
}