function topMenuButtonOver(myId,imgURL) { //Change button style onmouseover
	var sender=document.getElementById(myId);
	imgURL=imgURL.substring(0,imgURL.indexOf("."))+"850"+imgURL.substring(imgURL.indexOf("."));
	sender.style.backgroundImage="url("+HOST+"images/"+imgURL+")";
	sender.style.color="#FFF";
	}
function topMenuButtonOut(myId,imgURL) { //Change button style to normal
	var sender=document.getElementById(myId);
	imgURL=imgURL.substring(0,imgURL.indexOf("."))+"850"+imgURL.substring(imgURL.indexOf("."));
	sender.style.backgroundImage="url("+HOST+"images/"+imgURL+")";
	sender.style.color="#000";
	}
function closeRightMenu() { //closes the sidebar
	document.getElementById('sidebar').style.display="none";
	document.getElementById('maincontent').style.width="750px";
	document.getElementById('maincontent').style.paddingRight="50px";
	document.getElementById('maincontentbox').style.backgroundImage="url("+HOST+"images/content-noright.jpg)";
	document.getElementById('footer').style.backgroundImage="url("+HOST+"images/footer-noright.jpg)";
	document.getElementById('subtopmenu').style.backgroundImage="url("+HOST+"images/subtopmenu-open.jpg)";
	}
function openRightMenu() { //opens the sidebar
	document.getElementById('sidebar').style.display="table-cell";
	document.getElementById('maincontent').style.width="575px";
	document.getElementById('maincontent').style.paddingRight="25px";
	document.getElementById('maincontentbox').style.backgroundImage="url("+HOST+"images/content.jpg)";
	document.getElementById('footer').style.backgroundImage="url("+HOST+"images/footer.jpg)";
	document.getElementById('subtopmenu').style.backgroundImage="url("+HOST+"images/subtopmenu.jpg)";
	}
	
function openCloseSide() {
	if(document.getElementById('subtopmenu').style.backgroundImage=="url("+HOST+"images/subtopmenu.jpg)") {
		closeRightMenu();
		}else{
		openRightMenu();
		}
		}

function openLightBox(imgUrl,caption,imgw,imgh){
	var xoffset = getScrollX();
	var yoffset = getScrollY();
	var xsize = getSizeX();
	var ysize = getSizeY();
	var ycellsize = imgh+32;
	var xcellsize = imgw;
	
	imgUrlArr = imgUrl.split("##");
	captionArr= caption.split("##");
	currentIndex=0;
	
	document.getElementById('lbimg').src=HOST+"images/white.gif";
	
	document.getElementById('lbcaption').innerHTML=captionArr[0];
	
	document.getElementById('lbimg').src=imgUrlArr[0];
	document.getElementById('lbimg').style.maxHeight=ycellsize-32;
	document.getElementById('lbimg').style.maxWidth=xcellsize;
	var lightBox = document.getElementById('lightbox');
	lightBox.style.display="inline";
	lightBox.style.top=yoffset;
	lightBox.style.left=xoffset;
	document.body.style.overflow="hidden";
	
	var lightBoxCell = document.getElementById('lightboxcell');
	lightBoxCell.style.display="inline";
	lightBoxCell.style.top=yoffset + (ysize-ycellsize)/2;
	lightBoxCell.style.left=xoffset + (xsize-xcellsize)/2;
	lightBoxCell.style.maxWidth=xcellsize;
	lightBoxCell.style.maxHeight=ycellsize;
	
	if(currentIndex<=0){
		document.getElementById('lbleft').style.visibility="hidden";
	} else {
		document.getElementById('lbleft').style.visibility="visible";
	}
	if(currentIndex>=imgUrlArr.length-1){
		document.getElementById('lbright').style.visibility="hidden";
	} else {
		document.getElementById('lbright').style.visibility="visible";
	}
	
	}

function openLoginForm() { //makes login form appear
	document.getElementById('loginbutton').style.display="none";
	document.getElementById('formoflogin').style.maxWidth="375px";
	}

function initPage() {
	document.getElementById('subtopmenu').style.backgroundImage="url("+HOST+"images/subtopmenu.jpg)";
	loadUpSubMenu();
	}
	

