msgWindow=false;
valid_phone=false;
form_updated=false;


function newWindow(file,window,x,y,resize) {
    if(resize){resize='yes';}else{resize='no';}
    msgWindow=open(file,window,'menubar=no,toolbar=no,status=no,resizable='+resize+',width='+x+',height='+y);
    if (msgWindow.opener == null) msgWindow.opener = self;
    return true;
}

//function csw_action(mycontrol,mydiv,myfunction,mytype,mytable,myfields,myvalues,myreload)
function csw_action(mycontrol,mydiv,myfunction)
{
    mytype=false;
    mytable=false;
    myfields=false;
    myvalues=false;
    
  
    
    //var params = "control="+escape(mycontrol)+"&mydiv="+escape(mydiv)+"&function="+escape(myfunction)+"&type="+escape(mytype)+"&table="+escape(mytable)+"&fields="+escape(myfields)+"&values="+escape(myvalues);
    var params = "control="+escape(mycontrol)+"&mydiv="+escape(mydiv)+"&function="+escape(myfunction);
    params = params.replace('+','%2B');   //Added 08-03-06 to preserve a '+' in values

    var xmlHttp;
    try
    {
        // Firefox, Opera 8.0+, Safari
        xmlHttp=new XMLHttpRequest();
    }
    catch (e)
    {
    // Internet Explorer
        try
        {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e)
        {
            try
            {
                xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e)
            {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }
    xmlHttp.onreadystatechange=function()
    {
        //alert(xmlHttp.status);
        if(xmlHttp.readyState==4)
        {
            ////alert(xmlHttp.status);
            //if(myaction == "data") 
            //{
            //    document.getElementById('myAlert').className="MsgError";
            //    document.getElementById('myAlert').innerHTML=xmlHttp.responseText;
			//    setTimeout("csw_myAlert_Clear()",10000);
            //    //setTimeout("csw_show_page_info()",2000);
            //}
            //if( myaction == "session")
            //{
            //    document.getElementById('myAlert').className="MsgError";
            //    document.getElementById('myAlert').innerHTML=xmlHttp.responseText;
			//    setTimeout("csw_myAlert_Clear()",10000);
            //}
            //if ( myaction == "display")
            //{
                document.getElementById(mydiv).innerHTML= xmlHttp.responseText;
            //    //alert(xmlHttp.responseText)
            //}
 	    }
    }

    xmlHttp.open("POST","ajax.php",true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader("Content-length", params.length);
    xmlHttp.setRequestHeader("Connection", "close");    
    
    xmlHttp.send(params);
return true;
}

function csw_myAlert_Clear()
{
    document.getElementById('myAlert').innerHTML='';
    document.getElementById('myAlert').className='';
}








    
