// Legacy window.open code, mostly used for the Project Planner popup app.
function popWin(sURL, iWidth, iHeight) {
	subWinXpos = (screen.width / 2) - (iWidth / 2);
	subWinYpos = (screen.height / 2) - (iHeight / 2);
	
	subWinAttr	= 'toolbar=1,'
				+ 'scrollbars=1,'
				+ 'location=0,'
				+ 'statusbars=0,'
				+ 'menubar=no,'
				+ 'resizable=1,'
				+ 'width=' + iWidth + ','
				+ 'height=' + iHeight + ','
				+ 'left=' + subWinXpos + ','
				+ 'top=' + subWinYpos;
	WINDOW = window.open(sURL, 'subWin', subWinAttr);
	WINDOW.focus();
}

// Legacy select drop down onChange event for the Projects page.
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


jQuery(document).ready( function() {

// Generate a regular window.open function when the document is ready.
    jQuery('A[rel="external"]').click( function(){
        window.open( jQuery(this).attr('href') );
        return false;
    });

// Search form watermarking
    swapValues = [];
    jQuery("#search").each(function(i){
        swapValues[i] = jQuery(this).val();
        jQuery(this).focus(function(){
            if (jQuery(this).val() == swapValues[i]) {
                jQuery(this).val("");
            }
        }).blur(function(){
            if (jQuery.trim(jQuery(this).val()) == "") {
                jQuery(this).val(swapValues[i]);
            }
        });
    });

// Generate the footer's copyright year
    $("#copy-year").text( (new Date).getFullYear() );

});

