var BrowserName=navigator.appName;
var MMBrowserIE=(BrowserName=="Microsoft Internet Explorer");
var MMBrowserMF=(BrowserName=="Netscape");
window.onload=allMainHheight;
function allMainHheight()
{
	var MainTCell=document.getElementById('MainTCell');
	if(MainTCell && MainTCell.childNodes.length==0)
	{
		if (MMBrowserIE)
		{
			document.getElementById('allDTable').style.height = document.documentElement.scrollHeight;
		}
		else if (document.body)
		{
			document.getElementById('allDTable').style.height = document.body.scrollHeight;
		}
		document.getElementById('allMain').style.height=document.getElementById('allDTable').style.height;
	}
	if(typeof(pgfunction)=="function")
	{
		pgfunction();
	}
}

function objcolor(tobj,tcolor)
{   
	var icolor=tobj.style.color;   
	tobj.style.color=tcolor;
	tobj.className="textdec";   
	tobj.onmouseout= function(){tobj.style.color=icolor;tobj.className='';}
}
function objclassName(tobj,tclassName,dec)
{   
	var iclassName=tobj.className;   
	tobj.className=iclassName +" "+ tclassName;   
	if(dec){
	tobj.className="textdec";
	}
	tobj.onmouseout= function(){tobj.className=iclassName;}
}
function objcolorimg(tobj,tcolor,imgobj,imgsrc)
{   
	var imgobjj=document.getElementById(imgobj);
	var icolor=tobj.style.color;   
	var iimg=imgobjj.src;
	imgobjj.src=imgsrc;
	tobj.style.color=tcolor;
	tobj.className="textdec";
	tobj.onmouseout= function(){tobj.style.color=icolor;tobj.className='';imgobjj.src=iimg;}
}

function AutoHeight(divid)
{
	var Dro=document.getElementById(divid);
	var h;
	for(i=0;i<=Dro.childNodes.length-1;i=i+2)
	{	
		if(Dro.childNodes[i] && Dro.childNodes[i+1] )
		{
			h=Math.max(Dro.childNodes[i].clientHeight,Dro.childNodes[i+1].clientHeight);
			Dro.childNodes[i].style.height=(h+5)+'px' ; 
			Dro.childNodes[i+1].style.height=(h+5)+'px';
		}
	}
}

function EvyAutoHeight(divid)
{
	var Dro=document.getElementById(divid);
	var h=0;
	for(i=0;i<=Dro.childNodes.length-1;i++)
	{
		h=Math.max(Dro.childNodes[i].clientHeight,h);
	}
	for(i=0;i<=Dro.childNodes.length-1;i++)
	{
		Dro.childNodes[i].style.height=(h+5)+'px' ;
	}
}

function ScrollMenu(WantTop,WantLeft)
{
	if(self.pageYOffset){
		RealLay=document.layers['float'];
		BadX = self.pageYOffset;
		BadY = self.pageXOffset;
		RealX = BadX + WantX;
		RealY = BadY + WantY;
		RealLay.moveTo(RealY, RealX);
	}else{ // Explorer 6 Strict
		var RealTop = parseInt(document.body.scrollTop);
		var TrueTop = WantTop + RealTop;
		document.getElementById('float').style.top = TrueTop;
		RealLeft = parseInt(document.body.scrollLeft);
		TrueLeft = WantLeft + RealLeft;
		document.getElementById('float').style.left = TrueLeft;
	}
}

function getPageScroll()
{
	var yScroll,xScroll;
	if (self.pageYOffset){
		yScroll = self.pageYOffset;
		xScroll = self.pageXOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
		xScroll = document.documentElement.scrollLeft;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
		xScroll = document.body.scrollLeft;
	}
		arrayPageScroll = new Array(xScroll,yScroll) 
	return arrayPageScroll;
}

function showPic(whichpic,exz,wh,he)
{
	if(document.getElementById){
		var HtmlSTr;
		if(exz=='swf'){
			if(wh==''){wh='400';}
  			if(he==''){he='300';}
			HtmlSTr = "<object data='" + whichpic.href + "' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='" + wh + "' height='" + he + "' id='VideoPlayback' type='application/x-shockwave-flash' >"
            HtmlSTr += "<param name='movie' value='" + whichpic.href + "' >"
            HtmlSTr += "</object>"
            document.getElementById('ShowDiv').innerHTML = HtmlSTr;
		}else{
			var filterstring="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)";
			var imgobj=document.getElementById('ShowDiv');
			if(imgobj.filters && window.createPopup)
			{
				imgobj.style.filter=filterstring;
				imgobj.filters[0].Apply();
			}
			//imgobj.innerHTML = "<img src='"+whichpic.href+"' alt='"+whichpic.title+"' class='centerImg' />"; 
			imgobj.innerHTML="";
			imgobj.style.background="url('" + whichpic.href + "') no-repeat center center";
			if(imgobj.filters && window.createPopup){imgobj.filters[0].Play();}
		}
		
		if(document.getElementById('sTitle'))
		{
			document.getElementById('sTitle').innerHTML=whichpic.title;
		}
		return false;
	}else{return true;}
}

function advancesorll(cl,wobj)
{
	if(document.getElementById){
	var x;
	if(wobj=='')
	{
		x=document.getElementById("sorllCell");
	}else{
		x=document.getElementById(wobj);
		x.style.height=x.clientHeight;
		x.style.width=x.clientWidth;
	}
	var i;	
	for (i=0;i <= x.childNodes.length-1 ;i++)
	{
		if(x.childNodes[i].style.display=='')
		{
			if(cl=='First'){
				if(x.childNodes[i].previousSibling)
				{
					x.childNodes[i].style.display='none';
					x.childNodes[i].previousSibling.style.display='';
					return false;
				}
			}
			if(cl=='Next'){
				if(x.childNodes[i].nextSibling)
				{
					x.childNodes[i].style.display='none';
					x.childNodes[i].nextSibling.style.display='';
					return false;
				}
			}
		}
	}
	return false;
	}else{return false;}
}