// JavaScript Document

<!--
function popWin(windo,W,H) {
	window.open(windo, 'pop','scrollbars=yes,resizable=yes,width='+W+',height='+H+',status=yes') ;
}

var curOS ;
if (navigator.appVersion.indexOf("Win")!=-1) curOS="Windows";
else if (navigator.appVersion.indexOf("Mac")!=-1) curOS="MacOS";
else if (navigator.appVersion.indexOf("X11")!=-1) curOS="UNIX";
else if (navigator.appVersion.indexOf("Linux")!=-1) curOS="Linux";
else curOS="unknown";

if (window.ActiveXObject) window.ie = window[window.XMLHttpRequest ? 'ie7' : 'ie6'] = true ;
else if (document.childNodes && !document.all && !navigator.taintEnabled) window.khtml = true ;
else if (document.getBoxObjectFor != null) window.gecko = true ;
if (window.ie6) try {document.execCommand("BackgroundImageCache", false, true);} catch (e){} ;

function _newWindow(url,name,fwidth,fheight,status,directories,location,toolbar,menubar,scrollbars,resizable,vLeft,vTop,fCloseSelf,fResizeParent) {
    // setting the new window size dependng on whats passed
    switch (fwidth){
        case "max":
            fwidth = screen.width;
        break
        case "half":
            fwidth = screen.width/2;
        break
        default:
            fwidth = Number(fwidth);
            /*if(document.sPlatform.indexOf("Mac") == -1){
                fwidth += 10;// add window width for pcs
            }/**/
    }
    switch (fheight){
        case "max":
            fheight = screen.height-15;//adjust for browser chrome
            /*if(document.sPlatformType.indexOf("Mac") == -1){
                fheight -= 45;// take off extra for pcs
            }/**/
        break
        case "half":
            fheight = screen.height/2;
        break
        default:
            fheight = Number(fheight);
            /*if(document.sPlatformType.indexOf("Mac") == -1){
                fheight += 15;// add extra for pcs
            }/**/
    }
    // set the position 
    if(vLeft == "center"){vLeft = (screen.width/2) - (fwidth/2);}
    if(vTop == "center"){vTop = (screen.height/2)  - (fheight/2);}
    //alert("Top="+vTop+" Left="+vLeft);
    //
    options = ((fwidth!="")?"width="+fwidth:"")+((fheight!="")?",height="+fheight:"")+",status="+((status=="1")?"yes":"no")+",directories="+((directories=="1")?"yes":"no")+",location="+((location=="1")?"yes":"no")+",toolbar="+((toolbar=="1")?"yes":"no")+",menubar="+((menubar=="1")?"yes":"no")+",scrollbars="+((scrollbars=="1")?"yes":"no")+",resizable="+((resizable=="1")?"yes":"no")+",left="+vLeft+",top="+vTop ;
    var sWinObject = name.replace(" ","_");
    eval(sWinObject+"=window.open('"+url+"','"+sWinObject+"','"+options+"')");
    if (fCloseSelf == true){this.close();}
    
    if(fResizeParent == true){
        self.moveTo(0,0);
        window.resizeTo(screen.width,screen.height);
    };
}


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function resize(objW, objH) {
	var objRef = MM_findObj("flashObj2",0);
	objRef.width = objW;
	objRef.height = objH;
	var objRef = MM_findObj("flashObj",0);
	objRef.width = objW;
	objRef.height = objH;
}

function resizeW(objW) {
	var objRef = MM_findObj("flashObj2",0);
	objRef.width = objW;
	var objRef = MM_findObj("flashObj",0);
	objRef.width = objW;
}

function resizeH(objH) {
	var objRef = MM_findObj("flashObj2",0);
	objRef.height = objH;
	var objRef = MM_findObj("flashObj",0);
	objRef.height = objH;	
}

function resizeHandler() {
	if (window.innerWidth) { // Netscape
		var wPage = window.innerWidth;
		var hPage = window.innerHeight;
		var wWindow = window.outerWidth;
		var hWindow = window.outerHeight;
	}
	else if (window.document.body.clientWidth) { // IE
		var wPage = window.document.body.clientWidth; 
		var hPage = window.document.body.clientHeight; 
		var wWindow = 0;
		var hWindow = 0;
	}
	
	var minW = "754";
	var minH = "555";
	
	if (wPage >= minW && hPage >= minH) {
		resize("100%", "100%");
	} else if (wPage < minW && hPage >= minH) {
		resize(minW + "px", "100%");
	} else if (wPage >= minW && hPage < minH) {
		resize("100%", minH + "px");
	} else {
		resize(minW + "px", minH +"px");
	}
}

window.onresize = function() {
	resizeHandler();
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

// Disable a form's submit/cancel button and submit the form. Before submitting, 
// we'll execute a callback function, if applicable...
var disableAndSubmit = function(submitID, cancelID, formID, callback){

	if ($(submitID)) {
		if ($(submitID).getTag() == 'input') {
			$(submitID).setProperty('disabled', true) ;
		} else if ($(submitID).getTag() == 'a') {
			$(submitID).setProperty('href','javascript:void(0)') ;
		} 
		$(submitID).setStyle('opacity', .5) ;
	}

	if ($(cancelID)) {
		if ($(cancelID).getTag() == 'input') {
			$(cancelID).setProperty('disabled', true) ;
		} else if ($(cancelID).getTag() == 'a') {
			$(cancelID).setProperty('href','javascript:void(0)') ;
		} 
		$(cancelID).setStyle('opacity', .5) ;
	}

	if (typeof(callback) == 'function') {
		callback() ;
	}

	return true ; 
} ;
//-->

