function openWinCard(url)
{
var j=window.open(url,"jj","left=20, scrollbars=0") 
}

function Photo(url) 
{
    var j = window.open("", "jj", "top=60, left=130,width=305,height=300,scrollbars=yes,resizable=no,titlebar=no,menubar=no,toolbar=no,locationbar=no,location=no,status=no")
    with (j.document) 
    {
        open();
        url = url.replace(":", "'");
        writeln('<html><head><title>Photo</title><link rel="stylesheet" type="text/css" href="include/style_sheet.css" /></head><body topMargin="1" leftMargin="1" marginwidth="1" marginheight="1" onload="var imgHeight=document.all.xyz.height;var imgWidth=document.all.xyz.width; window.resizeTo((imgWidth+30),(imgHeight+110));return true;" marginwidth=1 marginheight=1 topmargin=0 leftmargin=0>');
        writeln('<center><img border="0" name="xyz" src="' + url + '"></center>');
        writeln('<center><a href="javascript:window.close()" class="blueu01">Close</a></center>');
        close();
    }
}
function AdminPhoto(url) {
    var j = window.open("", "jj", "top=60, left=130,width=305,height=300,scrollbars=yes,resizable=no,titlebar=no,menubar=no,toolbar=no,locationbar=no,location=no,status=no")
    with (j.document) {
        open();
        url = url.replace(":", "'");
        writeln('<html><head><title>Photo</title><link rel="stylesheet" type="text/css" href="../include/style_sheet.css" /></head><body topMargin="1" leftMargin="1" marginwidth="1" marginheight="1" onload="var imgHeight=document.all.xyz.height;var imgWidth=document.all.xyz.width; window.resizeTo((imgWidth+30),(imgHeight+110));return true;" marginwidth=1 marginheight=1 topmargin=0 leftmargin=0>');
        writeln('<center><img border="0" name="xyz" src="' + url + '"></center>');
        writeln('<center><a href="javascript:window.close()" class="blueu01">Close</a></center>');
        close();
    }
}
function openWin1(url)
{
var j=window.open(url,"jj","left=20, width=600, height=600, scrollbars=0") 
}

function openWin2(url)
{
var j=window.open(url,"jj","left=20, top=20, width=445, height=588, scrollbars=0") 
}

function openWin3(url)
{
var j=window.open(url,"jj","left=20, top=20, width=535, height=340, scrollbars=0") 
}

function openWin4(url)
{
var j=window.open(url,"jj","left=20, top=20, width=690, height=536, scrollbars=0") 
}

function openWin5(url)
{
var j=window.open(url,"jj","left=20, top=20, width=690, height=495, scrollbars=0") 
}

function openWinTrust(url)
{
var j=window.open(url,"jj","left=20, width=600, height=440, scrollbars=0") 
}

/*function openWin1(url)
{
var j=window.open(url,"jj","left=20, top=20, width=690,height=570,scrollbars=0") 
}
function openWin5(url)
{
var j=window.open(url,"jj","left=20, top=20, width=700,height=650,scrollbars=0") 
}

function openWinPopup(url)
{
var j=window.open(url,"jj","left=20, top=20, width=500,height=430,scrollbars=1") 
}

function openWinEdges(url)
{
var j=window.open(url,"jj","left=20, top=20, width=620,height=460,scrollbars=1") 
}

function openWin2(url)
{
    var j = window.open(url, "jj", "left=20, top=20, width=690,height=536,scrollbars=1") 
}

function openWin(url)
{
var j=window.open(url,"jj","left=20, top=20, width=400,height=360,scrollbars=1") 
}
*/

function showObjective(fsDivID)
{
	
    hideAll();
    document.getElementById(fsDivID).style.display='inline';
}

function hideAll()
{
	if(document.getElementById('apDiv1'))
    	document.getElementById('apDiv1').style.display='none';
	if(document.getElementById('apDiv2'))
		document.getElementById('apDiv2').style.display='none';
	if(document.getElementById('apDiv3'))
		document.getElementById('apDiv3').style.display='none';
	if(document.getElementById('apDiv4'))
		document.getElementById('apDiv4').style.display='none';
}

function hideObjective()
{
    hideAll();
}

//popup images
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 MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

//popup images

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function showhide(layer_ref) { 
    var element = document.getElementById(layer_ref);
    if(element.style.display == "" || element.style.display == "none")
    	element.style.display = "block";
    else
	    element.style.display = "none";
}

function show(layer_ref) { 
    var element = document.getElementById(layer_ref);
	element.style.display = "block";
}

function hide(layer_ref) { 
    var element = document.getElementById(layer_ref);
    element.style.display = "none";
}
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 MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function checkMaxLengthOnKeyPress(foEvent, foTextArea, foMaxlength) {
    if (foEvent.charCode || window.event) {
        return foTextArea.value.length < foMaxlength;
    }
    else {
        return true;
    }
}
function floatsonly(e, txtvalue) {
    var floatflag;
    if (e.keyCode) keycode = e.keyCode;
    else keycode = e.which;
    if (keycode == 9 || keycode == 46 || keycode == 16 || keycode == 37 || keycode == 39 || keycode == 36 || keycode == 35) {								//if the key is tab or delete or shiftkey
        return true;
    }
    if (keycode != 8) {
        //if the key isn't the backspace key (which we should allow).
        if (keycode == 110 || keycode == 190) {
            if (txtvalue.indexOf(".") == -1) {
                return true;
            }
            else {
                return false;
            }
        }
        if ((keycode < 48 || keycode > 57) && (keycode < 96 || keycode > 105)) //if not a number
            return false //disable key press
    }
    if (e.shiftKey) {
        return false;
    }
}

function numbersonly(e) {
    if (e.keyCode) keycode = e.keyCode;
    else keycode = e.which;
    if (keycode == 9 || keycode == 46 || keycode == 16 || keycode == 37 || keycode == 39 || keycode == 36 || keycode == 35) {
        //if the key is tab or delete or shiftkey
        return true;
    }
    if (keycode != 8) {
        //if the key isn't the backspace key (which we should allow)
        if ((keycode < 48 || keycode > 57) && (keycode < 96 || keycode > 105)) //if not a number
            return false //disable key press
    }
    if (e.shiftKey) {
        return false;
    }
}

function isBlank(val) {
    if (val == null) { return true; }
    for (var i = 0; i < val.length; i++) {
        if ((val.charAt(i) != ' ') && (val.charAt(i) != "\t") && (val.charAt(i) != "\n") && (val.charAt(i) != "\r")) { return false; }
    }
    return true;
}
function onkeyPressForFile(e) {
    var key = window.event ? e.keyCode : e.which;
    e.cancelBubble = true;
    e.returnValue = false;
    return false;
}
function checkMaxLengthOnBlur(foEvent, foTextArea, foMaxlength) {
    if (foTextArea.value.length > foMaxlength) {
        foTextArea.value = foTextArea.value.substring(0, foMaxlength);
    }
}