var bAutotab = true;

function load() {
	var imgs = load.arguments;
	if (document.images) {
		if (document.preload == null) document.preload = new Array();
		var i = document.preload.length;
		for (var j = 0; j < imgs.length; j++) {
			document.preload[i] = new Image();
			document.preload[i++].src = imgs[j];
		}
	}
}

function restore(){ 
	var i, x, a = document.swaps; 
	if( a ) for( i = 0; i < a.length; i++)
		if( a[i].oldSrc ) a[i].src=a[i].oldSrc;
}

function swap(){ 
	var i, j = 0, a = swap.arguments; 
	document.swaps = new Array; 
	for( i = 0; i < ( a.length - 1 ); i += 2 ){
		document.swaps[j++] = a[i];
		if( !a[i].oldSrc ) a[i].oldSrc = a[i].src;
		a[i].src = a[i + 1];
	}
}

function openW(url, name, w, h) {
	var windowprops = "width=" + w + ",height=" + h;
	popup = window.open(url, name, windowprops);
	setTimeout('popup.focus();',250);
}

function isNumeric()
{
	if (navigator.appName.indexOf("Netscape")<0 || browser=="AppleMAC-Safari")
	{
		get=event.keyCode;
		
		if((get>45&&get<58)||(get>95&&get<106)||(get==8)||(get==9)) 
		{
			return true;
		}
		else
		{
			event.returnValue=false;
		}
	}
}

function AutoTab( hItem, maxLength, linkItem )
{
	
	
	isNumeric();
	if (navigator.appVersion.indexOf('Mac') != -1)
	{
		return;
	}
	else
	{
		var vKeyCode,oItem;
		oItem = eval(linkItem);
	
		vKeyCode = window.event.keyCode
		if(vKeyCode==9 && window.event.shiftKey){ return; }
		switch(window.event.keyCode)
		{
			case 37 : return;
			case 39 : return;
			case 16 : return;
			case 46 : return;
		}
		if (window.event.keyCode != 9 )
		{
			if( typeof(oItem) == "object" )
			{
					
					if(bAutotab && (String(oItem.value).length ==0) && (String(hItem.value).length == maxLength) && (window.event.keyCode != 8))
					{
						oItem.focus();
					}
			}
		}
	}
	bAutotab = true;
}

function stopAutoTab()
{
	bAutotab = false;
}
function var_popup(filelink)
{	
	var mywin ; 
	var link;	
	link=filelink;
	mywin = window.open(link,'myWindow','scrollbars=yes,resizable=yes,status=no,width=525,height=475') ;
}  

