/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}

var ANewWindow = null; 
function openAWindow(theURL,winName,w,h,scroll) { //v2.0
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
if (!ANewWindow || ANewWindow.closed) {
ANewWindow = window.open(theURL,winName,settings);
} else {
ANewWindow.location = theURL;
ANewWindow.focus();
}
}


function toggleHelp(show,hide,block) {
	if (document.getElementById(block).style.display == "none") {
		document.getElementById(show).style.display  = "none";
		document.getElementById(hide).style.display = "";
	    new Effect.BlindDown(block, {duration: 0.4,
	      afterFinish: function() {
	        Element.undoClipping(block);
	        $(block).style.width = "auto";
	        $(block).style.height = "auto";
	      }})
	} else {
		document.getElementById(show).style.display  = "";
		document.getElementById(hide).style.display = "none";
	    new Effect.BlindUp(block, {duration: 0.4,
	      afterFinish: function() {
	        Element.undoClipping(block);
	        Element.hide(block);
	      }})
	}
}