$(document).ready(function() {
	$("a.external").each(function() {
		$(this).attr("target", "_blank");
	});
	//just in case the flash fails, make sure content gets shown on homepage
	//defaultContent = setTimeout("fShowHomePage()", 10000);
	//changetext();

	if ($('#headerimage').length > 0) {
		if ($('#headerimage').children().length > 1) {
			$('#headerimage').innerfade({
				speed: 'slow',
				timeout: 5000,
				type: 'sequence'/*,
				containerheight: '368px'*/ });
		} else  {
			$('#headerimage').children(0).show();
		}
	}

});

function LaunchWin(Url,ContextWSize,ContextHSize)

{

	var ContextWOffset = (screen.width)/2  - ContextWSize/2;

	var ContextHOffset = (screen.height)/2  - ContextHSize/2;

	pcBox = window.open(Url,"pcBox","width=" + ContextWSize +",height="+ ContextHSize +",toolbar=0,directories=0,menubar=0,status=0,resizable=0,location=0,scrollbars=1,copyhistory=0")

	pcBox.moveTo(ContextWOffset,ContextHOffset);

	pcBox.window.focus();

	return false;

}

function KeyLaunchWin(inField, e, Url,ContextWSize,ContextHSize) {
    var charCode;
    
    if(e && e.which){
        charCode = e.which;
    }else if(window.event){
        e = window.event;
        charCode = e.keyCode;
    }

    if(charCode == 13) {
        LaunchWin(Url, ContextWSize, ContextHSize);
    }
}


function clearDefault(el) {

	if (el.defaultValue==el.value) el.value = "";

}

function setDefault(el) {

	if (el.value=="") el.value = el.defaultValue;

}

function collapse(divname){
	thediv = document.getElementById(divname);
	divPlus = divname + 'Plus';
	plusDiv = document.getElementById(divPlus);
	if (thediv.style.display == 'none') {
		thediv.style.display = 'block';
		plusDiv.style.display = 'none';
	}
	else {
		thediv.style.display = 'none';
		plusDiv.style.display = 'block';
	}
}

