// *********
// DHTML FUNCTIONS
// *********
var s = 0;
var lastMouseOnTick = 0;
var isNav = navigator.appName == "Netscape";
function init(){initMenus();updateSlideshowImage();}
function updateSlideshowImage(){};
function initMenus() {menuLoop();}
function getLayer(aLayerName){if (isNav){return document[aLayerName];}else{return document.all ? document.all[aLayerName] : null;}}
function setLayerVisible(aLayer,vis){if(aLayer){if(vis){if(isNav){aLayer.visibility="show";}else{aLayer.style.visibility="visible";}}else{if(isNav){aLayer.visibility="hide";}else{aLayer.style.visibility="hidden";}}}}
function showMenu(pre){hideMenus();setLayerVisible(getLayer(pre), 1);d = new Date();lastMouseOnTick = d.valueOf();}
function hideMenus(){for(i in menus){setLayerVisible( getLayer(menus[i]) , 0);}return false;}
function pingMenu(){d = new Date();lastMouseOnTick = d.valueOf();s = 1;return false;}
function leaveMenu(){s=0;return false;}
function menuLoop(){d = new Date();currentTick = d.valueOf();if( (currentTick - lastMouseOnTick) > hideAfter ){if(s!=1) hideMenus();}setTimeout('menuLoop();', refreshInterval);}

function jClipToIdeaFile(ideaFileId,oid,clipTitle,lnk){
	url="/ideafile/view.cfm?action=addClip&ifid=" + ideaFileId + "&clipOid=" + oid + "&clipTitle=" + clipTitle + "&clipLink=" + lnk;
	options="width=650,height=400,toolbar=no,menubar=no,scrollbars=yes,status=yes,resizable=yes";
	var ideaWindow  = window.open(url,'ideaWindow',options);
	ideaWindow.focus();
}

function jOpenIdeaFile(ideaFileId){
	url="/ideafile/view.cfm?ifid=" + ideaFileId;
	options="width=650,height=400,toolbar=no,menubar=no,scrollbars=yes,status=yes,resizable=yes";
	var ideaWindow  = window.open(url,'ideaWindow',options);
	ideaWindow.focus();
}

function openLocator(){
	window.open('http://www.marvinlocator.com','MarvinLocator','width=768,height=435,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
}

function showObjectInPop(oid,method){
	window.open('/viewObjectInPop.cfm?oid=' + oid + "&method=" + method,'ObjectPop','width=630,height=400,scrollbars=yes,resizable=yes');
}

function openMovie(url){
	window.open(url,'MarvinMovie','width=497,height=375,status=yes,menubar=no,scrollbars=no,resizable=no');
}

function openDesignBasics(){
	window.open('http://marvin.spectra.martinwilliams.com/3rdParty/TMP_designBasics.cfm','MarvinDesignBasics','width=775,height=435,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
}

function openJobInformation(url) {
	options="width=586,height=429,toolbar=no,menubar=no,scrollbars=yes,status=yes,resizable=yes";
	var jobWindow = window.open(url,'jobwindow',options);
	jobWindow.focus();
}

function planOfTheMonth(url) {
	options="width=590,height=495,toolbar=no,menubar=no,scrollbars=yes,status=yes,resizable=yes";
	var jobWindow = window.open(url,'planOfTheMonth',options);
	jobWindow.focus();
}

function openIdeaFile(oid) {
	jClipToIdeaFile('default',oid,'Clipping',"");
	//url="/ideafile/AddToIdea.cfm?oid=" + oid;
	//options="width=650,height=400,toolbar=no,menubar=no,scrollbars=yes,status=yes,resizable=yes";
	//var ideaWindow  = window.open(url,'ideaWindow',options);
	//ideaWindow.focus();
}

function viewIdeaFile() {
	jOpenIdeaFile('default');
	//url="/ideafile/viewIdeaFile.cfm";
	//options="width=650,height=400,toolbar=no,menubar=no,scrollbars=yes,status=yes,resizable=yes";
	//var ideaWindow  = window.open(url,'ideaWindow',options);
	//ideaWindow.focus();
}

function popupButton(key,folder,txtA,txtB){
	this.normal=new Image(); this.normal.src = "/media/images/nav/subNavPopups/" + folder + "/" + key + ".gif";
	this.on = new Image(); this.on.src = "/media/images/nav/subNavPopups/" + folder + "/" + key + "On.gif";
	this.icon = new Image(); this.icon.src = "/media/images/nav/subNavPopups/" + folder + "/" + key + "Pic.jpg";
	this.text = "<b>" + txtA + "</b><BR>" + txtB;
	this.url = "link.";
}

function headerBottomButton(key){
	this.down=new Image(); this.down.src = "/media/images/nav/headerBottomButton/" + key + "/imgDown.gif";
	this.on = new Image(); this.on.src = "/media/images/nav/headerBottomButton/" + key + "/imgOn.gif";
	this.up = new Image(); this.up.src = "/media/images/nav/headerBottomButton/" + key + "/imgUp.gif";
	this.url = "link.";
}

function headerSubNavButton(key,popupId){
	this.normal = new Image(); this.normal.src = "/media/images/nav/headerSubNav/" + key + "/img.gif";
	this.on = new Image(); this.on.src = "/media/images/nav/headerSubNav/" + key + "/imgOn.gif";
	this.url = "link.";
	this.popupId = popupId;
}

function headerTopButton(key){
	this.down=new Image(); this.down.src = "/media/images/nav/headerTopNav/" + key + "On.gif";
	this.on = new Image(); this.on.src = "/media/images/nav/headerTopNav/" + key + "On.gif";
	this.up = new Image(); this.up.src = "/media/images/nav/headerTopNav/" + key + ".gif";
	this.url = "link.";
}

function normalRollover(offImage,onImage){
	this.off =new Image(); this.off.src = offImage;
	this.on = new Image(); this.on.src = onImage;
	this.url = "link.";
}



headerBottomButtons = new Object();
function headerBottomButtonMouseOver(key){
	if(isNav){
		document.HeaderBottomNav.document.images[key].src = headerBottomButtons[key].on.src;
	} else {
		document.images[key].src = headerBottomButtons[key].on.src;
	}
}
function headerBottomButtonMouseOut(key){
	if(isNav){
		document.HeaderBottomNav.document.images[key].src = headerBottomButtons[key].up.src;
	} else {
		document.images[key].src = headerBottomButtons[key].up.src;
	}
}

headerSubNavButtons = new Object();
function headerSubNavMouseOver(key){
	if(headerSubNavButtons[key].popupId){
		showMenu(headerSubNavButtons[key].popupId);
	}else{
		hideMenus();
	}
	if(isNav){
		document.HeaderMiddleNav.document.images[key].src=headerSubNavButtons[key].on.src;
	} else {
		document.images[key].src=headerSubNavButtons[key].on.src;
	}
}
function headerSubNavMouseOut(key){
	if(headerSubNavButtons[key].popupId){
		leaveMenu();
	}else{
		hideMenus();
	}
	if(isNav){
		document.HeaderMiddleNav.document.images[key].src=headerSubNavButtons[key].normal.src;
	} else {
		document.images[key].src=headerSubNavButtons[key].normal.src;
	}
}

headerTopNavButtons = new Object();
function headerTopMouseOver(key){
	if(isNav){
		document.HeaderTopNav.document.images[key].src = headerTopNavButtons[key].down.src;
	} else {
		document.images[key].src = headerTopNavButtons[key].down.src;
	}
}
function headerTopMouseOut(key){
	if(isNav){
		document.HeaderTopNav.document.images[key].src = headerTopNavButtons[key].up.src;
	} else {
		document.images[key].src = headerTopNavButtons[key].up.src;
	}
}

rollovers = new Object();
function rollOver(key){
	document.images[key].src = rollovers[key].on.src;
}
function rollOut(key){
	document.images[key].src = rollovers[key].off.src;
}

popupButtons = new Object();

function popMouseOver(key,popup){
	if(isNav){
		document[popup + 'Popup'].document.images[key].src = popupButtons[key].on.src;
		document[popup + 'Popup'].document.images[popup + 'Icon'].src = popupButtons[key].icon.src;
	} else {
		document.images[key].src = popupButtons[key].on.src;
		document.images[popup + 'Icon'].src = popupButtons[key].icon.src;
	}
	popText( popupButtons[key].text, popup );
	pingMenu();
}
function popMouseOut(key,popup){
	if(isNav){
		document[popup + 'Popup'].document.images[key].src = popupButtons[key].normal.src;
		document[popup + 'Popup'].document.images[popup + 'Icon'].src = "/media/images/nav/subNavPopups/" + popup + ".gif";
	} else {
		document.images[key].src = popupButtons[key].normal.src;
		document.images[popup + 'Icon'].src = "/media/images/nav/subNavPopups/" + popup + ".gif";
	}
	leaveMenu();
	popText(0,popup);
}
function popText(txt,popup){
	if(txt){
		if(isNav){
			//eval("document." + popup + "Popup.document." + popup + "Dynamic.document.write('" + txt + "')\;");
			//eval("document." + popup + "Popup.document." + popup + "Dynamic.document.close()\;");
		} else {
			eval("document.all." + popup + "Popup.document.all." + popup + "Dynamic.innerHTML = '" + popTextTable(txt) + "'\;");
		}
	} else {
		if(isNav){
			//eval("document." + popup + "Popup.document." + popup + "Dynamic.document.write('')\;");
			//eval("document." + popup + "Popup.document." + popup + "Dynamic.document.close()\;");
		} else {
			eval("document.all." + popup + "Popup.document.all." + popup + "Dynamic.innerHTML = '" + popTextTable("&nbsp;") + "'\;");
		}
	}
}
function popTextTable(txt){
	return '<table border="0" cellpadding="0" cellspacing="0"><tr><td><img src="/media/images/pixels/clear.gif" height="37" width="1" border="0"></td><td valign="top"><span class="normal">' + txt + '</span></td></tr></table>'
}

// these functions are for the obfuscator/compressor (stripWhiteSpace.cfm)
function hbbmov(key){headerBottomButtonMouseOver(key);}
function hbbmou(key){headerBottomButtonMouseOut(key);}
function hsnmov(key){headerSubNavMouseOver(key);}
function hsnmou(key){headerSubNavMouseOut(key);}
function htmov(key){headerTopMouseOver(key);}
function htmou(key){headerTopMouseOut(key);}






