// ActionScript Document

function PrintEmail() {
	var name = 'info';
	var at = '&#64;';
	var domain = 'onestepvisa';
	var ext = '.com';
	document.write('<a href=\"mailto:'+name+at+domain+ext+'\">'+name+at+domain+ext+'</a>');
}

function showMailForm(frmTitle,cvt){
        
    //show overlay div        
    var fondiv=document.getElementById("fon");    
    fondiv.style.display = "block";    
    
    //var bwidth = document.body.clientWidth;
    var bheight=document.body.scrollHeight;
    var getH=GetHeight();
    
    if(getH>bheight) bheight=getH;
    
    var scroll = getScrollY();    
    var topDiv=150+scroll;        

    fondiv.style.height = bheight+"px"
    fondiv.style.width = "100%";
    
    document.getElementById("divcontent").style.top = topDiv+"px";
        
    document.getElementById("divcontent").style.display = "block";
    document.getElementById("mailContent").style.display = "block";    
    
    document.getElementById("form_title").innerHTML=frmTitle;
    document.getElementById("cvt_id").value=cvt;
}
function hideMailForm(){
    document.getElementById("mailState").style.display = "none";    
    document.getElementById("divcontent").style.display = "none";    
    document.getElementById("fon").style.display = "none";    
}

var xmlHttp

function sendMail(){
    document.getElementById("mailContent").style.display = "none";    
    document.getElementById("mailState").style.display = "block";    
    document.getElementById("mailState").innerHTML="<img src='../include/indicator.gif' alt='' />";    
    
    xmlHttp=GetXmlHttpObject()
    if (xmlHttp==null)
    {
        alert ("Browser does not support HTTP Request")
        return
    }
    
    var url="mail.php"
    url=url+"?email="+document.getElementById("frm_email").value
    url=url+"&cvt_id="+document.getElementById("cvt_id").value
    url=url+"&sid="+Math.random()
    xmlHttp.onreadystatechange=stateMail
    xmlHttp.open("GET",url,true)
    xmlHttp.send(null)    
}
function stateMail() 
{ 
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    {        
        document.getElementById("mailState").innerHTML=xmlHttp.responseText 
    }
}

function getScrollY() {
  var scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
  }
  return scrOfY ;
}
function GetHeight()
{
        var y = 0;
        if (self.innerHeight)
        {
                y = self.innerHeight;
        }
        else if (document.documentElement && document.documentElement.clientHeight)
        {
                y = document.documentElement.clientHeight;
        }
        else if (document.body)
        {
                y = document.body.clientHeight;
        }
        return y;
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}