

function DeleteFolder() {
	if (window.confirm('Are you sure you want to delete this item and all items filed under it?\n\nThis deletion cannot be undone.')) {
		document.deletefolderform.action = "../edit/folder_delete.asp"
		document.deletefolderform.method = "get"
		document.deletefolderform.submit()
	}
}

function ShowLibrary(DropDown) {
	var lDropDownValue = DropDown.options(DropDown.selectedIndex).value
	if(lDropDownValue > 0) {
		var strLibURL = "../edit/folder_files.asp?FolderID=" + lDropDownValue
		var wnl;
		wnl = window.open(strLibURL,'Library','scrollbars=1,height=500,width=400,resizable=1,status=0');
		wnl.focus();
		DropDown.selectedIndex = 0
	}
}

function downloadPopUp(FolderID, FolderName)
{
	var x=new Date()
	var msTimeStamp=Date.UTC(x.getFullYear(),x.getDate(),x.getMonth(),x.getHours(),x.getMinutes(),x.getSeconds(),x.getMilliseconds())
	OpenWindow('../edit/update.asp?UTC='+msTimeStamp+'&downloadid=-1&FolderID=' + FolderID + '&FolderName=' + escape(FolderName),'Downloads',600,400,0,1,1)
}

var statusWindow;
		
function OpenStatusWindow() {
	
	HideNavFlash();

	statusWindow = window.open('http://www.gpchicago.com/users/pleasewait.asp','statusWindow', 'titlebar=no,menubar=no,width=200,height=200,resizable=no,scrollbars=no');
	window.status = 'Submitting....'
}
function HideNavFlash()
{
	var elFlash = document.getElementById("flash");
	if(elFlash != null)
	{
		elFlash.style.visibility = "hidden";
	}

}

bIsIE=false;
var bLoad = false;	

// RunSafe function.  All errors sent to black hole.
function rs(code) {
	try {
		eval(code);
	}
	catch(oops)
	{
		
	}
}

function ReadySearch(searchField)
{
	if(searchField.value == 'search')
	{
	searchField.value = '';
	}
}

function XBrowserAddHandler(target,eventName,handlerName) { 
	try
	{
	if ( target.addEventListener ) 
	{
		target.addEventListener(eventName, eval(handlerName + "()"), false);
	} 
	else if ( target.attachEvent ) 
	{
		target.attachEvent("on" + eventName, eval(handlerName + "()"));
	} 
	else 
	{ 
		var originalHandler = target["on" + eventName]; 
		if ( originalHandler ) 
		{ 
			target["on" + eventName] = function(e){originalHandler(e);target[handlerName](e);}; 
		} 
		else
		{ 
			target["on" + eventName] = target[handlerName]; 
		}
	} 
  } 
  catch(darn)
  {
  
  }
}



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){ document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function OpenWindow(URLStr, winName, width, height, menubar, scrollbars, resizable) { 
	//newWin = window.open(URLStr, winName, 'toolbar=no,location=no,directories=no,status=no,menubar='+menubar+',scrollbars='+scrollbars+',resizable='+resizable+',copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
	newWin = window.open(URLStr, winName, 'toolbar=no,location=no,directories=no,status=no,menubar='+menubar+',scrollbars='+scrollbars+',resizable='+resizable+',copyhistory=yes,width='+width+',height='+height+',left=100, top=200,screenX=100,screenY=200');
	newWin.focus();
}

function goto_URL(object) {
    window.location.href = object.options[object.selectedIndex].value;
}

function checkSearchValue() {
	if (document.QuickSearchForm.keyword.value.length<1) {
		document.QuickSearchForm.keyword.value='Search'
	}
}

function OpenWindowOld(URL, Height, Width) {
	var wn;
	wn = window.open(URL,'BrandServerWindow','scrollbars=1,height=' + Height  + ',width=' + Width + ',resizable=1,status=0');
	wn.focus();
}

function togglethis(obj) {
	
	if (document.getElementById(obj).style.display == "none") {
		document.getElementById(obj).style.display = "block";
	} else {
		document.getElementById(obj).style.display = "none"
	}
}






MM_preloadImages('')



function InsertSampleMovie(myMovie)
{
document.write('<object classid="clsid: 02BF25D5..." ...>\n');
document.write('<param name="src" value=myMovie />\n');
document.write('</object>\n');
}


function calctime()
{
if(typeof(currenttime) == "undefined")
	return;
currenttime.setTime(currenttime.getTime() + 1000);

//define array with month names
var monthname=new Array("january","february","march","april","may","june","july","august", "september","october","november","december");

var days = currenttime.getDate();
var months = currenttime.getMonth();
var years =  String(currenttime.getYear());
var ns = (navigator.appName.indexOf("Netscape") != -1);

var hours = currenttime.getHours();
var minutes = currenttime.getMinutes();
var seconds = currenttime.getSeconds();
var timesuffix = "am";
if (hours > 11)
{
timesuffix = "pm";
hours = hours - 12;
}
if (hours == 0)
{
hours = 12;
}
if (hours < 10)
{
hours = "0" + hours;
}
if (minutes < 10)
{
minutes = "0" + minutes;
}
if (seconds < 10)
{
seconds = "0" + seconds;
}
//extract the month name from the array
months = monthname[months];
if (ns) {
years = years.substr(1,2)
} else {
years = years.substr(2,2)
}
var clocklocation = document.getElementById('timer');
if(null != clocklocation)
{
	clocklocation.innerHTML = days+"  "+months+"  "+years+" &nbsp; &nbsp; "+ hours + ":" + minutes + ":" + seconds + " " + timesuffix;
}
setTimeout("calctime()", 1000);
}


/*
Floating Menu script-  Roy Whittle (http://www.javascript-fx.com/)
Script featured on/available at http://www.dynamicdrive.com/
This notice must stay intact for use
*/


//Enter "frombottom" or "fromtop"
var verticalpos="frombottom"

function JSFX_FloatTopDiv()
{
	var startX = 0,
	startY = 25;
	var ns = (navigator.appName.indexOf("Netscape") != -1);

	var d = document;
	function ml(id)
	{
	
		var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
		if(d.layers)el.style=el;
		el.sP=function(x,y){this.style.left=x;this.style.top=y;};
		el.x = startX;
		if (verticalpos=="fromtop")
		el.y = startY;
		else{
		el.y = ns ? pageYOffset + innerHeight -6: document.body.scrollTop + document.body.clientHeight;
		el.y -= startY;
		}
		return el;
	}
	window.stayTopLeft=function()
	{
				
		if (verticalpos=="fromtop"){
		var pY = ns ? pageYOffset : document.body.scrollTop;
		ftlObj.y += (pY + startY - ftlObj.y)/3;
		}
		else{
		var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
		if(ns)
		{
			if(window.scrollMaxX != 0)
			{
				// there is a horizontal scrollbar. Need to move the footer up the width of the scrollbar
				// unless we are in safari, then we cannot.
				if(navigator.userAgent.indexOf('Safari') == -1)
				{
					pY -= 19;
				}
			}
			
			
		}
		ftlObj.y += (pY - startY - ftlObj.y)/1;
		}
		ftlObj.sP(ftlObj.x, ftlObj.y);
		setTimeout("stayTopLeft()", 1);
	}
	ftlObj = ml("divStayTopLeft");
	stayTopLeft();
}
