
 // JavaScript Document
function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
		obj.style.display = iState ?  "block" : "none";

    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
		document.all[szDivID].style.visibility = iState ? "block" : "none";
    }


	var countryDivArray=new Array("IDUnitedKingdom","IDHolland","IDBelgium","IDGermany","IDSwitzerland","IDItaly","IDUnitedStates","IDCanada","IDJapan");    
		var divName;
	
}
function PopupCenter(pageURL, title,w,h) {
	var left = (screen.width/2)-(w/2);
	var top = (screen.height/2)-(h/2);
	var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
} 

function moveWindow (anchorName){
		//document.getElementById('locationDiv').location.hash = anchorName;
		window.location.hash = anchorName;
		//abPopup(550, 680, 'filter', 'bgImage', 'box');
}


function loadAbCountyHeader() {
	var error = "";
	var file = booCompanyStoreXML;
	var xmlDoc=null;
	try //Internet Explorer
	{
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async=false;
		xmlDoc.load(file);
	}
	catch(e)
	{
		try //Firefox, Mozilla, Opera, etc.
		{
			xmlDoc=document.implementation.createDocument("","",null);
			xmlDoc.async=false;
			xmlDoc.load(file);
		}
		catch(e)
		{
			try //Google Chrome
			{
				var xmlhttp = new window.XMLHttpRequest();
				xmlhttp.open("GET",file,false);
				xmlhttp.send(null);
				xmlDoc = xmlhttp.responseXML.documentElement;
			}
			catch(e)
			{
				error=e.message;
				
			}
		}
	}
	
	
	if (xmlDoc!=null) 
	{
		var x=xmlDoc.getElementsByTagName("store");
		
		var curState = "0";
		
		for (var i=0;i<x.length;i++)
		{ 
			
			var nextState = x[i].getElementsByTagName("storeCountry")[0].childNodes[0].nodeValue;
			
			if (curState != nextState) {
				if (curState != 0) {
					document.write(" - ");
				}
				else {
					document.write('<a name="top"></a>');
				}
				document.write('<a href="#" onclick="moveWindow(\'');
				document.write(x[i].getElementsByTagName("storeCountry")[0].childNodes[0].nodeValue);
				document.write('\'); return false;">');
				document.write(x[i].getElementsByTagName("storeCountry")[0].childNodes[0].nodeValue);
				document.write('</a>');
				curState = x[i].getElementsByTagName("storeCountry")[0].childNodes[0].nodeValue;
			}
			
		}
	
	}

}



function loadAbStoreList(countryName) {
	
	var error = "";
	var file = booCompanyStoreXML;
	var xmlDoc=null;
	try //Internet Explorer
	{
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async=false;
		xmlDoc.load(file);
	}
	catch(e)
	{
		try //Firefox, Mozilla, Opera, etc.
		{
			xmlDoc=document.implementation.createDocument("","",null);
			xmlDoc.async=false;
			xmlDoc.load(file);
		}
		catch(e)
		{
			try //Google Chrome
			{
				var xmlhttp = new window.XMLHttpRequest();
				xmlhttp.open("GET",file,false);
				xmlhttp.send(null);
				xmlDoc = xmlhttp.responseXML.documentElement;
			}
			catch(e)
			{
				error=e.message;
				
			}
		}
	}
	
	if (xmlDoc!=null) 
	{
	
		var x=xmlDoc.getElementsByTagName("store");
		
		var curState = "0";
		
		for (var i=0;i<x.length;i++)
		{ 
		
			var country = x[i].getElementsByTagName("storeCountry")[0].childNodes[0].nodeValue;
			if (country == countryName){
			var nextState = x[i].getElementsByTagName("storeState")[0].childNodes[0].nodeValue;
					
			if (curState != nextState) {
				
				if (curState != 0) {
					document.write('<tr class="normal"><td colspan="4"><a style="" href="#" onclick="moveWindow(\'top\'); return false;">Back to top</a>');
					document.write('</td></tr>');
				}
				
				document.write('<tr class="normalActive"><td colspan="4"><a style="font-weight: bold;" name="');
				document.write(x[i].getElementsByTagName("storeState")[0].childNodes[0].nodeValue);
				document.write('">');
				document.write(x[i].getElementsByTagName("storeState")[0].childNodes[0].nodeValue);
				document.write('</a>');
				curState = x[i].getElementsByTagName("storeState")[0].childNodes[0].nodeValue;
				document.write('</td></tr>');
			}
			
			document.write('<tr onmouseover="this.className=\'normalActive\'" onmouseout="this.className=\'normal\'" class="normal" valign="top">');
			
			document.write('<td >');
			document.write(x[i].getElementsByTagName("storeName")[0].childNodes[0].nodeValue);
			document.write("</td>");
			
			document.write("<td>");
			try {
				document.write(x[i].getElementsByTagName("storeAddress")[0].childNodes[0].nodeValue);
				document.write("<br/> ");
				}
			catch (e){}
			try {
				document.write(x[i].getElementsByTagName("storeCity")[0].childNodes[0].nodeValue);
				document.write(" ");
			}
			catch (e){}
				document.write(x[i].getElementsByTagName("storeState")[0].childNodes[0].nodeValue);
				document.write(" ");
			try {
				document.write(x[i].getElementsByTagName("storeZip")[0].childNodes[0].nodeValue);
			}
			catch (e){}
			document.write("</td>");
			
			
			document.write("<td>");
			try{
				document.write(x[i].getElementsByTagName("storePhone")[0].childNodes[0].nodeValue);
			}
			catch (e){}
			document.write("</td>");
			
			document.write('<td align="right">');
			try{
				document.write(x[i].getElementsByTagName("storeWeb")[0].childNodes[0].nodeValue);
			}
			catch (e){}
			document.write("</td>");
			
			
			document.write("</tr>");
		}
		}
	
		document.write('<tr class="normal"><td colspan="4"><a style="" href="#" onclick="moveWindow(\'top\'); return false;">Back to top</a>');
		document.write('</td></tr>');

	
	}

}




function loadAbHeader(countryName) {
	var error = "";
	var file = booCompanyStoreXML;
	var xmlDoc=null;
	try //Internet Explorer
	{
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async=false;
		xmlDoc.load(file);
	}
	catch(e)
	{
		try //Firefox, Mozilla, Opera, etc.
		{
			xmlDoc=document.implementation.createDocument("","",null);
			xmlDoc.async=false;
			xmlDoc.load(file);
		}
		catch(e)
		{
			try //Google Chrome
			{
				var xmlhttp = new window.XMLHttpRequest();
				xmlhttp.open("GET",file,false);
				xmlhttp.send(null);
				xmlDoc = xmlhttp.responseXML.documentElement;
			}
			catch(e)
			{
				error=e.message;
				
			}
		}
	}
	
	
	if (xmlDoc!=null) 
	{
		var x=xmlDoc.getElementsByTagName("store");
		
		var curState = "0";
		
		for (var i=0;i<x.length;i++)
		{ 
			var country = x[i].getElementsByTagName("storeCountry")[0].childNodes[0].nodeValue;
			var nextState = x[i].getElementsByTagName("storeState")[0].childNodes[0].nodeValue;
			if (country == countryName){
				if (curState != nextState) {
					if (curState != 0) {
						document.write(" - ");
					}
					else {
						document.write('<a name="top"></a>');
					}
					document.write('<a href="#" onclick="moveWindow(\'');
					document.write(x[i].getElementsByTagName("storeState")[0].childNodes[0].nodeValue);
					document.write('\'); return false;">');
					document.write(x[i].getElementsByTagName("storeState")[0].childNodes[0].nodeValue);
					document.write('</a>');
					curState = x[i].getElementsByTagName("storeState")[0].childNodes[0].nodeValue;
				}
			}
			
		}
	
	}

}



function loadAbStoreListNoState(countryName) {
	
	var error = "";
	var file = booCompanyStoreXML;
	var xmlDoc=null;
	try //Internet Explorer
	{
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async=false;
		xmlDoc.load(file);
	}
	catch(e)
	{
		try //Firefox, Mozilla, Opera, etc.
		{
			xmlDoc=document.implementation.createDocument("","",null);
			xmlDoc.async=false;
			xmlDoc.load(file);
		}
		catch(e)
		{
			try //Google Chrome
			{
				var xmlhttp = new window.XMLHttpRequest();
				xmlhttp.open("GET",file,false);
				xmlhttp.send(null);
				xmlDoc = xmlhttp.responseXML.documentElement;
			}
			catch(e)
			{
				error=e.message;
				
			}
		}
	}
	
	if (xmlDoc!=null) 
	{
	
		var x=xmlDoc.getElementsByTagName("store");
		
		var curState = "0";
		
		for (var i=0;i<x.length;i++)
		{ 
		
			var country = x[i].getElementsByTagName("storeCountry")[0].childNodes[0].nodeValue;
			if (country == countryName){
			var nextState = x[i].getElementsByTagName("storeState")[0].childNodes[0].nodeValue;
					
			if (curState != nextState) {
				
				if (curState != 0) {
					document.write('<tr class="normal"><td colspan="4"><a style="" href="#" onclick="moveWindow(\'top\'); return false;">Back to top</a>');
					document.write('</td></tr>');
				}
				
				document.write('<tr class="normalActive"><td colspan="4"><a style="font-weight: bold;" name="');
				document.write(x[i].getElementsByTagName("storeState")[0].childNodes[0].nodeValue);
				document.write('">');
				document.write(x[i].getElementsByTagName("storeState")[0].childNodes[0].nodeValue);
				document.write('</a>');
				curState = x[i].getElementsByTagName("storeState")[0].childNodes[0].nodeValue;
				document.write('</td></tr>');
			}
			
			document.write('<tr onmouseover="this.className=\'normalActive\'" onmouseout="this.className=\'normal\'" class="normal" valign="top">');
			
			document.write('<td >');
			document.write(x[i].getElementsByTagName("storeName")[0].childNodes[0].nodeValue);
			document.write("</td>");
			
			document.write("<td>");
			try {
				document.write(x[i].getElementsByTagName("storeAddress")[0].childNodes[0].nodeValue);
				document.write("<br/> ");
				}
			catch (e){}
			try {
				document.write(x[i].getElementsByTagName("storeCity")[0].childNodes[0].nodeValue);
				document.write(" ");
			}
			catch (e){}
				
			try {
				document.write(x[i].getElementsByTagName("storeZip")[0].childNodes[0].nodeValue);
			}
			catch (e){}
			document.write("</td>");
			
			
			document.write("<td>");
			try{
				document.write(x[i].getElementsByTagName("storePhone")[0].childNodes[0].nodeValue);
			}
			catch (e){}
			document.write("</td>");
			
			document.write('<td align="right">');
			try{
				document.write(x[i].getElementsByTagName("storeWeb")[0].childNodes[0].nodeValue);
			}
			catch (e){}
			document.write("</td>");
			
			
			document.write("</tr>");
		}
		}
	
		document.write('<tr class="normal"><td colspan="4"><a style="" href="#" onclick="moveWindow(\'top\'); return false;">Back to top</a>');
		document.write('</td></tr>');

	
	}

}




