var zzz;

function CheckTab(el){
	if ((document.all) && (9==event.keyCode)) {
	    el.selection=document.selection.createRange(); 
	    setTimeout("ProcessTab('" + el.id + "')",0);
  	}
}

function ProcessTab(id) {
	document.all[id].selection.text=String.fromCharCode(9);
	document.all[id].focus();
}

function ToggleHide(item){
	if(item.style.display == 'none'){
		item.style.display = '';
	}else{
		item.style.display = 'none';
	}
}

function window.onbeforeprint(){
	document.getElementById('main').width = '72%';
	TogglePrintElements(true);
}

function window.onafterprint(){
	document.getElementById('main').width = '750';
	TogglePrintElements(false);
}

function TogglePrintElements(a){
	try{
		for(i=0; i<document.all.length; i++){
			if(document.all[i].removeonprint == 'true'){
				if(a){
					document.all[i].style.display = 'none';
				}else{
					document.all[i].style.display = '';
				}
			}
			if(document.all[i].hideonprint == 'true'){
				if(a){
					document.all[i].style.visibility = 'hidden';
				}else{
					document.all[i].style.visibility = 'visible';
				}
			}
		}
	}catch(e){
	}
}

function Popup(target){
	//try{
	//	zzz.close();
	//}catch(e){}
	//var settings = "toolbar=no,width=<xsl:value-of select="page/data/popup/width"/>,height=<xsl:value-of select="page/data/popup/height"/>";
	//zzz = window.open("<xsl:value-of select="$fullapplicationpath" />/popup.html", 'link', settings);
	//zzz.document.onload = SetPopupLocation(target);
}

function SetPopupLocation(target){
	//var a = null;
	//while(a == null){
	//	try{
	//		a = zzz.document.getElementById('popup_body');
	//		a.src = '<xsl:value-of select="$fullapplicationpath" />/' + target;
	//	}catch(e){}
	//}
}