// JavaScript Document
function ImgAutoSize(d,w,h){
	var w1=d.width;
	var h1=d.height;
	if(w1==0)w1=w;
	if(h1==0)h1=h;
	if( w1/h1>w/h){
		Ratio=w/w1
		if(w1>w){
			d.width = w
			d.height = Math.round(h1 * Ratio)
		}
	}
	else{
		Ratio=h/h1
		if(h1>h){
			d.height = h
			d.width = Math.round(w1 * Ratio)
		}
	}
	var temp =eval(Math.round((h-d.height)/2)-1);
	if(temp>0)d.style.margin= temp + "px auto";
}
function AutoImg(o,w,h){
	this.o=o;
	this.w=w;
	this.h=h;
}
var ImgOdj=new Array();
var ImgOdjIndex=0;

function SetImgOdj(t,w,h){
	ImgOdj[ImgOdjIndex]=new AutoImg(t,w,h);
	ImgAutoSize(ImgOdj[ImgOdjIndex].o.width=w);
	ImgOdjIndex++;
}
function FormatImagesSize(){
	for(i=0;i<ImgOdjIndex;i++){
		ImgAutoSize(ImgOdj[i].o,ImgOdj[i].w,ImgOdj[i].h);
	}
	AutoSize();
}
function Marquee(){
	if(MarInd>=Move1Width){
		MarInd=0;
	}
	else{
		MarInd +=2;
	}
	MoveD.scrollLeft=MarInd;
}
function fAddFavorite(sTitle,sURL){ 
	if(document.all){
		window.external.AddFavorite(sURL,sTitle); 
	}
	else{
		window.sidebar.addPanel(sTitle,sURL, "");
	}
	return false;
}
function AutoSize(){
	document.getElementById("adminid").innerHTML='<a target="_blank" href="adminwy/login.asp">&nbsp;</a>';
	var AleftH=eval(document.getElementById("left").offsetHeight-document.getElementById("right").offsetHeight);
	if(AleftH>0){
		document.getElementById("RightContent").style.height=eval(document.getElementById("RightContent").offsetHeight + AleftH) + "px";
	}
}
function expand(el){
	var t=document.getElementById("LUM"+el);
	var childObj = document.getElementById("child" + el);
	if(childObj!=null){
		if (t.className == 'LUMC')
		{
			childObj.style.display = 'block';
			t.className = 'LUMO'
		}
		else
		{
			childObj.style.display = 'none';
			t.className = 'LUMC'
		}
		//AutoSize();
	}
}
