// Sets various id strings you feed into this to an 'active' class
// Feed in as many args as you like
function setNav()
{
  var args = setNav.arguments;
  for(i=0; i<args.length; i++)
  {
    if (document.getElementById(args[i]))
    {
    	document.getElementById(args[i]).className = 'active';
    }
  }
}

// Everybody's favorite preloader from Dreamweaver
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];}}
}

// Popup window - give me the url, width, and height, and I'll give you a popup
function popUp(url, x, y)
{
    // Margin offsets since we're really just doing images
    x += 20;
    y += 20;
    
	if (isIE() == true)
	{
		y += 40;
	}
    var args = "width=" + x + ",height=" + y;
    var date = new Date();
    var now = date.getTime();
    var newName = (now).toString(10);

    window.open(url,newName,args);
}

// For popup thing
function isIE()
{
	//Detect IE5.5+
	version=0;
	if (navigator.appVersion.indexOf("MSIE")!=-1) {
		temp=navigator.appVersion.split("MSIE");
		version=parseFloat(temp[1]);
	}
	if (version >= 5.5)
	{ //NON IE browser will return 0
		return true;
	} else {
		return false;
	}	
}
