/* void */ function logout() {
	if (confirm('You are about to log out. Click OK to confirm.')) { document.location.href='../logout.asp?validate=1' }
}

/* void */ function jumpMenu (oForm, sTarget) {
	url=oForm.options[document.nav.browse.selectedIndex].value
	if (sTarget=="Top") location.href=url;
	else parent.location.href=url;
}

/* object */ function getForm(frmName) {
	el = getFormInDocument(document, frmName);
	if (el != null) return el; 

	if (document.all == null)
		for (var i = 0; i < document.layers.length; i++) {
			el = getFormInDocument(document.layers[i].document, frmName);
			if (el != null) return el;
		}
	return null;
}

/* object */ function getFormInDocument(inDoc, frmName) {
	var elForm = null;
	with (inDoc) {
		elForm = forms[frmName];
		if (elForm != null) return elForm;

		for (var i = 0; i < forms.length; i++) {
			if (forms[i].name == frmName)
				return forms[i];
			}

		if (inDoc.all == null)
			for (var i = 0; i < inDoc.layers.length; i++) {
				el = getFormInDocument(inDoc.layers[i].document, frmName);
				if (el != null) return el;
				}
		}
		return null;
}

/* object */ function getElementInDocument(inDoc, elementName) {
	with (inDoc) {
		for (var i = 0; i < forms.length; i++) {
			if (forms[i].name == elementName) return forms[i];
			var el = getElementInForm(forms[i], elementName)
			if (el != null) return el;
			}
		}
	return null;
}

/* object */ function getElementInForm(inForm, elementName) {
	var el = null;
	with (inForm) {
		el = inForm.elementName;
		if (el != null) return el;
		for (var i = 0; i < elements.length; i++)
			if (elements[i].name == elementName)
				return elements[i];
		}
	return null;
}

/* object */ function getImageInDoc(inDoc, elementName) {
	with (inDoc)
		for (var i = 0; i < images.length; i++)
			if (images[i].name == elementName) return images[i];
	return null;
}

/* object */ function getImage(elementname) {
	var el = getImageInDoc(document, elementname);
	if (el != null) return el;
	
	if (document.all == null)
		for (var i = 0; i < document.layers.length; i++) {
			el = getImageInDoc(document.layers[i].document, elementname);
			if (el != null) return el;
		}

	return null;
}

/* void */ function focus(form_name, element_name) {
	var el = getElementInForm(getForm(form_name), element_name);
	el.focus();
}

/* void */ function openWindow(theURL, Width, Height) {
	window.open(theURL, "popup", "status=yes,scrollbars=yes,width=" + Width + ",height=" + Height);
}

/* void */ function showHideLayers() { //v3.0
	var i,p,v,obj,args=showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=findObj(args[i]))!=null) { v=args[i+2];
	if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
	obj.visibility=v; }
}

/* void */ function swapImgRestore() { //v3.0
	var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

/* void */ function preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.p) d.p=new Array();
	var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

/* object */ function findObj(n, d) { //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

/* void */ function swapImage() { //v3.0
	var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var showTime;

/* void */ function show(oDiv) {
	clearTimeout(showTime);
	var elm = eval("document.all." + oDiv);
	elm.style.visibility="visible";
}

/* void */ function hide(oDiv) {
	showTime = setTimeout(oDiv + '.style.visibility="hidden"',600);
}

/* void */ function clearField(oElement, sText1, sText2) {
if (oElement.value == sText1 || oElement.value == sText2)
	oElement.value = "";
}

/* void */ function switchLanguage(iOtherLanguageID) {
	var sURL = document.location.href;
	if (sURL.indexOf("&Language=") != -1) {
		sURL = sURL.substring(0,sURL.indexOf("&Language=")) + sURL.substring(sURL.indexOf("&Language=")+13,sURL.length);
	}
	else if (sURL.indexOf("Language=") != -1) {
		sURL = sURL.substring(0,sURL.indexOf("Language=")) + sURL.substring(sURL.indexOf("Language=")+12,sURL.length);
	}
	sURL += (sURL.indexOf("?") == -1 ? "?" : (sURL.indexOf("=") == -1 ? "" : "&amp;") ) + "Language=" + iOtherLanguageID;
	document.location.href = sURL;
}

function SignIn(open_window) {
	window.open(open_window, 'signin_window', 'width=190,height=230,scrollbars=yes,status=yes');
}

window.name = "yppii_main_window";