function doPopup(theURL, theWinName, theLeft, theTop, theWidth, theHeight, theresize, thescrollbars, thestatusbar, themenu, thetools, thelocationbar, thedirs){
	// EXAMPLE doPopup('popup.asp', 'popwin', 10, 10, 500, 300, 'no', 'no', 'yes', 'no', 'no', 'no', 'no')
	// USE theLeft AND theTop = -1 FOR AUTO-CENTER

	if (theLeft == -1 && theTop == -1){
		theLeft = (screen.width - theWidth) / 2;
		theTop = (screen.height - theHeight) / 2;
	}
	var paramstr;
	paramstr = "width=" + theWidth + "px,height=" + theHeight + "px,left=" + theLeft + "px,top=" + theTop + "px,resizable=" + theresize + ",scrollbars=" + thescrollbars + ",status=" + thestatusbar + ",menubar=" + themenu + ",toolbar=" + thetools + ",location=" + thelocationbar + ",directories=" + thedirs;
	window.open(theURL, theWinName, paramstr);
}


function alertModal(theMessage,isError, wdt, hgt, pageRequested){
	var myObject = new Object();
	var lft, tp;
	lft = (screen.width - wdt) / 2;
	tp = (screen.height - hgt) / 2;
	myObject.bodys = theMessage;

	if (isError=="ERROR"){
		win = window.showModalDialog("assets/modalError.asp", myObject, "dialogWidth:" + wdt + "px; dialogHeight:"+ hgt +"px; dialogLeft:" + lft + "px; dialogTop:" + tp + "px; help:0;status:0;scroll:0;resizable:0");
	}
	else if (isError=="TERMS"){
		win = window.showModalDialog("assets/modalTerms.asp", myObject, "dialogWidth:" + wdt + "px; dialogHeight:"+ hgt +"px; dialogLeft:" + lft + "px; dialogTop:" + tp + "px; help:0; status:0 ");
	}
	else{
		win = window.showModalDialog("assets/modalInfo.asp", myObject, "dialogWidth:" + wdt + "px; dialogHeight:" + hgt + "px; dialogLeft:" + lft + "px; dialogTop:" + tp + "px; help:0; status:0 ");
	}
}

function ShowHidePanel(ThePanel){
	var Panel = document.getElementById(ThePanel);
	var PanelImg = document.getElementById(ThePanel + 'Img');
	var PanelLink = document.getElementById(ThePanel + 'Link');
	
	if (Panel){
		if (Panel.style.visibility == 'visible'){
			Panel.style.visibility = 'hidden';
			Panel.style.height = '1px';
			PanelImg.src = 'Assets/Images/ArrowDown.gif';
			PanelLink.innerText = 'more';
		}
		else{
			Panel.style.visibility = 'visible';
			Panel.style.height = 'auto';
			PanelImg.src = 'Assets/Images/ArrowUp.gif';
			PanelLink.innerText = 'less';
		}
	}
}



function ShowHidePanel2(ThePanel){
	var Panel = document.getElementById(ThePanel);
	var PanelImg = document.getElementById(ThePanel + 'Img');
	
	if (Panel){
		if (Panel.style.visibility == 'visible'){
			Panel.style.visibility = 'hidden';
			Panel.style.height = '1px';
			PanelImg.src = 'Assets/Images/ArrowDown.gif';
		}
		else{
			Panel.style.visibility = 'visible';
			Panel.style.height = 'auto';
			PanelImg.src = 'Assets/Images/ArrowUp.gif';
		}
	}
}

function ShowHideCalendarPanel(ThePanel){
	var Panel = document.getElementById("divCalendarPanel" + ThePanel);
	
	if (Panel){
		if (Panel.style.visibility == 'visible'){
			Panel.style.visibility = 'hidden';
			Panel.style.height = '1px';
		}
		else{
			Panel.style.visibility = 'visible';
			Panel.style.height = 'auto';
		}
	}
}

function SwapImage(ImageId,NewSrc){
	document.getElementById(ImageId).src = NewSrc;
}


function SwapClass(Obj,NewClass){
	Obj.className = NewClass
}

function ChangeOpacity(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
}

function getFlashMovieObject(movieName){
	if (window.document[movieName]){
		return window.document[movieName];
	}
	
	if (navigator.appName.indexOf("Microsoft Internet")==-1){
		if (document.embeds && document.embeds[movieName])
		return document.embeds[movieName]; 
	}
	else{
		return document.getElementById(movieName);
	}
}
