var prefix = parent.location.protocol + '//';
function SetCookie (name, value) {	var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (argc > 2) ? argv[2] : null; var path = (argc > 3) ? argv[3] : null; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : "");}
function getCookieVal (offset) {var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr));}
function GetCookie (name) {var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) {var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break;} return null;}
function fontsz(IncDecr){
	if(IncDecr=="INCREASE"){
	  if(Fsize < 14){Fsize=Fsize*1+1;cls="F"+Fsize;UpdateFonts(cls);SetCookie('fsize',Fsize,null,"/")}
	} else {
	  if(Fsize > 9){Fsize=Fsize*1-1;cls="F"+Fsize;UpdateFonts(cls);SetCookie('fsize',Fsize,null,"/")}
	}
}
function UpdateFonts(cls){
	GetObj('BODY').className=cls
	obj=GetObj('TableBorder1');if(obj){obj.className=cls}
	obj=GetObj('TableBorder2');if(obj){obj.className=cls}
	obj=GetObj('app')
	if(obj){obj.className=cls
		len=obj.elements.length
		for (x=0;x < len; x++){
			subobj=obj.elements[x]
			if (subobj) { //alert(obj.elements[x].name)
			   obj.elements[x].style.fontSize=Fsize
			}
		}
	}
	obj=GetObj('login')
	if(obj){obj.className=cls;
		len=obj.elements.length
		for (x=0;x < len; x++){
			subobj=obj.elements[x]
			if (subobj) { //alert(obj.elements[x].name)
			   obj.elements[x].style.fontSize=Fsize
			}
		}
	}
}
function Apps(ID){
	apps=['HouseholdApp','BusinessApp','CommunityApp']
	for (x=0; x<3; x++){
		if(ID!=apps[x]){ShowHide(apps[x],'hide')} //hide non-toggled forms
	}
	ShowHide(ID) //toggle form selected on/off
}
function ShowHide(ID,ShowHide){
	obj=GetObj(ID)
	//alert(ID + ":" + obj.className)
	if(obj){
		if(ShowHide){obj.className=ShowHide}
		else{
		  if (obj.className=="hide"){obj.className="show"}
		  else if (obj.className=="show"){obj.className="hide"}
		}
	}
}
function PrintObj(ID,FONT){
	var prtContent = GetObj(ID);
	var WinPrint = window.open('','','left=0,top=0,width=800,height=600,toolbar=0,scrollbars=0,status=0');
	WinPrint.document.write("<BODY class="+FONT+">" + prtContent.innerHTML);
	WinPrint.document.close();
	WinPrint.focus();
	WinPrint.print();
	WinPrint.close();
}
function checkEnter(e){ //e is event object passed from function invocation
	var characterCode // literal character code will be stored in this variable
	if(e && e.which){ //if which property of event object is supported (NN4)
		e = e; characterCode = e.which //character code is contained in NN4's which property
	}else{
		e = event; characterCode = e.keyCode //character code is contained in IE's keyCode property
	}
	if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
		document.forms[0].submit() //submit the form
		return false 
	}else{return true}
}
function Loc(url){document.location=url}

