var BrowserName=navigator.appName; 
var version = navigator.appVersion;
var win 		= (navigator.userAgent.indexOf('Win') != -1 ) ? 1 : 0;
var jsOn        = (navigator.javaEnabled()) ? true: false;


function preloadImage(imgObj,imgSrc) 
{
	if (document.images) {
		eval(imgObj+' = new Image()');
		eval(imgObj+'.src = "'+imgSrc+'"');
	}
}

// Change Image Over
function changeImage(imgName,imgObj) {
	var images;
//		alert(eval( imgObj+".src" ));
		images = document.images;
	if (images) 
		images[imgName].src = eval( imgObj+".src" );
}

function doMain(URL)
{
	window.opener.location.href = URL;
	this.window.close();
}


function closePopup() 
{
	window.opener.refresh();
	this.window.close();
}


function sendForm(f) {
	document.forms[""+f+""].submit();
}


function show(object) {
  	if (document.layers && document.layers[object] != null)
        document.layers[object].visibility = 'visible';
    if (document.all)
        document.all[object].style.visibility = 'visible';
	else if ( document.getElementById )
		document.getElementById(object).visibility  = 'visible';
}

function hide(object) {
    if (document.layers && document.layers[object] != null)
        document.layers[object].visibility = 'hidden';
    if (document.all)
        document.all[object].style.visibility = 'hidden';
	else if ( document.getElementById )
		document.getElementById(object).visibility  = 'hidden';
}

function openWindow( url, title, x, y ) 
{
	w = window.screen.width;
	h = window.screen.height;
	px = w / 2 - x / 2; if ( px < 0 ) px = 0;
	py = h / 2 - y / 2; if ( py < 0 ) py = 0;
	a=window.open(url, title, "toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes, height="+y+", width="+x);
	a.moveTo(px,py);
	document.title=document.title;		
	return ( a );
}

function handleFormEnter( command ) 
{
	if ( window.event.keyCode == 13 ) {
//		alert(eval ( command ));
		window.event.cancelBubble = true;
	}
}

function cancelFormEnter( ) 
{
	if ( window.event.keyCode == 13 ) {
		window.event.cancelBubble = true;
	}
//	alert(window.event.keyCode);
}
