function $(a){return document.getElementById(a)}function trim(a){return a.replace(/^\s+|\s+$/g,"")}function isIE(){return isInternetExplorer()}function isInternetExplorer(){var a=navigator.userAgent.toLowerCase();return(a.indexOf("msie")!=-1)}function isMozilla(){var a=navigator.userAgent.toLowerCase();return(!isInternetExplorer()&&a.indexOf("mozilla")!=-1&&a.indexOf("rv:")!=-1)}function showElement(a){document.getElementById(a).style.display="block"}function hideElement(a){document.getElementById(a).style.display="none"}function getTop(a,b){var c=0;if(a!=null){if(b&&a.offsetParent!=null){c+=getTop(a.offsetParent,b,true)}c+=a.offsetTop}return c}function getLeft(a,b){var c=0;if(a!=null){if(b&&a.offsetParent!=null){c+=getLeft(a.offsetParent,b,true)}c+=a.offsetLeft}return c}function getWidth(a){return a.offsetWidth}function getHeight(a){return a.scrollHeight}function findStyleSheetRule(className,styleName){try{className=className.toLowerCase();for(var i=0;i<document.styleSheets.length;i++){var stylesheet=document.styleSheets[i];var rules=isInternetExplorer()?stylesheet.rules:stylesheet.cssRules;for(var j=0;j<rules.length;j++){var rule=rules[j];if(rule.selectorText.toLowerCase()==className){alert(eval("rule.style."+styleName));return eval("rule.style."+styleName)}}}}catch(e){alert("findStyleSheetRule: "+e.message)}alert("returning null");return null}function doSubmit(b){if(b!=null){for(var a=0;a<b.elements.length;a++){if(b.elements[a].type=="submit"){b.elements[a].disabled=true}}b.submit()}return true}function findParentNodeOfType(b,a){if(b!=null){if(b.tagName!=null&&b.tagName==a){return b}else{return findParentNodeOfType(b.parentNode,a)}}return null}function findChildNodeOfType(a,d){var c=null;if(a!=null){if(a.tagName!=null&&a.tagName==d){c=a}else{var b;for(b=0;b<a.childNodes.length;b++){c=findChildNodeOfType(a.childNodes[b],d);if(c!=null){break}}}}return c}function toggleRowSelection(a){var b=findParentNodeOfType(a,"TR");if(a.checked){b.__className=b.className;b.className="selectedRow selected"}else{b.className=b.__className}}function toggleAllRowsSelection(d){var e=findParentNodeOfType(d,"TABLE");var c;for(c=0;c<e.rows.length;c++){var g=e.rows[c];var f=(g.style.display!="none");if(f&&(g.className==null||(g.className.toLowerCase().indexOf("header")==-1&&g.className.toLowerCase().indexOf("footer")==-1))){var b=false;var a=findChildNodeOfType(g,"INPUT");if(a.id==null||a.id!=d.id){b=a.checked;a.checked=d.checked}if(d.checked){if(!b){g.__className=g.className;g.className="selectedRow selected"}}else{g.className=g.__className}}}}function initRowSelection(){var d=document.getElementsByTagName("TABLE");for(var c=0;c<d.length;c++){var e=d[c];for(var b=0;b<e.rows.length;b++){var f=e.rows[b];if(f.className==null||(f.className.toLowerCase().indexOf("header")==-1&&f.className.toLowerCase().indexOf("footer")==-1)){var a=findChildNodeOfType(f,"INPUT");toggleRowSelection(a)}else{if(f.className!=null&&f.className.toLowerCase().indexOf("header")!=-1){var a=findChildNodeOfType(f,"INPUT");if(a!=null&&a.checked){a.checked=false;toggleAllRowsSelection(a)}}}}}}function countSelectedRows(c){var e=0;var d=null;if(c.tagName!=null&&c.tagName=="TABLE"){d=c}else{d=findParentNodeOfType(c,"TABLE")}for(var b=0;b<d.rows.length;b++){var f=d.rows[b];if(f.className==null||(f.className.toLowerCase().indexOf("header")==-1&&f.className.toLowerCase().indexOf("footer")==-1)){var a=findChildNodeOfType(f,"INPUT");if(a!=null&&a.checked){e++}}}return e}function addEvent(d,c,e,b){if(d.addEventListener){d.addEventListener(c,e,b);return true}else{if(d.attachEvent){var a=d.attachEvent("on"+c,e);return a}else{alert("Handler could not be added");return null}}}function removeEvent(d,c,e,b){if(d.addEventListener){d.removeEventListener(c,e,b);return true}else{if(d.attachEvent){var a=d.detachEvent("on"+c,e);return a}else{alert("Handler could not be removed");return null}}}var modalPopupFeatures=isInternetExplorer()?"dialogWidth:##WIDTH##px;dialogHeight:##HEIGHT##px;center:yes;resizable:yes":"resizable=yes,scrollbars=yes,width=##WIDTH##,height=##HEIGHT##,top=##TOP##,left=##LEFT##,dependent=yes,modal=yes,dialog=yes";var modlessPopupFeatures=isInternetExplorer()?"resizable=yes,scrollbars=yes,width=##WIDTH##,height=##HEIGHT##,top=##TOP##,left=##LEFT##":"resizable=yes,scrollbars=yes,width=##WIDTH##,height=##HEIGHT##,top=##TOP##,left=##LEFT##";var widthPattern=/##WIDTH##/gi;var heightPattern=/##HEIGHT##/gi;var leftPattern=/##LEFT##/gi;var topPattern=/##TOP##/gi;var locatorPopup=null;function openLocatorPopup(a,g,b,n,m){var k=100;var e=100;if(!m||!isInternetExplorer()){var l=b+32;var f=n+96;var k=(screen.width-l)/2;var e=(screen.height-f)/2}var d=(m?modalPopupFeatures:modlessPopupFeatures).replace(widthPattern,b).replace(heightPattern,n).replace(leftPattern,k).replace(topPattern,e);if(g!=null){var j=document.getElementById(g);a=appendParameter(a,j.name,j.value)}if(isInternetExplorer()&&m){var c=window.showModalDialog(a,null,d);if(c!=null&&c.length==2){updateField(g,c[0],c[1])}}else{locatorPopup=window.open(a,"locatorPopup",d);locatorPopup.fieldId=g;locatorPopup.onunload=updateFieldAsynchronously}return false}function appendParameter(b,a,c){var d=new String(b);if(d.indexOf("?")==-1){d+="?"}else{if(d.indexOf("&")!=d.length-1){d+="&"}}d+=(a+"="+(c!=null?c:""));return d}function getQueryString(){return window.location.search.substring(1)}function parseQueryString(f){var b=[];if(!f){f=getQueryString()}if(f!=null&&f.length>0){var d=f.split("&");for(var c=0;c<d.length;c++){var e=d[c];if(e!=null&&e.length>0){var a=e.split("=");if(a.length==1){a.push("")}else{a[1]=unescape(a[1]).replace(/\+/g," ")}a[0]=unescape(a[0]).replace(/\+/g," ");b.push(a)}}}return b}function getParameterValues(g,c){var b=[];if(g!=null&&g.length>0){var e=g.split("&");for(var d=0;d<e.length;d++){var f=e[d];if(f!=null&&f.length>0){f=unescape(f);var a=f.split("=");if(a[0]==c){if(a.length>1){b.push(unescape(a[1]).replace(/\+/g," "))}else{b.push("")}}}}}return b}function updateFieldAsynchronously(){if(locatorPopup!=null&&locatorPopup.fieldId!=null&&locatorPopup.returnValue!=null){updateField(locatorPopup.fieldId,locatorPopup.returnValue[0],locatorPopup.returnValue[1])}}function updateField(a,c,b){if(a!=null){if(c==null||c=="undefined"){c=""}if(b==null||b=="undefined"){b=""}document.getElementById(a).value=c;document.getElementById(a+".display").value=b}}function __createPopUpContainer(){var d=document.createElement("DIV");d.id="__popUpContainer";d.className="popUpContainer";d.style.width=findStyleSheetRule(".popUpContainer","width");d.style.height=findStyleSheetRule(".popUpContainer","height");var b=document.createElement("DIV");b.id="__popUpBody";b.className="popUpBody";var c=document.createElement("DIV");c.id="__popUpTitle";c.className="popUpTitle";var a=document.createElement("DIV");a.id="__popUpContent";a.className="popUpContent";b.appendChild(c);b.appendChild(a);d.appendChild(b);document.body.appendChild(d)}function setPopUpContent(b){var a=document.getElementById("__popUpContent");if(a==null){__createPopUpContainer();a=document.getElementById("__popUpContent")}a.innerHTML=b}function positionElementByTrigger(e,c){var d=2;var a=-52;var f=Element.getDimensions(c);e.style.left="-1000px";e.style.top="-1000px";e.style.display="block";var k=Position.cumulativeOffset(c)[0];var j=k+f.width+d;var h=Position.cumulativeOffset(c)[1];var g=h+c.offsetHeight+a;Position.prepare();var b=Element.getDimensions(e);if(j+b.width+d>(Position.deltaX+Position.visibleWidth)){j=Math.max(d,((Position.deltaX+Position.visibleWidth)-b.width-d))}if(g+b.height+a>(Position.deltaY+Position.visibleHeight)){g=h-b.height-a}e.style.left=j+"px";e.style.top=g+"px"}function showPopUp(b,c){if(c){setPopUpContent(c)}var a=document.getElementById("__popUpContainer");if(a==null){__createPopUpContainer();a=document.getElementById("__popUpContainer")}positionElementByTrigger(a,b)}function hidePopUp(b){var a=document.getElementById("__popUpContainer");if(a!=null){a.style.display="none"}}function __noop(){return false}function disableSubmit(){var a=getSubmit();if(a==null){a=document.getElementById("submitButton")}if(a!=null){addEvent(a,"click",__noop,true);if(a.value){a.__value=a.value;a.value="Please wait ..."}a.disabled=true;var b=document.getElementById("loadingImage");if(b!=null){b.style.display="block"}setTimeout("enableSubmit()",15000)}return true}function enableSubmit(){var a=getSubmit();if(a==null){a=document.getElementById("submitButton")}if(a!=null){a.disabled=false;if(a.__value){a.value=a.__value}removeEvent(a,"click",__noop,true);var b=document.getElementById("loadingImage");if(b!=null){b.style.display="none"}}}function setSubmit(a){document.__submitElement=a}function getSubmit(){return document.__submitElement}function getFormFieldValue(b,e){var c=null;var d=b.elements[e];if(d){if(d.type==null||d.type=="radio"){for(var a=0;a<d.length;a++){if(d[a].checked){c=d[a].value;break}}}else{switch(d.type){case"select-one":if(d.selectedIndex!=-1){c=d.options[d.selectedIndex].value}break;case"checkbox":if(d.checked){c=d.value}break;case"select-multiple":break;case"text":case"textarea":case"hidden":case"password":c=d.value;break;default:}}}return(c!=null?c:"")}function setFormFieldValue(c,g,e){var d=null;var f=c.elements[g];if(f){if(f.type==null||f.type=="radio"){for(var b=0;b<f.length;b++){if(f[b].value==e){f[b].checked=true;break}}}else{switch(f.type){case"select-one":for(var b=0;b<f.options.length;b++){if(f.options[b].value==e){f.options[b].selected=true;break}}break;case"checkbox":if(f.value==e){f.checked=true}else{f.checked=false}break;case"select-multiple":if(typeof(e)=="string"){e=[e]}for(var b=0;b<f.options.length;b++){for(var a=0;a<e.length;a++){if(f.options[b].value==e[a]){f.options[b].selected=true}}}break;case"text":case"textarea":case"hidden":case"password":f.value=e;break;default:}}}}function getCookieVal(b){var a=document.cookie.indexOf(";",b);if(a==-1){a=document.cookie.length}return unescape(document.cookie.substring(b,a))}function GetCookie(d){var b=d+"=";var f=b.length;var a=document.cookie.length;var e=0;while(e<a){var c=e+f;if(document.cookie.substring(e,c)==b){return getCookieVal(c)}e=document.cookie.indexOf(" ",e)+1;if(e==0){break}}return null}function SetCookie(c,e){var a=SetCookie.arguments;var h=SetCookie.arguments.length;var b=(2<h)?a[2]:null;var g=(3<h)?a[3]:null;var d=(4<h)?a[4]:null;var f=(5<h)?a[5]:false;document.cookie=c+"="+escape(e)+((b==null)?"":("; expires="+b.toGMTString()))+((g==null)?"":("; path="+g))+((d==null)?"":("; domain="+d))+((f==true)?"; secure":"")}var changePageUrl;var editPageSizeUrl;var applySortUrl;var toggleSortUrl;var removeSelectedRowsUrl;var payoutOverrideSelectedRowsUrl;var listPublishersSelectedRowsUrl;function changePage(a){document.location=changePageUrl+a}function editPageSize(a){document.location=editPageSizeUrl+a}function applySort(a){document.location=applySortUrl+a}function toggleSort(a){document.location=toggleSortUrl+a}function removeSelectedRows(c,b,f){var a=countSelectedRows(document.getElementById(b));if(a==0){alert("Please select at least one row to remove.")}else{var e=f&&confirm("Are you sure you want to remove the "+a+" selected row(s)?");if(e){var d=document.forms[c];d.action=removeSelectedRowsUrl;d.submit()}}}function moveOptionsRight(c,e){var b=$(c);var d=$(e);var a=null;for(i=0;i<b.length;i++){a=b.options[i];if(a.selected){d.options[d.length]=new Option(a.text,a.value);b.options[i]=null;i--}}}function moveOptionsLeft(c,e){var b=$(c);var d=$(e);var a;for(i=0;i<d.length;i++){a=d.options[i];if(a.selected){b.options[b.length]=new Option(a.text,a.value);d.options[i]=null;i--}}}function payoutOverrideSelectedRows(d,c,b){var a=countSelectedRows(document.getElementById(c));if(a==0){alert("Please select at least one row.")}else{var f=b&&confirm("Are you sure you want to override the payout on the "+a+" selected row(s)?");if(f){var e=document.forms[d];e.action=payoutOverrideSelectedRowsUrl;e.submit()}}}function listPublishersSelectedRows(d,c,b){var a=countSelectedRows(document.getElementById(c));if(a==0){alert("Please select at least one row.")}else{var f=b;if(f){var e=document.forms[d];e.action=listPublishersSelectedRowsUrl;e.submit()}}}function autotab(b,a){if(b.getAttribute&&b.value.length==b.getAttribute("maxlength")){a.focus()}}function isValid3PartPhone(b,c){var a=""+b.elements[c+"Part1"].value+b.elements[c+"Part2"].value+b.elements[c+"Part3"].value;return a.match(/[0-9]{10}/)}if(typeof XMLHttpRequest=="undefined"){XMLHttpRequest=function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(a){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){}return null}}function swapOptions(d,e,f){f.options.length=0;var b=e.selectedIndex!=-1?e.options[e.selectedIndex].value:null;if(b!=null&&b.length>0){f.options[0]=new Option("-- select one --","");var h=d[b];for(var a=0;a<h.length;a++){var g=h[a];var c=g.length>=3?g[2]:false;f.options[f.options.length]=new Option(g[1],g[0],false,c)}f.options[0].disabled=false}else{f.options[0]=new Option("-- select one --","");f.options[0].disabled=true}}function createOption(c,a,e,d){var b=document.createElement("OPTION");b.setAttribute("value",c);if(e){b.setAttribute("selected","true")}var f=document.createTextNode(a);b.appendChild(f);d.appendChild(b)};
