// JavaScript Document
var topright = "";

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

var css_browser_selector = function() {var ua=navigator.userAgent.toLowerCase(),is=function(t){return ua.indexOf(t) != -1;},h=document.getElementsByTagName('html')[0],b=(!(/opera|webtv/i.test(ua))&&/msie (\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?'gecko ff2':is('firefox/3')?'gecko ff3':is('gecko/')?'gecko':is('opera/9')?'opera opera9':/opera (\d)/.test(ua)?'opera opera'+RegExp.$1:is('konqueror')?'konqueror':is('applewebkit/')?'webkit safari':is('mozilla/')?'gecko':'',os=(is('x11')||is('linux'))?' linux':is('mac')?' mac':is('win')?' win':'';var c=b+os+' js'; h.className += h.className?' '+c:c;}();

function getAjaxProvince(brprov)
{	 
   var xmlHttp;
   document.getElementById('contentDivMain').innerHTML = "<img width=116px height=26px src='images/loading.gif' />";
   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()
   {
      if(xmlHttp.readyState==4) {
	     document.getElementById('contentDivMain').innerHTML=xmlHttp.responseText;
        document.getElementById('brcity').focus();
      }
   }
   xmlHttp.open("GET","scripts/content/branch.php?province=" + brprov + "",true);
   xmlHttp.send(null); 
}

function getAjaxCity(brprov,brcity)
{	 
   var xmlHttp;
   document.getElementById('branchDiv').innerHTML = "<img width=116px height=26px src='images/loading.gif' />";
   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()
   {
      if(xmlHttp.readyState==4) {
	     document.getElementById('branchDiv').innerHTML=xmlHttp.responseText;
      }
   }
   xmlHttp.open("GET","scripts/content/branch.php?province=" + brprov + "&city=" + brcity + "",true);
   xmlHttp.send(null); 
}

function getAjaxBranch(brseqn)
{	 
   var xmlHttp;
   if (brseqn == 0) {
      return;
   }
   topright = document.getElementById('contentTopRight').innerHTML;
   document.getElementById('contentTopRight').innerHTML = "<img width=116px height=26px src='images/loading.gif' />";
   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()
   {
      if(xmlHttp.readyState==4) {
         
	     document.getElementById('contentTopRight').innerHTML=xmlHttp.responseText;
      }
   }
   xmlHttp.open("GET","scripts/content/branch.php?brseqn=" + brseqn + "",true);
   xmlHttp.send(null); 
}

function getBack()
{   
   document.getElementById('contentTopRight').innerHTML = topright;   
}
