/*
*********************************************************************
Language:       Javascript 1.5
Web Site:       http://www.backontrackme.org/
File Path:      /_scripts/
Copyright:      ©2006 Jamie Peloquin (www.jamiepeloquin.com)
Created:        2006-11-21 16:16:35
*********************************************************************
*******************************************************************
Javascript worksheet
*******************************************************************
*/
/* FORMS --------------------------------------------------------- */
/* BEGIN: Submit Form */
function form_submit($FORM) {
	document.getElementById($FORM).submit();
}
/* BEGIN: Submit Form */



/* CSS CONTROL --------------------------------------------------- */
/* BEGIN: Toggle Show/Hide */
function cssToggleShow(OID,DISP) {
	// OID = Object's ID
	// DISP = block, inline, list-item
	var thisOID = document.getElementById(OID);
	if(thisOID.style.display == "none"){
		thisOID.style.display=DISP;
	}
	else{
		thisOID.style.display="none";
	}
}
/* END: Toggle Show/Hide */


/* WINDOWS ------------------------------------------------------- */
/* @ DEFAULT POPUPWINDOW */

function popWindowDefault(wURL){
    var WD = 800;
    var HT = 600;
	var halfW = (WD/2)
 	var halfH = (HT/2)
   	var screenW = screen.availWidth
    var screenH = screen.availHeight
    
    var screenX = ((screenW / 2) - halfW) // is half the width of the window
    var screenY = ((screenH / 2) - halfH) // is half the height of the window
	
	if(document.layers){ //Fixes Netscape 4 bug
    	var popWin = window.open(wURL, 'popWinW');
	}
	else{
		var popWin = window.open(wURL, 'popWinW, width='+WD+', height='+HT+', top='+screenY+', left='+screenX+', toolbar=yes, location=yes, menubar=yes, scrollbars=yes, status=yes, resizable=yes');
    }
    popWin.focus();
}

/* @ END */

/* BEGIN: Pop Window Generic - Centered */
function pop_generic(NAME,URL,WD,HT,TOOL,LOCATION,MENU,SCROLL,STATUS,RESIZE){
	if(!NAME){NAME = "genWin"}
	if(!WD){WD = "800"}
	if(!HT){HT = "600"}
	if(!TOOL){TOOL = "yes"}
	if(!LOCATION){LOCATION = "yes"}
	if(!MENU){MENU = "yes"}
	if(!SCROLL){SCROLL = "yes"}
	if(!STATUS){STATUS = "yes"}
	if(!RESIZE){RESIZE = "yes"}
	var halfW = (WD/2)
 	var halfH = (HT/2)
   	var screenW = screen.availWidth
    var screenH = screen.availHeight
    
    var screenX = ((screenW / 2) - halfW) // is half the width of the window
    var screenY = ((screenH / 2) - halfH) // is half the height of the window
	
	var WINNAME = NAME+'_win'
	if(document.layers){ //Fixes Netscape 4 bug
    	var NAME = window.open(URL, WINNAME);
	}
	else{
		var NAME = window.open(URL, WINNAME, 'width='+WD+', height='+HT+', top='+screenY+', left='+screenX+', toolbar='+TOOL+', location='+LOCATION+', menubar='+MENU+', scrollbars='+SCROLL+', status='+STATUS+', resizable='+RESIZE);
    }
    NAME.focus();
}
/* END: Pop Window Generic - Centered */
