navTimer = null;
currentNav = 0;
o_navigator = navigator.userAgent
var isIE50 = (o_navigator.indexOf("MSIE 5.0") > -1) ? 1 : 0;
var isIE52 = (o_navigator.indexOf("MSIE 5.2") > -1) ? 1 : 0;
var isNN6 = (o_navigator.indexOf("Netscape6") > -1) ? 1 : 0;
var isDOM = (document.getElementById) ? 1 : 0;

function mainNavOver(o_div){
	if(isDOM&&!isNN6&&!isIE52&&!isIE50){
		if(currentNav)currentNav.className = "navOut";
		clearTimeout(navTimer);
		o_div.className="navOver";
	}
}
function mainNavOut(o_div){
	if(isDOM&&!isNN6&&!isIE52&&!isIE50){
		currentNav = o_div;
		navTimer = setTimeout('currentNav.className="navOut"',1);
	}
}

    /* Function to trim the String */
    function trim ( str1 )
    {
	    if ( str1 == null )
		    return "";
    		
	    var str = new String ( str1 )
	    if ( str.length == 0 )
		    return ""
	    var i = 0;
	    for ( ;i < str.length; i++ )
	    {
		    var ch = str.charAt (i);
		    if ( !(ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t' ) )
			    break;
	    }
	    str = str.substring ( i );
	    i = str.length - 1;
	    for ( ;i >= 0; i-- )
	    {
		    var ch = str.charAt (i);
		    if ( !(ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t' ) )
			    break;
	    }
	    str = str.substring ( 0, ++i );
	    return str
    }

    function showPage (form)
    {
	    form.cno.value = trim(form.cno.value)
	    if ( trim ( form.cno.value ) == "" || trim ( form.cno.value ) == "RefLife #" )
	    {
		    form.cno.select ();
		    form.cno.focus ();
		    return;
	    }
	    form.target = "_blank";
	    form.action = "public/PublicFile.aspx?node=" + ( Math.round ( Math.random () * 1000000 ) + 100000 );
	    return true;
	    //form.submit ();
    }

    function isPosInteger ( num1 )
    {
	    var num = new String ( num1 );
	    if ( num == null || isNaN ( num ) ) return false;
	    if ( trim ( num ).length == 0 )
		    return false
    	
	    for ( var i = 0; i < num.length; i++ )
	    {
		    var ch = num.charAt (i);
		    if ( ch < "0" || ch > "9" )
			    return false;
	    }
	    return true
    }

    /* Function to validate all fields */
    function validate ()
    {
	    if ( trim ( document.frmlogin.login.value ).length == 0 )
	    {
		    document.frmlogin.login.focus ();
		    return false;
	    }
	    else if ( trim ( document.frmlogin.pwd.value ).length == 0 )
	    {
		    document.frmlogin.pwd.focus ();
		    return false;
	    }
	    document.frmlogin.target = "_self";
	    document.frmlogin.action = "mirror/validate.aspx";
	    return true;
    }
    
    function searchRMID(obj, isFocus, RMID) {
    	var text = "RefLife #";
    	
    	if(RMID)
    		text = RMID;
      
      	if(obj.value != text)
      		obj.style.color="#000000";obj.style.fontStyle="normal";
      		
      	if((obj.value == text) || (isFocus && obj.value.trim() == "")) {
       		obj.style.color="#000000";obj.style.fontStyle="normal";obj.value='';
      	}else if(obj.value==''){
       		obj.style.color="#CCC";obj.value=text;
      	}
    }
