function hideAll(){
	for(i=1;i<5;i++){
		if(document.getElementById("top"+i+"_sub")){
			document.getElementById("top"+i+"_sub").style.visibility = "hidden";
			if(document.getElementById("top"+i+"_sub").style.visibility == "hidden"){
				document.getElementById("top"+i).style.backgroundColor ="#0099d2"
			}
		}
	}
}


function setTopStateOn(tdObj){
	hideAll();
	tdObj.style.backgroundColor ="#00cccb"
	selObjId = tdObj.id;
	selSubObj = selObjId+"_sub";
	if(document.getElementById(selSubObj)){
		document.getElementById(selSubObj).style.visibility = "visible";
	}
}

function setTopStateOff(tdObj){
	selObjId = tdObj.id;
	selSubObj = selObjId+"_sub";
	tdObj.style.backgroundColor ="#0099d2"
	if(document.getElementById(selSubObj)){
		if(document.getElementById(selSubObj).style.visibility == "visible"){
			tdObj.style.backgroundColor ="#00cccb"
		}
	}
}
/*var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}*/

function openPop(imgName){
	
	/*LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	alert(TopPosition)
	var Props = 'top='+TopPosition+',left='+LeftPosition+',location=0,status=0,scrollbars=0,resizable=1,height=200,width=200'*/
	
	Xpos = (screen.width) ? (screen.width-200)/2 : 0;
	Ypos = (screen.height) ? (screen.height-200)/2 : 0;
	Props = 'height=200,width=200,top='+Ypos+',left='+Xpos+',scrollbars=0,resizable=1'
	
	window.open('site_imgpopup.php?img='+imgName,'imgPop',Props)
}

function setItemStateOn(tdObj){
	tdObj.style.backgroundColor ="#0099d2"
}

function setItemStateOff(tdObj){
	tdObj.style.backgroundColor ="#00cccb"
}
