function QueryString(key)
{
	var value = null;
	for (var i=0;i<QueryString.keys.length;i++)
	{
		if (QueryString.keys[i]==key)
		{
			value = QueryString.values[i];
			break;
		}
	}
	return value;
}
QueryString.keys = new Array();
QueryString.values = new Array();

function QueryString_Parse()
{
	var query = window.location.search.substring(1);
	var pairs = query.split("&");
	
	for (var i=0;i<pairs.length;i++)
	{
		var pos = pairs[i].indexOf('=');
		if (pos >= 0)
		{
			var argname = pairs[i].substring(0,pos);
			var value = pairs[i].substring(pos+1);
			QueryString.keys[QueryString.keys.length] = argname;
			QueryString.values[QueryString.values.length] = value;		
		}
	}

}

QueryString_Parse();

// Determine the browser
var NS = (document.layers)? true:false;
var IE = document.all?true:false;

// global variables
var winWidth;

// function called onload and onresize of body
// sets left of MainDiv and sets left of all other divs accordingly
function FixPositioning(){
	var i = 0;
	var MainLeft = 0;
	// Store the new width of the window
	winWidth = (NS)? window.innerWidth : document.body.offsetWidth;

	// Store what should be the new left value of the MainDiv
	if (winWidth > 780) {
		MainLeft = ((winWidth / 2) - 389);
	}else{
		MainLeft = 0;
	}

	// Set MainDiv left 
	document.getElementById("tb").style.left = MainLeft + "px";

	// For each DIV, sets it's LEFT accordingly
	if (document.getElementById("kitchen") != null)
		document.getElementById("kitchen").style.left = MainLeft + 8 + "px";
	if (document.getElementById("bath") != null)
		document.getElementById("bath").style.left = MainLeft + 84 + "px";
	if (document.getElementById("shower") != null)
		document.getElementById("shower").style.left = MainLeft + 137 + "px";
	if (document.getElementById("aboutrohlmain") != null)
		document.getElementById("aboutrohlmain").style.left = MainLeft + 459 + "px";
	if (document.getElementById("news") != null)
		document.getElementById("news").style.left = MainLeft + 558 + "px";
}


var arDivs = new Array();
arDivs[0] = "kitchen";
arDivs[1] = "bath";
arDivs[2] = "shower";
arDivs[3] = "aboutrohlmain";
arDivs[4] = "news";

var ___AlPageIsLoaded = null;

function showmenu(what){
	if(___AlPageIsLoaded)
	{
		for(i=0;i<arDivs.length;i++){
			document.getElementById(arDivs[i]).style.display="none";	
		}
		if(what!=''){
			document.getElementById(what).style.display="block";
		}
	}
	else if(___AlPageIsLoaded == null)
	{
		try
		{
			eval("document.body.onload = function(){ FixPositioning(); ___AlPageIsLoaded = true;" + document.body.onload + " }");
			eval("document.body.onresize = function(){ FixPositioning(); " + document.body.onresize + " }");
		}
		catch(err)
		{
		}
		try
		{
			eval("document.documentElement.onload = function(){ FixPositioning(); ___AlPageIsLoaded = true;" + document.documentElement.onload + " }");
			eval("document.documentElement.onresize = function(){ FixPositioning(); " + document.documentElement.onresize + " }");
		}
		catch(err)
		{
		}
		___AlPageIsLoaded = false;
	}
}

function mo(id,sw){
	try{
	document.getElementById(id).src= site_url +"/common/images/nav/"+id+"_"+sw+".gif";
	}
	catch(err){}
}

function mainmo(what,sw){
	if(sw==0){
		document.getElementById("img"+currentpage).src= site_url + "/common/images/nav/"+currentpage+"_1.gif";
		document.getElementById("img"+what).src= site_url +"/common/images/nav/"+what+"_0.gif";
	}else{
		document.getElementById("img"+currentpage).src= site_url +"/common/images/nav/"+currentpage+"_0.gif";
		document.getElementById("img"+what).src= site_url +"/common/images/nav/"+what+"_1.gif";
	}
}

function navhighlight(){
		document.getElementById("img"+currentpage).src= site_url +"/common/images/nav/"+currentpage+"_1.gif";
}

var site_url="http://rohl.rbcreate.com";