// Image rollover functions

function rollIn(imgName, imgSrc) {
    if (document.images) {
        document[imgName].src = imgSrc;
    }
}

function rollOut(imgName, imgSrc) {
    if (document.images){
        document[imgName].src = imgSrc;
    }
}

// Image rollover functions used in Showcase to change 2 different images

function rollInTwo(imgName1, imgSrc1, imgName2, imgSrc2) {
    if (document.images) {
        document[imgName1].src = imgSrc1;
		document[imgName2].src = imgSrc2;
    }
}

function rollOutTwo(imgName1, imgSrc1, imgName2, imgSrc2) {
    if (document.images){
        document[imgName1].src = imgSrc1;
		document[imgName2].src = imgSrc2;
    }
}

// Used to navigate within and between sections

function dropnav() {
    location.href = document.dropnavform.dropnavbar.options[document.dropnavform.dropnavbar.selectedIndex].value;
}

// Function used to create enlarged image and PDF index windows
// This function disables toolbars, enables scrollbars and specifies window size [increased to 700 20May04 by gg]

function winpopnotool(indexurl) {
	var notoolwin = null;
	notoolwin = window.open(indexurl, 'notool', 'menubar=0,location=0,toolbar=0,personalbar=0,status=0,scrollbars=1,resizable=1,width=825,height=500');
	notoolwin.focus();
}

// Function used to display Quicktime VR
// This function disables toolbars, enables scrollbars and specifies window size

function winpopvr(vrurl) {
	var vrwin = null;
	vrwin = window.open(vrurl, 'vr', 'menubar=0,location=0,toolbar=0,personalbar=0,status=0,scrollbars=1,resizable=1,width=500,height=500');
	vrwin.focus();
}


// Function used to keep all outside links from spawning new windows
// This function maintains toolsbars and scrollbars

function winpop(popurl) {
	var popwin = null;
	popwin = window.open(popurl, 'popwin', 'menubar=1,location=1,toolbar=1,personalbar=1,status=1,scrollbars=1,resizable=1');
	popwin.focus();
}

// Function used to generate Image pop-ups from Library 
//This function avoids the creation of HTML pages for the pop-ups

function popupwrite (directory, imgnbr) {	popupwin=window.open("","Image","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,top=10,left=10,width=700,height=500");
    popupwin.document.write("<html>\n<head>\n<title>Egan Visual  |  Enlarged Image</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"/egan.css\">\n</head>\n<body leftmargin=\"0\" marginheight=\"0\" marginwidth=\"0\" topmargin=\"0\">\n");
	popupwin.document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"5\" width=\"100%\">\n<tr>\n<td bgcolor=\"#520876\"><img src=\"/imglib/site/shim.gif\" alt=\"\" width=\"600\" height=\"1\" border=\"0\"><img src=\"/imglib/site/egan_logo_sm.gif\" alt=\"Egan Visual\" width=\"29\" height=\"29\" border=\"0\"></td>\n</tr>\n");
	popupwin.document.write("<tr>\n<td bgcolor=\"#F2F2F2\">\n<h1>Enlarged Image</h1>\n<span class=\"bodytextbold\">To download image...</span><br>\n<br>\n<span class=\"bodytext\">PC Users: Right-Click on the image below and choose &quot;Save Picture As...&quot;<br>\nMac Users: Control-Click on the image below and choose &quot;Download Image to Disk&quot</span><br>\n<br>\n</td>\n</tr>\n");
	popupwin.document.write("<tr>\n<td><img src=\"/imglib/" + directory + "/enlg_"  + imgnbr + ".jpg\" alt=\"\" border=\"0\"></td>\n</tr>\n");
	popupwin.document.write("<tr>\n<td><br>\n<img name=\"copyright\" alt=\"&copy; Egan Visual Inc.\" src=\"/imglib/site/copyright.gif\" width=\"460\" height=\"30\" border=\"0\" usemap=\"#m_copyright\">\n<map name=\"m_copyright\">\n<area shape=\"rect\" coords=\"153,0,251,15\" href=\"mailto:marketing@egan.com\">\n</map>\n</table>\n</body>\n</html>\n");
	popupwin.document.close();
}

// Popup/redirect/download functions
function popup_redirect(url,Width,Height) 
{ 
  winconfig = 'fullscreen=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + Width + ',height=' + Height ;
  if (window["popupWindow"] == null) window["popupWindow"] = new Array();
  var wp = popupWindow.length;
  popupWindow[wp] = window.open(url,'pop',winconfig);
  ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", 50);
  popupWindow[wp].document.body.onload = function() {window.setInterval("window.focus();", 50);}; 
  if (popupWindow[wp].opener == null) popupWindow[wp].opener = self;  
  if (document.all || document.layers || document.getElementById) 
  {
  	window.onbeforeunload = function() 
	{
		for (var i=0;i<popupWindow.length;i++) popupWindow[i].close();
	}; 
  }   
  document.MM_returnValue = false;
}

function redirect_conf(url,close)
{
    	opener.location.href = url;
	if (close == true)setTimeout('self.close()',0500);
}

