var headerImgUrl;

function genChangeBG(eleId, address){
	var el = document.getElementById(eleId);
	if(el==null)
	{
		alert("el is null");
		return;
	}
	
	el.style.backgroundImage=address;
}
function genChangeBGPic(eleId, address){
	var el = document.getElementById(eleId);
	if(el==null)
	{
		alert("el is null");
		return;
	}
	
	el.style.backgroundImage=address;
}

function sizeObjHToWin(obj){
	var h = document.documentElement.clientHeight;
	obj.style.height = h.toString().concat("px");
}

function sizeObjWToWin(obj){
	var w = document.documentElement.clientWidth;
	obj.style.width = w.toString().concat("px");
}

function sizeObjHtoBod(obj){
	var h = document.getElementById("pgbody");
	obj.style.height = h.toString().concat("px");
}

function sizeObjWtoBod(obj){
	var w = document.getElementById("pgbody");
	obj.style.width = w.toString().concat("px");
}

function initstuff(bodName){
	sizeObjHToWin(bodName);
}
function changeColor(co, el, bg){
	var elt = document.getElementById(el);
	elt.style.color=co;
	if(bg!=null)
	elt.style.bgcolor=bg;		
}

function showElement(layer){
	var myLayer= document.getElementById(layer);
	if(myLayer.style.display=="none"){
		myLayer.style.display="block";
		myLayer.backgroundPosition="top";
	}else{
		myLayer.style.display="none";
	}
}

function setImgUrl(imageId,loc){
	var i = document.getElementById(imageId);	
		i.setAttribute("src",loc);
		headerImgUrl=loc;
}

function HdrSetImgUrl(){
	var l = document.getElementById("gp_ImageHdr");
	if(headerImgUrl==null)
	{		
		l.setAttribute("ImageUrl","images/FamGuardLinki.jpg");
	}	
	else{
		l.setAttribute("ImageUrl",headerImgUrl);
	}
}

function showElement(layer){
	var myLayer=document.getElementById(layer);
	if(myLayer.style.display=="none"){
		myLayer.style.display="block";
		//myLayer.backgroundPosition="top";
	}else{
		myLayer.style.display="none";
	}
}