// JavaScript Document

// dhtml fucntions to hide the element
  function jsu_display(itemId){
	 
		var elem = document.getElementById(itemId);
		if(elem.style.display == 'block')
			elem.style.display = 'none';
		else
			elem.style.display = 'block';
		
	}

  function jsu_visible(itemId){
		var elem = document.getElementById(itemId);
		if(elem.style.visibility == 'hidden')
			elem.style.visibility = 'visible';
		else
			elem.style.visibility = 'hidden';
		
	}
	
	
function jsu_hide(id)
	{
		//alert(id);
		document.getElementById(id).style.display = 'none';
	}
	
	function jsu_show(id)
	{
		document.getElementById(id).style.display = 'block';
	}

	
function trim(stringToTrim) {//alert('trim ');
    return stringToTrim.replace(/^\s+|\s+$/g,"");
}

function jsu_popup(goLocation) {
	
var ver=parseInt(navigator.appVersion);
var isNetscape=navigator.appName.indexOf("Netscape")>=0;
var isExplorer=navigator.appName.indexOf("Explorer")>=0;

	
        var ww=630;
        var wh=450;
        var positionCode="";
        if(ver>=4) {
                sw  = screen.width;
                sh  = screen.height;
                wbx = Math.round((sw-ww)/2);
                wby = Math.round((sh-wh)/2);
                if(isExplorer) positionCode="left="+wbx+",top="+wby+",";
                if(isNetscape) positionCode="screenX="+wbx+",screenY="+wby+",";
        }

        newWindow=window.open(goLocation,"sample",
        "width="+ww+",height="+wh+","+
        positionCode+
        "toolbar=no,"+
        "bar=no"+
        "location=no,"+
        "status=yes,"+
        "menubar=no,"+
        "scrollbars=yes,"+
        "resizable=1");
        if(isNetscape && ver>=3) newWindow.focus();
    window.name='main';
}

var submitted_form = new Array();
function jsu_forms_submit(form_name)
{
	
	if ( !submitted_form[form_name] )
	{
		submitted_form[form_name] =1;
		document.forms[form_name].submit();
	}
	
}

function check(id)
{
	element = document.getElementById(id);
	if (element)element.checked = true;
}

function uncheck(id)
{
	element = document.getElementById(id);
	if (element)element.checked = false;
}



