﻿
function MultiImageControll(BaseID,OnOff){
	var LeftID, RightID, CenterID;
	var LeftClass, RightClass, CenterClass;
	var ClassName;
	LeftID = BaseID + "-L";
	CenterID = BaseID + "-C";
	RightID = BaseID + "-R";
	
	SwapBGImage(LeftID,OnOff);
	SwapBGImage(CenterID,OnOff);
	SwapBGImage(RightID,OnOff);
}

function SwapBGImage(BaseID,OnOff){
	var CurImage;
	var ImgName, ImgType;
	CurImage = document.getElementById(BaseID).style.backgroundImage;
	
	ImgType = CurImage.slice((CurImage.length - 5),(CurImage.length));
	
	if(	(CurImage.slice((CurImage.length - 10),(CurImage.length - 5))) == "_Over"){
		ImgName = CurImage.slice(0,(CurImage.length - 10));
	}else{
		ImgName = CurImage.slice(0,(CurImage.length - 5));
	}
	
	CurImage = "";
	CurImage = ImgName;
	if(OnOff == 1){
		CurImage = CurImage + "_Over";
	}
	CurImage = CurImage + ImgType;
	
	document.getElementById(BaseID).style.backgroundImage = CurImage;
}

var GrowTimeout;
var ShrinkTimeout;
var ActiveLiveOptions = 0;
var WaitTime = 20;
var BLOHeightDelta = 10;
var BoxHeight = 87;

function BidLiveOptionsOBO(AID,DivName){
	
	if(ActiveLiveOptions == 0){
		ShowLiveOptions(AID,DivName);
		ActiveLiveOptions = AID;
	}else{
		if(AID == ActiveLiveOptions){
			if(document.getElementById("bloDIV-" + AID).style.display == "block"){
				clearTimeout(GrowTimeout);
				ShrinkLiveOptions(AID,DivName);
			}else{
				ShowLiveOptions(AID,DivName);
			}
		}else{
			if(document.getElementById("bloDIV-" + ActiveLiveOptions).style.display == "block"){
				clearTimeout(GrowTimeout);
				ShrinkLiveOptions(ActiveLiveOptions,DivName);
			}
			
			if(document.getElementById("bloDIV-" + AID).style.display == "block"){
				ShrinkLiveOptions(AID,DivName);
			}else{
				ShowLiveOptions(AID,DivName);
			}		
			
			ActiveLiveOptions = AID;
		}
	}		
}

function ShowLiveOptions(AID,DivName){
	var okgo = 1;

	if(okgo == 1){
		if(document.getElementById("bloDIV-" + AID).style.display == "none"){
			document.getElementById("bloDIV-" + AID).style.display = "block";
			document.getElementById("bloDIV-" + AID).style.height = "1px";
			GrowTimeout = setTimeout("GrowLiveOptions('"+AID+"')",WaitTime);
		}else{
			ShrinkTimeout = setTimeout("ShrinkLiveOptions('"+AID+"','"+DivName+"')",WaitTime);
		}
	}
}
function GrowLiveOptions(AID){
	var HTemp;
	HTemp = document.getElementById("bloDIV-" + AID).style.height;
	HTemp = HTemp.replace("px","");
	if((HTemp - 0) < (BoxHeight - 0 + 5)){//height of container	
		HTemp = HTemp - 0 + BLOHeightDelta;
		document.getElementById("bloDIV-" + AID).style.height = HTemp + "px";		
		HTemp = (0 - (BoxHeight - 0 + 1)) + (HTemp - 0)
		document.getElementById("bloB1-" + AID).style.marginTop = HTemp + "px";
		GrowTimeout = setTimeout("GrowLiveOptions('"+AID+"')",WaitTime);
	}
}
function ShrinkLiveOptions(AID,DivName){
	var HTemp;
	
	var okgo = 1;

	if(okgo == 1){	
		HTemp = document.getElementById("bloDIV-" + AID).style.height;
		HTemp = HTemp.replace("px","");
		if((HTemp - 0) > 1){
			HTemp = HTemp - BLOHeightDelta;
			document.getElementById("bloDIV-" + AID).style.height = HTemp + "px";		
			HTemp = (0 - (BoxHeight - 0 + 1)) + (HTemp - 0)
			document.getElementById("bloB1-" + AID).style.marginTop = HTemp + "px";
			ShrinkTimeout = setTimeout("ShrinkLiveOptions('"+AID+"','" + DivName + "')",WaitTime);
		}
		else{
			document.getElementById("bloDIV-" + AID).style.height = "1px";
			document.getElementById("bloDIV-" + AID).style.display = "none";
		}
	}
}


