<!-- 

// Add Load Event Function
// Wrap up all onload events into a queue
// Must keep at top of library
// Wrap swf object in a function and add to onload queue (workaround to avoid swfobject/sIRF bug)
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}
// --------------------------------------------------
// Example/Usage:

/*
//addLoadEvent(nameOfSomeFunctionToRunOnPageLoad);
//addLoadEvent(function() {
	// More code to run on load
//});
*/


// Name: openWin
// Language: JavaScript
// Author: Travis Beckham | squidfingers.com
// Description: This script is for opening external windows.
// --------------------------------------------------

openWin = function(url,name,width,height,xpos,ypos,chrome,scroll){
  var x, y, w, h, moveX=0, moveY=0, features="";
  chrome = chrome ? "yes" : "no";
  scroll = scroll ? "yes" : "no";
  features += "toolbar="+chrome+",location="+chrome+",status="+chrome+",menubar="+chrome;
  features += ",scrollbars="+scroll+",resizable="+scroll;
  if(width) features += ",width="+width;
  if(height) features += ",height="+height;
  if(xpos && window.screen){
    w = window.screen.availWidth;
    width = parseInt(width);
    switch(xpos){
      case "left": x = 0; break;
      case "center": x = (w-width)/2; break;
      case "right": x = w-width; break;
      default: x = xpos;
    }
    features += ",screenX="+x+",left="+x;
    var moveX = x;
  }
  if(ypos && window.screen){
    h = window.screen.availHeight;
    height = parseInt(height);
    switch(ypos){
      case "top": y = 0; break;
      case "middle": y = (h-height)/2; break;
      case "bottom": y = h-height; break;
      default: y = ypos;
    }
    features += ",screenY="+y+",top="+y;
    var moveY = y;
  }
  openWinReference = window.open(url,name,features);
  if(moveX || moveY){
    // position the window for browsers that don't recognize screenX, screenY
    openWinReference.moveTo(moveX,moveY);
  }
}
openScroll = function(url,name,width,height){
  openWin(url,name,width,height,false,false,false,"scroll");
}
openCenter = function(url,name,width,height){
  openWin(url,name,width,height,"center","middle");
}
openCenterScroll = function(url,name,width,height){
  openWin(url,name,width,height,"center","middle",false,"scroll");
}
openFull = function(url,name){
  openWin(url,name,false,false,false,false,"chrome","scroll");
}

// --------------------------------------------------
// Example/Usage:

/*
<a href="#" onclick="openWin('blank.html', 'blank', '400', '300');">no position, no features, no scroll</a>
<a href="#" onclick="openWin('blank.html', 'blank', '400', '300', 'center');">center, no features, no scroll</a>
<a href="#" onclick="openWin('blank.html', 'blank', '400', '300', 'center', 'middle');">center/middle, no features, no scroll</a>
<a href="#" onclick="openWin('blank.html', 'blank', '400', '300', 'right', 'middle', 'chrome');">right/middle, features, no scroll</a>
<a href="#" onclick="openWin('blank.html', 'blank', '400', '300', 'left', 'bottom', false, 'scroll');">left/bottom, no features, scroll</a>
<a href="#" onclick="openWin('blank.html', 'blank', '400', '300', 'center', '50');">center/50, no features, no scroll</a>
<a href="#" onclick="openWin('blank.html', 'blank', false, false, false, false, 'chrome', 'scroll');">no size, no position, features, scroll</a>

--- Preset Functions --- 

<a href="#" onclick="openScroll('blank.html', 'blank', '400', '300');">openScroll</a>
<a href="#" onclick="openCenter('blank.html', 'blank', '400', '300');">openCenter</a>
<a href="#" onclick="openCenterScroll('blank.html', 'blank', '400', '300');">openCenterScroll</a>
<a href="#" onclick="openFull('blank.html', 'blank');">openFull</a>
*/


// Select Menu Jump URL (modified from MM_)
function jumpURL(targ,selObj,restore,newwin){
	if(newwin == 1){
		window.open(selObj.options[selObj.selectedIndex].value);
	} else {
		eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
		if (restore) selObj.selectedIndex=0;
	}
}

// Hide/Show DIV Layer
function collapse(id) { 
	if (document.getElementById) { // DOM3 = IE5, NS6
		if (document.getElementById(id).style.display == "none"){
			document.getElementById(id).style.display = 'block';
		} else {
			document.getElementById(id).style.display = 'none';			
		}	
	} else { 
		if (document.layers) {	
			if (document.id.display == "none"){
				document.id.display = 'block';
			} else {
				document.id.display = 'none';
			}
		} else {
			if (document.all.id.style.visibility == "none"){
				document.all.id.style.display = 'block';
			} else {
				document.all.id.style.display = 'none';
			}
		}
	}
}

// Hide/Show DIV Layer x2 @ once
function collapseShow(idShow,idHide) { 
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(idShow).style.display = 'block';
		document.getElementById(idHide).style.display = 'none';			
	} else { 
		if (document.layers) {	
			document.idShow.display = 'block';
			document.idHide.display = 'none';
		} else {
			document.all.idShow.style.display = 'block';
			document.all.idHide.style.display = 'none';
		}
	}
}

function swapImage(imgname, id) {
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).src = imgname;
	} else { 
		if (document.layers) {	
			document.id.src = imgname;
		} else {
			document.all.id.src = imgname;
		}
	}
}


-->
