function animate_menu(id,type) { 
	var ele = document.getElementById("button"+id);
	if (type == "on") {
		ele.style.paddingTop = "67px";
		ele.style.paddingBottom = "25px";
		ele = document.getElementById("b"+id);
		ele.style.borderBottom = "2px solid #F46C32";
	} else {
		ele.style.paddingTop = "47px";
		ele.style.paddingBottom = "45px";
		var text = ele.innerHTML;
		text = text.replace('<span class="menu_orange_letter">', "");
		text = text.replace("</span>", "");
		ele = document.getElementById("b"+id);
		ele.style.borderBottom = "0px solid #F46C32";
	}
}

function add_rel(id,type) { 
	var allimgs = document.getElementsByTagName("a");

	for(var x=0;x<allimgs.length;x++) {  
		if ((allimgs[x].innerHTML.indexOf("img ") != '-1') && (allimgs[x].href.indexOf("images") != '-1'))
			allimgs[x].rel = "lightbox[p]";
	}
}

function overlay(image,width,height) {
	var overl = document.getElementById("overlay_for_lightbox");
	var sub_overl = document.getElementById("sub_overlay_for_lightbox");

	if (overl.style.display == "none")	overl.style.display = "block";
	else				overl.style.display = "none";
	if (sub_overl.style.display == "none")	sub_overl.style.display = "block";
	else					sub_overl.style.display = "none";
	type=image.split(".");
	type=type[type.length-1];
	var height1="";
	if (width == "") {
		width2 = "width: 150px;";
		width1 = "width='150'";
	}
	else {
		width2 = "width:"+width+"px;";
		width1 = "width='"+width+"px'";
	}
	if (height != "") {
		height2 = "height:"+height+"px;";
		height1 = "height='"+height+"px'";
	}
	else
		height2 = "height:150px;";
	sub_overl.style.height=getScrollY()+"px";
	overl.style.height=getScrollY()+"px";
	innerhtml = "";
	if (type=="swf") {
		innerhtml = '<div id="player_container" style="background:#ffffff; text-align: center; padding:20px; text-align:center; width: '+(width+40)+'px; height: '+height+'px; padding-top: 10px; padding-bottom: 10px;">';
		innerhtml = innerhtml+'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,42,0" id="'+image+'" '+width1+' '+height1+'>';
		innerhtml = innerhtml+'<param name="movie" value="'+image+'">';
		innerhtml = innerhtml+'<param name="bgcolor" value="#FFFFFF">';
		innerhtml = innerhtml+'<param name="quality" value="high">';
		innerhtml = innerhtml+'<param name="allowscriptaccess" value="samedomain">';
		innerhtml = innerhtml+'<param name="allowscale" value="false">';
		innerhtml = innerhtml+'<embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" '+width1+' '+height1+' name="'+image+'" src="'+image+'" bgcolor="#FFFFFF" quality="high" swLiveConnect="true" allowScriptAccess="samedomain">';
		innerhtml = innerhtml+'</embed>';
		innerhtml = innerhtml+'</object>';
		innerhtml = innerhtml+'</div><div id="footer_container" style="width: '+(width+40)+'px; height: 30px; background-color: #ffffff; padding: 20px; padding-top: 0px; padding-bottom: 0px;"><table style="width: 100%; height: 22px;"><tr><td style="width: 100%; background-color: #ffffff; text-align: right;"><a href="javascript:closediv();"><img src="./images/closelabel.png" border="0" /></a></td></tr></table></div>';
		document.getElementById("overlay_for_lightbox").innerHTML=innerhtml;
	} else if (type=="flv") {
		innerhtml = '<div id="player_container" style="background:#ffffff; text-align: center; padding:20px; text-align:center; width: 400px; height: 400px;">';
		innerhtml = innerhtml+'<a  href="'+image+'" style="display:block;" width=240 height=64 id="player"></a> ';
		innerhtml = innerhtml+'</div><div id="footer_container" style="width: 400px; height: 30px; background-color: #ffffff; padding: 20px; padding-top: 0px; padding-bottom: 0px;"><table style="width: 100%; height: 22px;"><tr><td style="width: 100%; background-color: #ffffff; text-align: right;"><a href="javascript:closediv();"><img src="./images/closelabel.png" border="0" /></a></td></tr></table></div>';
		document.getElementById("overlay_for_lightbox").innerHTML=innerhtml;
		flowplayer("player", "./other/player.swf",{ clip: { onStart: function(clip) { var wrap = this.getParent();  document.getElementById("player_container").style.width = clip.width+"px"; document.getElementById("footer_container").style.width = clip.width+"px"; document.getElementById("player_container").style.height=(clip.height+"px");  }}  }); 
	} else if ((type=="mp3")||(type=="wav")) {
		innerhtml = '<div id="player_container" style="background:#ffffff; text-align: center; padding:20px; text-align:center; width: 290px; height: 84px; padding-top: 10px; padding-bottom: 10px;">';
		innerhtml = innerhtml+'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,42,0" id="'+image+'" width=240 height=64>';
		innerhtml = innerhtml+'<param name="movie" value="./other/mp3player.swf">';
		innerhtml = innerhtml+'<param name="bgcolor" value="#FFFFFF">';
		innerhtml = innerhtml+'<param name="quality" value="high">';
		innerhtml = innerhtml+'<param name="allowscriptaccess" value="samedomain">';
		innerhtml = innerhtml+'<param name="allowscale" value="false">';
		innerhtml = innerhtml+'<param name="flashvars" VALUE="src='+image+'&amp;autostart=no&amp;loop=no">';
		innerhtml = innerhtml+'<embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width=240 height=64 name="'+image+'" src="./other/mp3player" bgcolor="#FFFFFF" quality="high" swLiveConnect="true" allowScriptAccess="samedomain" flashvars="src='+image+'&amp;autostart=no&amp;loop=no">';
		innerhtml = innerhtml+'</embed>';
		innerhtml = innerhtml+'</object>';
		innerhtml = innerhtml+'</div><div id="footer_container" style="width: 290px; height: 30px; background-color: #ffffff; padding: 20px; padding-top: 0px; padding-bottom: 0px;"><table style="width: 100%; height: 22px;"><tr><td style="width: 100%; background-color: #ffffff; text-align: right;"><a href="javascript:closediv();"><img src="./images/closelabel.png" border="0" /></a></td></tr></table></div>';
		document.getElementById("overlay_for_lightbox").innerHTML=innerhtml;
	} else {
		innerhtml = '<div id="player_container" style="background:#ffffff; text-align: center; padding:20px; text-align:center; width: '+(width+40)+'px; height: '+height+'px; padding-top: 10px; padding-bottom: 10px;">';
		innerhtml = innerhtml+'<img id="lightbox_image" src="./images/image.php?img=../'+image+'&w='+width+'&h='+height+'" >';
		innerhtml = innerhtml+'</div><div id="footer_container" style="width: '+(width+40)+'px; height: 30px; background-color: #ffffff; padding: 20px; padding-top: 0px; padding-bottom: 0px;"><table style="width: 100%; height: 22px;"><tr><td style="width: 100%; background-color: #ffffff; text-align: right;"><a href="javascript:closediv();"><img src="./images/closelabel.png" border="0" /></a></td></tr></table></div>';
		document.getElementById("overlay_for_lightbox").innerHTML=innerhtml;
	}
}

function closediv(div) {
	document.getElementById("overlay_for_lightbox").style.display="none";
	document.getElementById("overlay_for_lightbox").innerHtml="&nbsp;";
	document.getElementById("sub_overlay_for_lightbox").style.display="none";
}

function getScrollY() {
	if (window.innerHeight && window.scrollMaxY) 			yWithScroll = window.innerHeight + window.scrollMaxY;
	else if (document.body.scrollHeight > document.body.offsetHeight) 	yWithScroll = document.body.scrollHeight;
	else								yWithScroll = document.body.offsetHeight;
	return yWithScroll;
}

