// JavaScript Document
// JavaScript Document
// JavaScript Document

	/***********************************************
	* Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
	* This notice MUST stay intact for legal use
	* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
	***********************************************/
	
	
	
	
	
	
	
	
	
	var bustcachevar=0 //bust potential caching of external pages after initial request? (1=yes, 0=no)
	var loadedobjects=""
	var rootdomain="http://"+window.location.hostname
	var bustcacheparameter=""
	
	function ajaxpage(url, containerid){
		var page_request = false
		if (window.XMLHttpRequest) // if Mozilla, Safari etc
		page_request = new XMLHttpRequest()
		else if (window.ActiveXObject){ // if IE
			try {
				page_request = new ActiveXObject("Msxml2.XMLHTTP")
			} 
			catch (e){
				try{
					page_request = new ActiveXObject("Microsoft.XMLHTTP")
				}
				catch (e){}
				}
			}
		else
			return false
		page_request.onreadystatechange=function(){
			loadpage(page_request, containerid)
		}
		if (bustcachevar) //if bust caching of external page
		bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
		page_request.open('POST', url+bustcacheparameter, true)
		page_request.send(null)
	}
		function loadpage(page_request, containerid){
		if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
				document.getElementById(containerid).style.display='block';	
				document.getElementById(containerid).innerHTML=page_request.responseText
				
							
		  }
		  else
		  	document.getElementById(containerid).innerHTML='<div align="center">Please Wait ...</div>';
			
	}

	
	
	
	
	
	
	
	
	
	

function LoadPage(page,usediv) {
         // Set up request varible
         try {xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");}  catch (e) { alert("Error: Could not load page.");}
         //Show page is loading
       
         //scroll to top
         scroll(0,0);
         //send data
         xmlhttp.onreadystatechange = function(){
                 //Check page is completed and there were no problems.
                 if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
                        //Write data returned to page
						document.getElementById(usediv).style.display='block';	
                        document.getElementById(usediv).innerHTML = xmlhttp.responseText;
                 }
                 else
                 {
                 	 document.getElementById(usediv).style.display='block';	
			document.getElementById(usediv).innerHTML='<div style="padding:50px 0"><img src="http://papatoto.com/images/ajax-loader.gif" style="padding-left:20px;"><span style="font:18px; color:#686868; margin-left:20px;">Sending Email</span></div>';
                 }
         }
         xmlhttp.open("GET", page);
         xmlhttp.send(null);
         //Stop any link loading normaly
         return false;
}


function LoadPage1(page,usediv) {
         // Set up request varible
		// alert(page);
         try {xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");}  catch (e) { alert("Error: Could not load page.");}
         //Show page is loading
       
         //scroll to top
         scroll(0,0);
         //send data
         xmlhttp.onreadystatechange = function(){
                 //Check page is completed and there were no problems.
                 if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
                        //Write data returned to page
						document.getElementById(usediv).style.display='block';	
                        document.getElementById(usediv).innerHTML = xmlhttp.responseText;
                 }
                 else
                 {
                 	
			document.getElementById(usediv).innerHTML='<img src="images/ajax-loader.gif" style="padding-left:20px;"><span style="font:18px; color:#686868; margin-left:20px;">Sending Email</span>';
                 }
         }
         xmlhttp.open("GET", page);
         xmlhttp.send(null);
         //Stop any link loading normaly
         return false;
}

function LoadPage2(page,usediv) {
         // Set up request varible
		//alert(page);
         try {xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");}  catch (e) { alert("Error: Could not load page.");}
         //Show page is loading
       
         //scroll to top
         scroll(0,0);
         //send data
         xmlhttp.onreadystatechange = function(){
                 //Check page is completed and there were no problems.
                 if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
                        //Write data returned to page
						document.getElementById(usediv).style.display='block';	
                        document.getElementById(usediv).innerHTML = xmlhttp.responseText;
                 }
                 else
                 {
                 	
			document.getElementById(usediv).innerHTML='<div style="padding:50px 0"><img src="images/ajax-loader.gif" style="padding-left:20px;"><span style="font:18px; color:#686868; margin-left:20px;">Sending Email</span></idv>';
                 }
         }
         xmlhttp.open("GET", page);
         xmlhttp.send(null);
         //Stop any link loading normaly
         return false;
}

