var gPopupMask=null;
var gPopupContainer=null;
var gPopFrame=null;
var gReturnFunc;
var gPopupIsShown=false;
var gHideSelects=false;
var gPrefix="";
var gTabIndexes=new Array();
var gTabbableTags=new Array("A","BUTTON","TEXTAREA","INPUT","IFRAME");
if(!document.all){document.onkeypress=keyDownHandler
}function initPopUp(b){if(b!=undefined){gPrefix=b
}else{gPrefix=""
}gPopupMask=document.getElementById(addPrefixToName("popupMask"));
gPopupContainer=document.getElementById(addPrefixToName("popupContainer"));
if(gPrefix==""){iframes=document.getElementsByName("popupFrame");
gPopFrame=iframes[iframes.length-1]
}else{gPopFrame=document.getElementById(addPrefixToName("popupFrame"))
}var a=parseInt(window.navigator.appVersion.charAt(0),10);
if(a<=6&&window.navigator.userAgent.indexOf("MSIE")>-1){gHideSelects=true
}else{gHideSelects=false
}}function showPopWin(b,f,a,c,e,g,h){YourBillBuddyPage._stopTimer();
initPopUp(h);
gPopupIsShown=true;
disableTabIndexes();
gPopupContainer.style.display="block";
centerPopWin(f,a);
var d=parseInt(document.getElementById(addPrefixToName("popupTitleBar")).offsetHeight,10);
gPopupContainer.style.width=f+"px";
gPopupContainer.style.height=(a+d)+"px";
gPopFrame.style.width=parseInt(document.getElementById(addPrefixToName("popupTitleBar")).offsetWidth,10)+"px";
gPopFrame.style.height=(a)+"px";
gPopFrame.src=b;
gReturnFunc=c;
if(gHideSelects==true){hideSelectBoxes()
}gPopupMask.style.display="block";
gPopupMask.style.height=e;
gPopupMask.style.width=g;
gPopupMask.style.top="0px";
gPopupMask.style.left="0px";
document.body.scrollTop=0
}function showPopWin1(b,f,a,c,e,g,h){YourBillBuddyPage._stopTimer();
initPopUp(h);
gPopupIsShown=true;
disableTabIndexes();
gPopupContainer.style.display="block";
centerPopWin(f,a);
var d=parseInt(document.getElementById(addPrefixToName("popupTitleBar")).offsetHeight,10);
gPopupContainer.style.width=f+"px";
gPopupContainer.style.height=(a+d)+"px";
gPopFrame.style.width=parseInt(document.getElementById(addPrefixToName("popupTitleBar")).offsetWidth,10)+"px";
gPopFrame.style.height="370px";
alert(b);
gPopFrame.src=b;
$("iframe#popupFrame").attr("src",b);
gPopFrame.add(0);
gReturnFunc=c;
if(gHideSelects==true){hideSelectBoxes()
}gPopupMask.style.display="block";
gPopupMask.style.height=e;
gPopupMask.style.width=g;
gPopupMask.style.top="0px";
gPopupMask.style.left="0px";
document.body.scrollTop=0
}function showPopWinstatic(b,f,a,c,e,g,h){YourBillBuddyPage._stopTimer();
initPopUp(h);
gPopupIsShown=true;
disableTabIndexes();
gPopupContainer.style.display="block";
centerPopWin(f,a);
var d=parseInt(document.getElementById(addPrefixToName("popupTitleBar")).offsetHeight,10);
gPopupContainer.style.width="438px";
gPopupContainer.style.height="375px";
gPopFrame.style.width="436px";
gPopFrame.style.height="337px";
gPopFrame.src=b;
gReturnFunc=c;
if(gHideSelects==true){hideSelectBoxes()
}gPopupMask.style.display="block";
gPopupMask.style.height=e;
gPopupMask.style.width=g;
gPopupMask.style.top="0px";
gPopupMask.style.left="0px";
document.body.scrollTop=0
}var gi=0;
function centerPopWin(g,a){if(gPopupIsShown==true){if(g==null||isNaN(g)){g=gPopupContainer.offsetWidth
}if(a==null){a=gPopupContainer.offsetHeight
}var d=getViewportHeight();
var h=getViewportWidth();
var e=document.documentElement;
var b=parseInt(e.scrollTop,10);
var c=parseInt(e.scrollLeft,10);
window.status=gPopupMask.style.top+" "+gPopupMask.style.left+" "+gi++;
var f=parseInt(document.getElementById(addPrefixToName("popupTitleBar")).offsetHeight,10);
gPopupContainer.style.top=(b+((d-(a+f))/2))+"px";
gPopupContainer.style.left=(c+((h-g)/2))+"px"
}}function hidePopWin(a){if("StaticPageloginbody"==a){YourBillBuddyPage._startTimerstatic()
}else{YourBillBuddyPage._callTimer()
}gPopupIsShown=false;
restoreTabIndexes();
if(gPopupMask==null){return
}gPopupMask.style.display="none";
gPopupContainer.style.display="none";
if(a==true&&gReturnFunc!=null){gReturnFunc(window.frames[addPrefixToName("popupFrame")].returnVal)
}if(gHideSelects==true){displaySelectBoxes()
}}function setPopTitle(){if(window.frames[addPrefixToName("popupFrame")].document.title==null){window.setTimeout("setPopTitle();",10)
}else{document.getElementById(addPrefixToName("popupTitle")).innerHTML=window.frames[addPrefixToName("popupFrame")].document.title
}}function keyDownHandler(a){if(gPopupIsShown&&a.keyCode==9){return false
}}function disableTabIndexes(){if(document.all){var c=0;
for(var b=0;
b<gTabbableTags.length;
b++){var d=document.getElementsByTagName(gTabbableTags[b]);
for(var a=0;
a<d.length;
a++){gTabIndexes[c]=d[a].tabIndex;
d[a].tabIndex="-1";
c++
}}}}function restoreTabIndexes(){if(document.all){var c=0;
for(var b=0;
b<gTabbableTags.length;
b++){var d=document.getElementsByTagName(gTabbableTags[b]);
for(var a=0;
a<d.length;
a++){d[a].tabIndex=gTabIndexes[c];
d[a].tabEnabled=true;
c++
}}}}function changeMousePointerAndLinkImage(h){try{document.body.style.cursor="wait"
}catch(f){var g=document.layers?document.cursor:document.all?document.all.cursor:document.getElementById?document.getElementById("cursor"):null;
g="wait"
}for(var d=0;
d<h.length;
d++){var b=document.getElementById(h[d][0]);
var a=document.getElementById(h[d][1]);
b.removeChild(a);
var c=document.createElement("div");
c.innerHTML=h[d][2];
b.appendChild(c)
}}function hideSelectBoxes(){for(var a=0;
a<document.forms.length;
a++){for(var b=0;
b<document.forms[a].length;
b++){if(document.forms[a].elements[b].tagName=="SELECT"){document.forms[a].elements[b].style.visibility="hidden"
}}}}function displaySelectBoxes(){for(var a=0;
a<document.forms.length;
a++){for(var b=0;
b<document.forms[a].length;
b++){if(document.forms[a].elements[b].tagName=="SELECT"){document.forms[a].elements[b].style.visibility="visible"
}}}}function addPrefixToName(a){return gPrefix+a
};