var url = window.location.href;

function iniPage(){
	els = $('div.rollOffDiv')
	
	for (var i=0; i<els.length; i++){
		els[i].onmouseover = function(){rollOver(this, true);}
		els[i].onmouseout = function(){rollOver(this, false);}
	}	
	redirectPage();
	testURL
	
	$("#ContentRightDiv").load("pages/RightSide.gcf");
	

}

function testURL(){
    if (window.location.href==url){
        setTimeout(testURL, 100);
    }else{
       redirectPage();
    }    

}

function redirectPage(){
	var urlArr = parseQS()
	if (urlArr.length > 1){
		goTo(urlArr[1].replace("!pageID=",""));
	}else{
		goTo('Home')
	}
	url = window.location.href;
	setTimeout(testURL, 100);
}
 
function rollOver(el, over){
	if (over){
		el.className = "rollOnDiv"
	}else{
		el.className = "rollOffDiv"
	}
	//sh(el.id.replace("m", ""))
}
 
 
function $g(id){
	if (document.getElementById(id)){
		return document.getElementById(id);
	}else{
		//alert("$ " + id + " is null");
		return false
	}
}

function parseQS(){
	var url = window.location.href
	return url.split("#")
}

function gPID(){
	return parseQS()[1].replace("!pageID=","")
}


