var bFireFox=false;

function PicPrev(url, src) {
	url = url + "?src=" + src;
	NewWindow(url, 100, 100, "showimg", "yes");
}

function NewWindow(url, w, h, name, scroll) {
	NewWin = window.open(url,name,"width="+w+",height="+h+",scrollbars="+scroll+",status=no,toolbar=no,menubar=no,resizable=yes");
	NewWin.focus();
}

function preview() {
	url = p + ";bPrint:1";
	printWin = window.open(url, "printpage", "width=570,height=700,scrollbars=yes,status=no,toolbar=no,menubar=yes,resizable=no");
	printWin.focus();
}

function search() {
	document.frmSearch.submit();
}

function newwin(w,h) {
  myparm = 'width='+ w +',height='+ h +',scrollbars=no,status=no,toolbar=no,menubar=no'

  mywindow=window.open('','newwin',myparm)
  mywindow.focus();
}


function show(e)	{
  
  if (document.all) {

	 document.all[e].style.visibility = 'visible';
	}
	else if (document.layers)	{
	
	document.layers[e].visibility = 'show';
	}
	else if (document.getElementById)	{

	document.getElementById(e).style.visibility = 'visible';
  }
  
}

function hide(e)	{
  
  if (document.all)	{

	 document.all[e].style.visibility = 'hidden';
  }
	else if (document.layers)	{
	
	document.layers[e].visibility = 'hidden';
	}
	else if (document.getElementById)	{

	document.getElementById(e).style.visibility = 'hidden';
  }
  
}

function PreloadNavImg(iID){
	arNavImages[iID]=new Array();

	arNavImages[iID][0]=new Image;
	arNavImages[iID][0].src=HBPATH+"img/mnu/mnu_"+iID+"_link.gif";

	//alert(arNavImages[iID][0].src);

	arNavImages[iID][1]=new Image;
	arNavImages[iID][1].src=HBPATH+"img/mnu/mnu_"+iID+"_hover.gif";
	arNavImages[iID][2]=new Image;
	arNavImages[iID][2].src=HBPATH+"img/mnu/mnu_"+iID+"_active.gif";
}

//footer bar functions
function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function setFooter() {

	if ($('footerbar')) {
		if (Browser.Engine.trident) {
			$('footerbar').setStyle('top', ($(document).getSize().y + $(document).getScroll().y - 17) + 'px');
		}
		else {
			$('footerbar').setStyle('bottom', 0);
		}
		$('footerbar').setStyle('display', 'block');
	}

	/*
	if (document.getElementById) {
		var footerElement = document.getElementById('footerbar');
		
		footerElement.style.bottom='0px';
		footerElement.style.background='#F78221';
	}
	*/
}

if (!bFireFox) {
	window.onload = function() {
		setFooter();
	}
	window.onresize = function() {
		setFooter();
	}
	window.onscroll = function() {
		setFooter();
	}
}
// / footer bar functions

var oDivOverlay			=new Element("div",{"id":"overlay"})
var oDivDiaContainerBox	=new Element("div",{"id":"divDiaContainerBox"})
var oDivDiaContainer	=new Element("div",{"id":"divDiaContainer"})
var oSubBox				=new Element("div",{"id":"subBox"})
var oSub				=new Element("div",{"id":"sub"})
 
function ShowVideo(sFilePath){
	//alert(iWidth)
	iScrollHeight=window.getScrollTop();
	iScrollHeight+=140
	sScrollHeight=iScrollHeight+"px"

	//alert(HBPATH+"media/flv/"+sFilePath)

	oDivOverlay.injectTop(document.body)
	oDivDiaContainerBox.injectAfter("overlay")
	oDivDiaContainer.injectInside("divDiaContainerBox")
	oSubBox.injectInside("divDiaContainerBox")
	oSub.injectInside("subBox")

	oDivDiaContainerBox.setStyle("top",sScrollHeight)	

	/*oSub.setHTML('<a href="javascript:CloseVideo()" style="display:block; float:right; color:black; line-height:20px;"><img src="'+HBPATH+'img/closelabel.gif" border="0" style="margin-bottom:5px"></a>');*/
	oSub.set('html', '<a href="javascript:CloseVideo()" style="display:block; float:right; color:black; line-height:20px;"><img src="'+HBPATH+'img/closelabel.gif" border="0" style="margin-bottom:5px"></a>');

	var s1 = new SWFObject(HBPATH+"swf/mediaplayer.swf","video",512,288,"7");					
	
	//alert(HBPATHFULL+"media/flv/"+sFilePath)

	s1.addVariable("file",HBPATHFULL+"media/flv/"+sFilePath);

	s1.addParam("wmode", "oblique");
	s1.addVariable("linktarget","_self");
	s1.addVariable("width",512);
	s1.addVariable("height",288);
	s1.addVariable("autostart","true");


	s1.write("divDiaContainer");
}

function CloseVideo(){
	oDivOverlay.destroy()
	oDivDiaContainerBox.destroy()
	oDivDiaContainer.destroy()
	oSubBox.destroy()
	oSub.destroy()
}