



function _f(s) {
var j, re
for (j = 1; j < arguments.length; j++) {
re = new RegExp("%"+j,"g")
s = s.replace(re,arguments[j].toString())
}
return s
}
function OnSubmitHook (f) {
if (!f) f = document.forms[0]
var allow = true
for(var j=0; j<f.elements.length; j++) {
var e = f.elements[j]
if (e.submitHook) {
 var res = e.submitHook()
allow = allow && res
}
if (e.submitEvalHook) {
var res = eval(e.submitEvalHook)
allow = allow && res
}
}
return allow
}
function createXMLDoc () {
try {
return new ActiveXObject("Microsoft.XMLDOM")
} catch (e) {}
try {
return document.implementation.createDocument("", "", null);
} catch (e) { }
return undefined
}
String.prototype.trim = function () {
var i,j
for(i=0; i<this.length; i++) if (this.charAt(i) != ' ') break
for(j=this.length-1; j>i; j--) if (this.charAt(j) != ' ') break
if (i != 0 || j != this.length) return this.substr(i,j-i+1)
return this
}
function Select_addUnique (o) {
var j
for(j=0; j<this.options.length; j++) {
if (this.options[j].value == o.value && this.options[j].text == o.text) {
this.selectedIndex = j
return
}
}
j = this.options.length
this.options [j] = o
this.selectedIndex = j
}
function Select_removeSelected() {
var idx = this.selectedIndex
var j = 0
while (j < this.options.length) {
if (this.options[j].selected) {
this.remove(j)
continue
}
j += 1
}
this.selectedIndex = Math.min(idx,this.options.length-1)
}
function Select_ondrop () {
var v = window.event.dataTransfer.getData("Text")
var a = v.split(',')
for(var j in a) {
var o = new Option()
o.text = o.value = a[j].trim()
if (this.addUnique) {
this.addUnique(o)
} else if (this.ab.list.addUnique) {
this.ab.list.addUnique(o)
}
}
window.event.returnValue = false
}
function pickDate(a) {
var w = window.open("../pickers/date_picker.html?a="+a,"pick"+a,"height=155,width=175")
w.focus()
}
function submitForm (mods) {
var fk = "__f"
var f = document.forms[mods[fk]?mods[fk]:0]
for(var k in mods) {
if (k == "action") {
f.action = mods[k]
} if (k != fk) {
f[k].value = mods[k]
}
}
if (OnSubmitHook(f)) f.submit()
}
function toggle(id) {
var e = document.getElementById(id)
if (e.isShown == undefined) {
e.isShown = (e.style.display != "none")
}
e.style.display = e.isShown ? "none" : ""
e.isShown = !e.isShown
}
function hide(id) {
var e = document.getElementById(id)
if (e == undefined) return
e.style.display = "none"
e.isShown = false
}
function show(id) {
var e = document.getElementById(id)
if (e==undefined) return
e.style.display = ""
e.isShown = true
}
var printWin = "";
function cpLogger(cp,url,winArgs) { var h="/" + rootCTX + "/shared/cpl.ev?cp=" + cp + "/"+escape(url);
if (url.indexOf("aol://")!=-1) {
 window.frames['clickpath'].location.href=h;  location.href=url; } else {
if ( winArgs == "default" ) {
 window.open(h);
} else if ( winArgs != null ) {
 window.open(h,"",winArgs);
} else {
 location.href=(h);
}
}
}var genWin="";
var g_URL="";
function openWin(URL,cp){
if (!cp||cp=="") var cp="xx";
 if (typeof(genWin)=="object") if (!genWin.closed) genWin.close();
if (URL.indexOf("http://")==0){  if (cp!="xx") {g_URL="/ar/shared/logger.ev?cp="+cp+"/"+escape(URL);setTimeout("theWin()",10);}
else {
g_URL=URL;
setTimeout("theWin()",10);
}  }
else {  if (cp!="xx") {
if (URL.indexOf("?")!=-1) {g_URL=URL+"&cp="+cp;setTimeout("theWin()",10);}
else {g_URL=URL+"?cp="+cp;setTimeout("theWin()",10);}
}
else {g_URL=URL;setTimeout("theWin()",10);} }
}
function theWin(){
genWin=window.open(g_URL,"genWin");
}
function h(thLink){ alert(thLink); return ; top.location.href=thLink; }
function quote (s) {
quoteWin=window.open('/s/stocks/quote_frameset.psp?symbol='+s,'quoteWin','width=450,height=250')
quoteWin.focus()
}
function trim(data){
if(data!=null)return data.replace(/^\s*/,"").replace(/\s*$/,"");
return "";
}
function regDevice(ph1,ph2,ph3){
var f = document.forms[0];
if ("1" == "0") {
window.open('../devices/cell.ev?_w=wiz.clear&ph1='+ph1.value+'&ph2='+ph2.value+'&ph3='+ph3.value,'register','width=475,height=450')
} else if ("0" == "1") {
window.open('../shared/noaction.vm','noaction','width=475,height=450')
} else {
 var deviceRegWin = window.open('','register','width=475,height=450');
var html = "<html><head></head><body><form id='formid' method='post' action='http://aolmobile.aol.com/portal/anrconfirm.do'>";
html += "<input type='hidden' name='popup' value='n'/>";
   html += "</form><script type='text/javascript'>document.getElementById('formid').submit()<";
html += "/script></body></html>";
deviceRegWin.document.write(html);
}
}
function cpLogger(cp,url,winArgs) { var h="/" + rootCTX + "/shared/cpl.ev?cp=" + cp + "/"+escape(url);
if (url.indexOf("aol://")!=-1) {
 window.frames['clickpath'].location.href=h;  location.href=url; } else {
if ( winArgs == "default" ) {
 window.open(h);
} else if ( winArgs != null ) {
 window.open(h,"",winArgs);
} else {
 location.href=(h);
}
}
}
function hideSelect(currentElement,what){
if (!what){
currentElement = document.childNodes[0];
what = "hidden";
};
if (currentElement.tagName == "SELECT"){
currentElement.style.visibility = what;
};
for (var i=0; i < currentElement.childNodes.length; i++ ) {
hideSelect(currentElement.childNodes[i],what);
};
};
function dhtmlWindow(left,top,width,height){
var clientHeight = document.body.clientHeight;
var clientWidth = document.body.clientWidth;
var widthDiff = clientWidth - width;
var heightDiff = clientHeight - height;
if ( left == "" ){
left = 0;
if ( widthDiff > 0 ){
left = widthDiff-10;
if (widthDiff > 110 ) left = 100;
}
}
if ( top == "" ){
top = 0;
if ( heightDiff > 0 ){
top = heightDiff-30;
if (heightDiff > 130 ) top = 100;
}
}
var docFrag = document.createDocumentFragment();
var bodyTag = document.getElementsByTagName("BODY")[0];
var outerDiv = document.createElement('DIV');
outerDiv.className = "window";
outerDiv.style.width = width+6;
outerDiv.style.height = height + 20;
outerDiv.style.left = left;
outerDiv.style.top = top;
var innerDiv = document.createElement('DIV');
innerDiv.className = "titleBar";
var chrome = document.createElement('DIV');
chrome.className = "titleBarText";
chrome.innerHTML="&nbsp;";
var theIframe = document.createElement('IFRAME');
theIframe.className = "clientArea";
theIframe.style.width = width;
theIframe.style.height = height - 5;
innerDiv.appendChild(chrome);
outerDiv.appendChild(innerDiv);
outerDiv.appendChild(theIframe);
docFrag.appendChild(outerDiv);
bodyTag.insertBefore(docFrag,bodyTag.firstChild);
 this.src = src;
this.titleBarText = titleBarText;
this.show = show;
this.hide = hide;
 function titleBarText(titleBarText){
if (titleBarText!=""){innerDiv.innerHTML = titleBarText;}
else {innerDiv.innerHTML = "&nbsp;";}
}
hideSelect();  document.getElementsByTagName("body").item(0).onload = hideSelect;  function src(url){theIframe.src = url;}
function show(){hideSelect(document.childNodes[0],'hidden'); outerDiv.style.visibility = "visible";}
function hide(){hideSelect(document.childNodes[0],'visible'); outerDiv.style.visibility = "hidden";}
function close(){hideSelect(document.childNodes[0],'visible'); outerDiv.style.display = "none";}
}
var pAttributes;
function handleClicks(e){
pAttributes = new pageAttributes(e);
try{handleClicksLocal();}
catch(e){;}
}
function pageAttributes(e){
var posx;
var posy;
var target;
if (!e) var e = window.event
if (!e) var e = window.event;
if (e.pageX || e.pageY){
posx = e.pageX;
posy = e.pageY;
} else if (e.clientX || e.clientY) {
posx = e.clientX + document.body.scrollLeft;
posy = e.clientY + document.body.scrollTop;
}
if (e.target) target = e.target;
else if (e.srcElement) target = e.srcElement;
if (target.nodeType == 3)  target = target.parentNode;
this.getPosX = getPosX;
this.getPosY = getPosY;
this.getTarget = getTarget;
this.cancelBubble = cancelBubble;
function getPosX(){
return posx;
}
function getPosY(){
return posy;
}
function getTarget(){
return target;
}
function cancelBubble(){
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
}
}
