/*---------------------------------------------------------------------------------------------------------------------
Copyright (C) 2002 Multimedia Solutions Corporation.
All rights reserved.

Description:	CELGENE GENERAL FUNCTIONS
				Juan F. Sarria
Date:			06/10/2002
Modified:		09/12/2002
----------------------------------------------------------------------------------------------------------------------*/

function swapimg(img,swp) {

	 document.images[img].src = rolls[swp].src;            
}

function swapimgBack(img,swp) {

	 document.images[img].src = ups[swp]; 
        
}

function moveFooter() {
	var iBottom = 0;
	
	if (document.all) {
		if (parseInt(document.body.scrollHeight) > parseInt(document.body.clientHeight)) {
			iBottom = parseInt(document.body.scrollHeight);
		}	
		else iBottom = parseInt(document.body.clientHeight);
		document.all["lyfooter"].style.pixelTop = iBottom - parseInt(document.all["lyfooter"].style.height);
		document.all["lyfooter"].style.visibility = "visible";
	}
	else if (document.layers)	{
		if (document.height > self.innerHeight) {
			iBottom = document.height;
		}	
		else iBottom = self.innerHeight;				
		document.layers["lyfooter"].top = parseInt(iBottom - document.layers["lyfooter"].document.height);
		document.layers["lyfooter"].visibility = "visible";				
	}
	else if (document.getElementById) { //NS6
		if (document.height > self.innerHeight) {
			iBottom = document.height;
		}	
		else iBottom = self.innerHeight;					
		document.getElementById("lyfooter").style.top = (parseInt(iBottom - parseInt(document.getElementById("lyfooter").style.height))) + "px";		
		document.getElementById("lyfooter").style.visibility = "visible";		
		
	}
	
}

function Search(S) {
	if ((S.value.length == 0) || (S.value.toUpperCase() == "SEARCH")) {
		S.value = "";
		S.focus();
	}	
	location.href = "Search.aspx?Keyword=" + S.value + "&"
}

function OpenWin(file,w,h) {
	var win1;
	if(win1 == null) win1 = open(file,"Download","status=yes,scrollbars=1,location=0,menubar=0,resizable=1,toolbar=0,width="+w+",height="+h);
	win1.focus();
}


function OpenDownload(FileName) {
	OpenWin(FileName,450,300);
}

function GetFileName(URL) {
		// Get file name with out the path and the extention
		RetVal = URL;
		rExp = /\\/gi;
		RetVal = RetVal.replace(rExp, "/");
		Path = RetVal.split("/");
		Last = Path.length;
		RetVal = Path[Last-1];
		
		// Just the name without the extension
		Path = RetVal.split(".");
		RetVal = Path[0];

		return RetVal;
}

