function resizeWindow(){
	//Netscape 6 and 7.0 have issues with the <div style="overflow: auto;"> and any dropdowns (<select>)
	//IE on Mac has issues with several toolbars on one screen
	if (!fx){
	if (!(ns6 || ns7) && !(mac && ie )) {
		if (document.getElementById && document.body.clientHeight) {
			if (document.getElementById('SideBar')){document.getElementById('SideBar').style.overflow='auto';}
			document.getElementById('MiddleContent').style.overflow='auto';
			if (self.innerHeight){windowHeight=self.innerHeight;}else{windowHeight=document.body.clientHeight;}
			if (topHeight < windowHeight) {
				windowHeight=windowHeight-topHeight;
				if (windowHeight <= 0) {
					windowHeight = 1;
				}
				if (windowHeight > -1) {
					if(document.getElementById('PageBottom')){document.getElementById('PageBottom').style.display='block';}
					if (document.getElementById('SideBar')){document.getElementById('SideBar').style.height=windowHeight;}
					document.getElementById('MainContent').style.height=windowHeight;
					document.getElementById('MiddleContent').style.height=windowHeight; 
					if (document.getElementById('divBar') && document.getElementById('divBarBot')){
						if ((windowHeight/2) > 19) {
							document.getElementById('divBar').style.height=(windowHeight/2)-21;
							document.getElementById('divBarBot').style.height=(windowHeight/2)-20;
						}
					}
				}
			}
			window.clearInterval(intTimerID);
		}
	}}
};
function closeWelcome() {
	if(document.getElementById('Welcome')){document.getElementById('Welcome').style.display='none';}
	window.clearInterval(intTimerID);
	document.getElementById('MainContent').style.display='block';
	if (document.getElementById('SideBar')){document.getElementById('SideBar').style.height='1px';}
	document.getElementById('MiddleContent').style.height='1px';
	if (document.getElementById('SideBar')){document.getElementById('SideBar').style.visibility='hidden';}
	document.getElementById('MiddleContent').style.visibility='hidden';
	intTimerID = window.setInterval('Scroll()', 1);
}
function MainScroll() {
	if (!badBrowser && win) {
		if (CookieTest()) {
			if(document.getElementById('divBarButton')){document.getElementById('divBarButton').style.display='none';}
			document.getElementById('MainContent').style.display='none';
			if(document.getElementById('PageBottom')){document.getElementById('PageBottom').style.display='none';}
			if (document.getElementById('SideBar')){document.getElementById('SideBar').style.overflow='hidden';}
			document.getElementById('MiddleContent').style.overflow='hidden';
			var conHeight=document.getElementById('MainContent').style.height;
			conHeight= conHeight.replace('px', '');
			conHeight=conHeight-0;
			if (conHeight <= 10) {
				document.getElementById('MainContent').style.height=10 + 'px';
				if (document.getElementById('Welcome')){document.getElementById('Welcome').style.display='block';}
				setTimeout('closeWelcome()', 2000);
			}
		} else {
			resizeWindow();
		}
	} else {
		resizeWindow();
	}
};
function Scroll() {
	if (document.getElementById && document.body.clientHeight) {
		windowHeight=windowHeight+20;
		if (document.getElementById('SideBar')){document.getElementById('SideBar').style.height=windowHeight;}
		document.getElementById('MiddleContent').style.height=windowHeight;
		if (document.getElementById('divBar') && document.getElementById('divBarBot')){
			if (windowHeight > 38) {
				document.getElementById('divBar').style.height=(windowHeight/2)-20;
				document.getElementById('divBarBot').style.height=(windowHeight/2)-20;
			}
		}
		if (windowHeight > 65 && windowHeight < 86) {
			if(document.getElementById('divBarButton')){document.getElementById('divBarButton').style.display='block';}
		}
		if (windowHeight>=document.body.clientHeight-topHeight) {
			if (document.getElementById('SideBar')){document.getElementById('SideBar').style.visibility='visible';}
			document.getElementById('MiddleContent').style.visibility='visible';
			document.getElementById('MiddleContent').style.overflow='auto';
			resizeWindow();
			window.clearInterval(intTimerID);
		}
	}
};
/*
function getCookieVal(offset) {
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1) endstr = document.cookie.length;
   var str = unescape (document.cookie.substring(offset, endstr));
   while(str.indexOf('+')>0){str=str.replace('+',' ')}
   return str;
}
function GetCookie (name) {
	var arg = name + "=";var alen = arg.length;var clen = document.cookie.length;var i = 0;
	while (i < clen) {
	var j = i + alen;
	if (document.cookie.substring(i, j) == arg){return getCookieVal (j);}
	i = document.cookie.indexOf(" ", i) + 1;
	if (i == 0){break;}
	}
	return null;
}	
function SetCookie (name, value) {
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) +
	((expires == null) ? "" : ("; expires=" +
	expires.toGMTString())) +
	((path == null) ? "; path='/'" : ("; path=" + path)) +
	((domain == null) ? "" : ("; domain=" + domain)) +
	((secure == true) ? "; secure" : "");
}
function CookieTest() {
	if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled){ 
		SetCookie ("c", "t", null, "/");
		var Cookies = GetCookie('cookies');
		if (Cookies == "t"){return true;}
		else{return false;}
	} else {
		return true;
	}
}*/
function gotoURL(url) { 
	if (url != "") {
		document.location = url;}
};
function DeleteCookieArr (name) {
	var tmp=GetCookieArr('iv');
	var str=(GetCookieArr('iv', name)!=null) ? GetCookieArr('iv', name) : "";
	str=name + "=" + str;
	while (tmp.indexOf(str)>(-1)){
		tmp = tmp.replace('&' + str, '');
		tmp = tmp.replace(str + '&', '');
		tmp = tmp.replace(str, '');
	}
	document.cookie = "iv=" + tmp + "; path=/";
};
function SetCookie (name, value) {
	if (name.toLowerCase() == 'lb' || name.toLowerCase() == 'tmp' || name.toLowerCase() == 'fa') {
		document.cookie = name + "=" + escape(value) + "; path=/";
	} else {
		var tmp=GetCookieEscape('iv');
		var str=(GetCookie(name)!=null) ? GetCookie(name) : "";
		str=name + "=" + escape(str);
		var rep=name + "=" + escape(value);
		if (tmp.indexOf(str)>(-1)) {
			//while (tmp.indexOf(str)>(-1)){
				tmp = tmp.replace(str, rep);
			//}
		} else {
			tmp = tmp + "&" + rep;
			tmp = tmp.replace("&&", "&");
		}
		document.cookie = "iv=" + tmp + "; path=/";
	}
};
function GetCookieEscape(name) {
	var arg = name + "=";var alen = arg.length;var clen = document.cookie.length;var i = 0;
	while (i < clen) {
	var j = i + alen;
	if (document.cookie.substring(i, j) == arg){
		var endstr = document.cookie.indexOf (";", j);
		if (endstr == -1) endstr = document.cookie.length;
		var str = document.cookie.substring(j, endstr);
		return str;	
	}
	i = document.cookie.indexOf(" ", i) + 1;
	if (i == 0){break;}
	}
	return null;
};
function getCookieValEscape(offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1) endstr = document.cookie.length;
	var str = document.cookie.substring(offset, endstr);
	return str;
};
function getValFromArray(name, string) {
	var arrVar;
	if (string) {
		var arrSplit = string.split('&');
		for (var x=0; x<arrSplit.length; x++) {
			arrVar = arrSplit[x].split('=');
			if (arrVar[0]==name) {
				return arrVar[1];
			}
		}
	}
	return null;
};
function getCookieVal(offset) {
   var argv = getCookieVal.arguments;
	var argc = getCookieVal.arguments.length;
	var argch = (argc > 1) ? argv[1] : ";";
	var endstr = (document.cookie.indexOf (argch, offset)>0) ? document.cookie.indexOf (argch, offset) : document.cookie.indexOf (";", offset);
	if (endstr == -1) endstr = document.cookie.length;
	var str = unescape (document.cookie.substring(offset, endstr));
	while(str.indexOf('+')>0){str=str.replace('+',' ')}
	return str;
};
function GetCookie (name) {
	var value = GetCookieArr('iv', name);
	if (value == null) {
		value = GetCookieEscape(name);
		if (value != null) {
			value = unescape(value);
		}
	}
	return value;
};
function GetCookieArr (name) {
	var argv = GetCookieArr.arguments;
	var argc = GetCookieArr.arguments.length;
	var argCk = (argc > 1) ? argv[1] : null;
	var arg = name + "=";var alen = arg.length;var clen = document.cookie.length;var i = 0;var value=null;
	while (i < clen) {
	var j = i + alen;
	if (document.cookie.substring(i, j) == arg){value = getCookieValEscape (j);}
	i = document.cookie.indexOf(" ", i) + 1;
	if (i == 0){break;}
	}
	if (argCk) {value = getValFromArray(argCk, value);}
	if (value != null) {
		value=unescape(value);
		while(value.indexOf('+')>0){value=value.replace('+',' ')}
	}
	return value;
};
function CookieTest() {
	if (typeof navigator.cookieEnabled=="undefined"){ 
		SetCookie ("c", "t", null, "/");
		var Cookies = GetCookie('cookies');
		if (Cookies == "t"){return true;}
		else{return false;}
	} else {
		return true;
	}
};
function setupFavArtist(){
	if (!badBrowser) {
		var strfavartist = GetCookie('fa');
		if (strfavartist) {
			while (strfavartist.indexOf("+") >= 0) {
				strfavartist = strfavartist.replace("+", " ");
			}
		}
		if (!strfavartist){strfavartist='<font class="smallFont">Currently the favorite artist box is empty</font>';}
		else {
			arrList = strfavartist.split('**');
			strfavartist='<table width=120 border=0>';
			for (var x=0; x < (arrList.length -1); x++) {
				var arrArtist = arrList[x].split(':');
				var fullStr = arrList[x];
				var artist = arrArtist[1];
				var id = arrArtist[2]
				strfavartist = strfavartist + "<tr><td><a href='#' onClick=\"addFavArtist('";
				strfavartist = strfavartist + fullStr;
				strfavartist = strfavartist + "');\"><img alt='Remove " + artist + " from your Favorite Artist Box' border=0 heigh=8 width=8 src='/images/close.gif'></a>";
				strfavartist = strfavartist + "&nbsp;|&nbsp;</td><td>";
				if (arrArtist[0] == 'stock') {
					strfavartist = strfavartist + "<a title='View Stock Listing' href='/scripts/ivstock/search.asp?terms=artist:" + escape(artistSearch(artist)) + "'><font color='#990000' class='smallFont'>";
				} else if (arrArtist[0] == 'folio') {
					strfavartist = strfavartist + "<a title='View Folio Listing' href='/scripts/ivfolio/artist.asp?id=" + id + "'><font color='#000080' class='smallFont'>";
				}
				strfavartist = strfavartist + "" + artist + "</font></a></td><td align='right'></td></tr>";
			}
			strfavartist = strfavartist + "</table>";
		}
		if (document.getElementById('FavArtist')){
			if (!badBrowser){document.getElementById('FavArtist').innerHTML=strfavartist;}
		}
	}
};
function addFavArtist(artist){
	artist=artist.replace("'", "`");  // fix apostrophe
	var strfavartist = GetCookie('fa');
	if (!strfavartist){strfavartist="";}
	var tmp = strfavartist.replace("'", "");
	var tmpartist = artist.replace("'", "");
	if (tmp.indexOf(tmpartist) > -1) {
		var confirm = addFavArtist.arguments[1];
		if (confirm == true || confirm == null) {
			var ans=window.confirm('Are you sure you want to remove this artist from your Favorite Artists box?');
			if (ans==true) {strfavartist=strfavartist.replace(artist + "**", "");}
		} else {
			strfavartist=strfavartist.replace(artist + "**", "");
		}
	} else
		strfavartist = artist + "**" + strfavartist;
	SetCookie('fa', strfavartist, null, '/');
	gotoURL('/scripts/user/saveCookies.asp');
	if (!badBrowser){setupFavArtist();}else{gotoURL(sURL);}
};
function artistSearch(artist){
	artist = artist.toLowerCase();
	artist = artist.replace(", cmi", "");
	artist = artist.replace(", ms", "");
	artist = artist.replace(", fami", "");
	artist = artist.replace(", inc.", "");
	artist = artist.replace(", llc", "");
	artist = artist.replace("cmi", "");
	artist = artist.replace("ms", "");
	artist = artist.replace("fami", "");
	artist = artist.replace("inc.", "");
	artist = artist.replace("llc", "");
	return artist;
};
function addLoadEvent(func) {
	if (!badBrowser) {
		var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = func;
		} else {
			window.onload = function() {
			oldonload();
			func();}
		}
	}
};
function addResizeEvent(func) {
	if (!badBrowser) {
		var oldonload = window.onresize;
		if (typeof window.onresize != 'function') {
			window.onresize = func;
		} else {
			window.onresize = function() {
			oldonload();
			func();}
		}
	}
};
function setupLightBox() {
	if (!badBrowser) {
		if(document.getElementById('LightBox')){document.getElementById('LightBox').style.overflow='auto';}
		var strlightbox = GetCookie('lb')
		var strlbname = GetCookie('lbN');
		var strlbsaved = GetCookie('lbS');
		var count=0;
		if (strlbsaved == 'false') {
			strlbsaved = '<' + 'a href="javascript:saveLightBox();">*<' + '/a>';
		} else {
			strlbsaved = '';
		}
		if (!strlightbox || strlightbox=="<empty>")
			strlightbox='<font class="smallFont">Currently the lightbox is empty<' +'/font>';
		else {
			//Replace the + with spaces in the names of the lightboxes
			if (strlbname) {
				while (strlbname.indexOf("+") >= 0) {
					strlbname = strlbname.replace("+", " ");
				}
			}
			//if (strlightbox.indexOf(",")) {
				arrList = strlightbox.split(',');
				strlightbox='<table width="100" border="0">';
				if (strlbname != '' && strlbname != null) {
					strlightbox=strlightbox + '<tr><td colspan="3" style="border-bottom: 1px solid #000000;"><font class="normalFont"><b>Project:</b>&nbsp;' + strlbname + strlbsaved + '</font></td></tr>';
				}
				addLightBoxCheckBox('all', false);
				for (var x=0; x < (arrList.length -1); x++) {
					strlightbox = strlightbox + "<tr><td nowrap><a href='#' onClick=addLightBox('" + arrList[x] + "');><img alt='Remove image from LightBox' border=0 heigh=8 width=8 src='/images/close.gif'></a>&nbsp;|&nbsp;</td><td nowrap><a href='/scripts/ivstock/pic.asp?id=" + arrList[x] + "' onMouseOver=scrollLightBox('" + arrList[x] + "'); onMouseOut='closePreview()'><font color='#000000' class='smallFont'>" + arrList[x] + "</font></a></td><td align='right'></td></tr>";
					addLightBoxCheckBox(arrList[x], true);
				}
				strlightbox = strlightbox + "</table>";}
			//}
			if(document.getElementById('LightBox')){
				document.getElementById('LightBox').style.background='';
				document.getElementById('LightBox').innerHTML=strlightbox;
			}
	}
};
function loadLightBox(strlightbox, strlbname, strlbsaved) {
	SetCookie('lb', strlightbox, null, '/');
	SetCookie('lbN', strlbname, null, '/');
	SetCookie('lbS', strlbsaved, null, '/');
	setupLightBox();
};
//Setup the LightBox Loading interface
function setupLightBoxLoad() {
	if (!badBrowser) {
		var strlightbox;
		var count=0;
		if(document.getElementById('LightBox')){document.getElementById('LightBox').style.overflow='auto';}
		while(!strlightbox) {
			strlightbox = GetCookie('tmp');
			count++;
			if (count > 1000) {
				strlightbox="<error>";
			}
		}
		//expire the tmp cookie
		//SetCookie('tmp', '');
		document.cookie="tmp=; path=/;";
		if (!strlightbox || strlightbox == '<empty>')
			strlightbox='<font class="smallFont">Currently you don\'t have any saved lightboxes.</font><input type="button" value="cancel" onclick="setupLightBox();">';
		else if (strlightbox == '<error>') {
			strlightbox='<font class="smallFont">Error loading lightboxes.</font><input type="button" value="Reload Lightbox" onclick="setupLightBox();">';
		} else {
			arrList = strlightbox.split(',');
			strlightbox='<input type="button" value="cancel" onclick="setupLightBox();" style="font-size: 10px;"><table width="110" border="0" cellpadding="3" cellspacing="0">';
			for (var x=0; x < (arrList.length -1); x++) {
				arrProject = arrList[x].split('::');
				project = arrProject[0]
				while (project.indexOf("+") >= 0) {
					project = project.replace("+", "&nbsp;");
				}
				strlightbox = strlightbox + "<tr><td width=\"90%\" valign='middle'><a href='#' onclick='openLBName(\"" + arrProject[0] + "\");'><font color='#000000' class='smallFont'>" + project + "</font></a></td></tr>";
			}
			strlightbox = strlightbox + "</table>";
		}
		if(document.getElementById('LightBox')){
			document.getElementById('LightBox').style.background='';
			document.getElementById('LightBox').innerHTML=strlightbox;
		}
	}
};
// Add/Remove an image in the lightbox
function addLightBox(image) {
	var blconfirm=addLightBox.arguments[1];
	var bldelete=addLightBox.arguments[2];
	var strlightbox=GetCookie('lb');
	if (!strlightbox)
		strlightbox="";
	if (strlightbox.indexOf(image)>-1){
		if (blconfirm == true || blconfirm == null){
			if (window.confirm('Are you sure you want to remove image #' + image + ' from the lightbox?')==true){
				if (bldelete==true || blconfirm==null) {
					strlightbox=strlightbox.replace(image + ",", "");
					addLightBoxCheckBox(image, false);
				}
			}else{
				addLightBoxCheckBox(image, true);}
		}else{
			if (bldelete==true || blconfirm==null) {
				strlightbox=strlightbox.replace(image + ",", "");
				addLightBoxCheckBox(image, false);
			}
		}
	}else{
		strlightbox = image + "," + strlightbox;
		addLightBoxCheckBox(image, true);
	}
	SetCookie('lbS', 'false', null, '/');
	SetCookie('lb', strlightbox, null, '/');
	if (!badBrowser) 
	{
		setupLightBox();
	} else 
	{
		gotoURL(window.location);
	}
};
function addLightBoxCheckBox(image, add) {
	if (document.Search) {
		if (image != 'all') {
			with (document.Search) {
				for (var i=0; i < elements.length; i++) {
					if (elements[i].type == 'checkbox' && elements[i].value == image)
							elements[i].checked = add;
				}
			}
		} else {
			with (document.Search) {
				for (var i=0; i < elements.length; i++)
					{if (elements[i].type == 'checkbox')
						elements[i].checked = add;}
			} // End With
		} // End If
	}
};
function deleteLightBox() {
	var ans;
	var blconfirm=deleteLightBox.arguments[0];
	if (blconfirm == null || blconfirm == true) {
		ans=window.confirm('Are you sure you delete your lightbox?');
	} else {
		ans=true;
	}
	if (ans==true) {
		SetCookie('lb', '', null, '/');
		addLightBoxCheckBox('all', false);
		SetCookie('lbN', '', null, '/');
		SetCookie('lbS', 'true', null, '/');
		setupLightBox();
	}
};
function closeLightBox() {
	var strLB = GetCookie('lbS');
	if (strLB == null || strLB == '' || strLB == 'false') {
		var ans=window.confirm('Are you sure you want to close your lightbox without saving?');
		if (ans==true) {
			deleteLightBox(false);
		}
	} else {	
		deleteLightBox(false);
	}
};
function saveLightBox() {
	if (!badBrowser) {
		if(document.getElementById('LightBox')){document.getElementById('LightBox').innerHTML='Saving...';}
		var LBName = GetCookie('lbN');
		var ID = GetCookie('ID');
		if (ID==null || ID=='') {
			//Login prompt
			if(document.getElementById('LightBox')){document.getElementById('LightBox').innerHTML='Please Login.';}
			loginDrop();
			setTimeout(setupLightBox, 2000);
		} else if (LBName==null || LBName=='') {
			//Save Prompt
			//if (!mac) {
				if(document.getElementById('LightBox')){
					document.getElementById('LightBox').innerHTML='<' + 'form name="saveLightBox" ><' + 'font class="smallFont">To save the light box, input a name and then click Save<' + '/font><' + 'input type="textbox" name="LBName" id="LBName" size="15"><' + 'input type="submit" value="Save" onclick="saveCookie();return false" style="font-size: 10px;"><' + 'input type="button" value="Cancel" onclick="setupLightBox();" style="font-size: 10px;"><' + '/form>';
				}
			//} else {
			//	document.getElementById('LightBox').innerHTML='<' + 'form name="saveLightBox" method="get" action="/scripts/user/savecookies.asp"><' + 'font class="smallFont">To save the light box, input a name and then click Save<' + '/font><' + 'input type="textbox" name="LBName" size="15"><' + 'input type="submit" value="Save" style="font-size: 10px;"><' + 'input type="button" value="Cancel" onclick="setupLightBox();" style="font-size: 10px;"><' + '/form>';
			//}
			if(document.getElementById('LightBox')){
				document.getElementById('LightBox').style.overflow='hidden';
			}
		} else {
			//Save the LightBox
			SetCookie('lbS', 'true', null, '/');
			gotoURL('/scripts/user/saveCookies.asp');
			setTimeout(setupLightBox, 2000);
		}
	} else 
	{
		gotoURL('/scripts/user/savelightbox.asp');
	}
};
function saveasLightBox() {
	if (!badBrowser) {
		if(document.getElementById('LightBox')){
			document.getElementById('LightBox').innerHTML='Saving...';
		}
		var LBName = GetCookie('lbN');
		var ID = GetCookie('ID');
		if (ID==null || ID=='') {
			//Login prompt
			if(document.getElementById('LightBox')){
				document.getElementById('LightBox').innerHTML='Please Login.';
			}
			loginDrop();
			setTimeout(setupLightBox, 2000);
		} else { //if (LBName==null || LBName=='') 
			//Save Prompt
			if (!mac) {
				if(document.getElementById('LightBox')){document.getElementById('LightBox').innerHTML='<' + 'form name="saveLightBox" ><' + 'font class="smallFont">To save the light box, input a name and then click Save<' + '/font><' + 'input type="textbox" name="LBName" id="LBName" size="15"><' + 'input type="submit" value="Save" onclick="saveCookie(); return false" style="font-size: 10px;"><' + 'input type="button" value="Cancel" onclick="setupLightBox();" style="font-size: 10px;"><' + '/form>';}
			} else {
				if(document.getElementById('LightBox')){document.getElementById('LightBox').innerHTML='<' + 'form name="saveLightBox" method="get" action="/scripts/user/savecookies.asp"><' + 'font class="smallFont">To save the light box, input a name and then click Save<' + '/font><' + 'input type="textbox" name="LBName" size="15"><' + 'input type="submit" value="Save" style="font-size: 10px;"><' + 'input type="button" value="Cancel" onclick="setupLightBox();" style="font-size: 10px;"><' + '/form>';}
			}
			if(document.getElementById('LightBox')){document.getElementById('LightBox').style.overflow='hidden';}
		//} else {
			//Save the LightBox
			//SetCookie('lbS', 'true', null, '/');
			//gotoURL('/scripts/user/saveCookies.asp');
			//setTimeout(setupLightBox, 2000);
		}
	} else {
		gotoURL('/scripts/user/savelightbox.asp');
	}
};
function saveCookie() 
{
	SetCookie('lbN', document.getElementById("LBName").value, null, '/');
	document.getElementById('LightBox').innerHTML='Saving...';
	SetCookie('lbS', 'true', null, '/');
	setTimeout(setupLightBox, 2000);
	gotoURL('/scripts/user/saveCookies.asp');
};
function openLightBox() {
	var ID = GetCookie('ID');
	if (ID==null || ID=='') {
		//Login prompt
		if(document.getElementById('LightBox')){document.getElementById('LightBox').innerHTML='Please Login.';}
		loginDrop();
		setTimeout(setupLightBox, 2000);
	} else {
		if(document.getElementById('LightBox')){document.getElementById('LightBox').innerHTML='Loading...';}
		gotoURL('/scripts/user/openCookies.asp');
		setupLightBoxLoad();
	}
};
function deleteLBName(project) {
	var ID = GetCookie('ID');
	var LBName = GetCookie('lbN');
	if (ID==null || ID=='') {
		//Login prompt
		document.getElementById('LightBox').innerHTML='Please Login.';
		loginDrop();
		setTimeout(setupLightBox, 2000);
	} else {
		var ans=window.confirm('Are you sure you delete this lightbox?');
		if (ans==true) {
			if(document.getElementById('LightBox')){document.getElementById('LightBox').innerHTML='Deleting ' + project + '...';}
			document.getElementById('row' + project).style.display='none';
			gotoURL('/scripts/user/deletelbname.asp?Project=' + project);
			if (project == LBName) {
				SetCookie('lb', '', null, '/');
				SetCookie('lbN', '', null, '/');
				SetCookie('lbS', 'True', null, '/');
			}
			setTimeout(setupLightBox, 2000);
		}
	}
};
function openLBName(project) {
	var ID = GetCookie('ID');
	if (ID==null || ID=='') {
		//Login prompt
		if(document.getElementById('LightBox')){document.getElementById('LightBox').innerHTML='Please Login.';}
		loginDrop();
		setTimeout(setupLightBox, 2000);
	} else {
		closeLightBox();
		if(document.getElementById('LightBox')){document.getElementById('LightBox').innerHTML='Loading ' + project + '...';}
		setTimeout(setupLightBox, 2000);
		gotoURL('/scripts/user/openlbname.asp?Project=' + project);
	}
};
function scrollLightBox(image) {
	if (!badBrowser) {
		var strlightbox
		strlightbox = '<a href="/scripts/ivstock/pic.asp?id=' + image + '">';
		strlightbox = strlightbox + '<img alt="View Image #' + image + '" border=0 height=65 valign=top src=/scripts/ivstock/image.aspx?w=65&amp;h=65&amp;img=' + image.substring(0, 4).replace('-','') + '/' + image + '.jpg><' + '/a>';
		with (document.getElementById('previewLightBox')) {
			style.top=topHeight-37;
			var winWidth = (document.body.clientWidth / 2);
			winWidth = winWidth - 247;
			style.width='5px';
			style.height='69px';
			style.left=winWidth + 'px';
			innerHTML = strlightbox;
			style.display='block';
		}
		intTimerID = window.setInterval('scrollLBPreview()', 1);
	}
};
function scrollLBPreview() {
	if (!badBrowser) {
		with (document.getElementById('previewLightBox')) {
			var conWidth = style.width.replace('px', '')-0;
			if (conWidth < 70){style.width = (conWidth + 5) + 'px';} 
			else {window.clearInterval(intTimerID);}
		}
	}
};
function closePreview() 
{
if (!badBrowser)
	if (document.getElementById('previewLightBox')){document.getElementById('previewLightBox').style.display='none';}
}
function logout() {
	if (GetCookie("ID")) {
		SetCookie('UserName', '');
		SetCookie('Name', '');
		SetCookie('lbN', '');
		SetCookie('lbS', '');
		document.cookie="ID=; expires=Thu, 01-Jan-70 00:00:01 GMT";
		document.cookie="UserName=; expires=Thu, 01-Jan-70 00:00:01 GMT";
		document.cookie="Name=; expires=Thu, 01-Jan-70 00:00:01 GMT";
		document.cookie="Artist=; expires=Thu, 01-Jan-70 00:00:01 GMT";
		document.cookie="lbN=; expires=Thu, 01-Jan-70 00:00:01 GMT";
		document.cookie="lbS=; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
	window.location.reload();
};
function loginDrop() {
	if (!badBrowser) {
		windowHeight=1;
		with (document.getElementById('loginDrop').style) {
			height='1';
			left=(document.body.clientWidth / 2) + 213;
			top=topHeight-47;
			drop = (display == 'none') ? 'block' : 'none';
			display=drop;
		}
		if (drop=='block')
			setTimeout('resizeDrop()', 1);
	}else{
		gotoURL('/scripts/logon/logon.asp');
	}
};
function loginDropIVWeb() {
	if (!badBrowser) {
		windowHeight=1;
		with (document.getElementById('loginDrop').style) {
			height='1';
			left=(document.body.clientWidth / 2) + 213;
			top=topHeight-47;
			drop = (display == 'none') ? 'block' : 'none';
			display=drop;
		}
		if (drop=='block')
			setTimeout('resizeDrop()', 1);
	}else{
		gotoURL('logon.asp');
	}
};
//	Scroll the login box
function resizeDrop() {
	if (!badBrowser) {
		windowHeight=windowHeight+6;
		document.getElementById('loginDrop').style.height=windowHeight;
		if (windowHeight<=150)
			setTimeout('resizeDrop()', 1);
		else
			document.frmLogin.username.focus();
	}
};
function divShrinkGrow() {
	if (!badBrowser) {
		var open=divShrinkGrow.arguments[1];
		if (!open){open = null;}
		var writeCookie = divShrinkGrow.arguments[0];
		if (document.getElementById('SideBar')){var current = document.getElementById('SideBar').style.display;}
		if (open != '' && open != null)
			if (open==true){current='block';}else{current='none';}
		else
			if (current=='none'){current='block';}else{current='none';}
		if (writeCookie == null || writeCookie == true){SetCookie('sideBar', current, null, '/');}
		if (document.getElementById('SideBar')){document.getElementById('SideBar').style.display = current;}
	}
};
function changeImage() {
	if (!badBrowser) {
		if (document.images && (preloadFlag == true)) {
			for (var i=0; i<changeImage.arguments.length; i+=2) {
				document.getElementById(changeImage.arguments[i]).style.backgroundImage = changeImage.arguments[i+1];
			}
		}
	}
};
function changeImages(element, newImage) {
	if (!badBrowser) {
		document.getElementById[element].style.backgroundImage = newImage;
	}
};
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
};
var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		bluebar = newImage("/images/bluebar.gif");
		redbar = newImage("/images/redbar.gif");
		orangebar = newImage("/images/orangebar.gif");
		yellowbar = newImage("/images/yellowbar.gif");
		greenbar = newImage("/images/greenbar.gif");
		preloadFlag = true;
	}
};