function deleteCookie( name, path, domain ) { // this deletes the cookie when called document.cookie = name + "=" + ( ( path ) ? ";path=" + path : "") + ( ( domain ) ? ";domain=" + domain : "" ) + ";expires=-1"; // ";expires=Thu, 01-Jan-1970 00:00:01 GMT"; } function Delete_Cookie( name, path, domain ) { if ( Get_Cookie( name ) ) document.cookie = name + "=" + ( ( path ) ? ";path=" + path : "") + ( ( domain ) ? ";domain=" + domain : "" ) + ";expires=Thu, 01-Jan-1970 00:00:01 GMT"; } function deleteAllCookies() { deleteCookie("SiteURL","/"); deleteCookie("News","/"); deleteCookie("Size","/"); deleteCookie("Drilldown","/"); deleteCookie("Extrametric","/"); deleteCookie("Extrametricvalue","/"); deleteCookie("Currency","/"); } function loadHTTPRequest() { var httpreq; if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari httpreq=new XMLHttpRequest(); } else { // code for IE6, IE5 httpreq=new ActiveXObject("Microsoft.XMLHTTP"); } return httpreq; } function newNum(divToChange,direction,type,normMin,normMax,numDigits,flip) { /*if (flip) { alert ("newNum - flip = true! flip = "+flip); } */ //alert("divToChange="+divToChange+" and direction="+direction+"and type="+type+"and normMin="+normMin+" and normMax="+normMax); var myhttp = loadHTTPRequest(); myhttp.onreadystatechange=function() { if (myhttp.readyState==4 && myhttp.status==200) { //alert(myhttp.responseText); document.getElementById(divToChange).innerHTML=myhttp.responseText; } } //alert("onreadystatechange set"); var newMin = normMin; var newMax = normMax; //alert("newMin/newMax set"); // valueDivName = divToChange+"Value"; if (direction == "higher") { newMin = document.getElementById(divToChange).innerHTML; //alert ("newMin = "+newMin); if (type == "percentWithButtons") { //substring to get the number only newMin = newMin.substring(0,newMin.indexOf("%")) //alert ("new newMin = "+newMin); } } else if (direction == "lower") { newMax = document.getElementById(divToChange).innerHTML; //alert ("newMax = "+newMax); if (type == "percentWithButtons") { //substring to get the number only newMax = newMax.substring(0,newMax.indexOf("%")) //alert ("new newMax = "+newMax); } } //alert ("opening now"); //alert ("flip is currently "+flip); //alert("newMin: "+newMin+"; newMax: "+newMax); //alert(' myhttp.open("GET","/includes/adjustments.php?min="+newMin+"&max="+newMax+"&type="+type+"&numDigits="+numDigits+"&flip="+flip'); myhttp.open("GET","/includes/adjustments.php?min="+newMin+"&max="+newMax+"&type="+type+"&numDigits="+numDigits+"&flip="+flip,true); //alert ("opened, sending now"); myhttp.send(); //alert ("done"); } function addArrowDiv (name) { arrowDivs.push(name); // alert("pushed "+name); } function showHideButtons (showhide) { //alert(pagename+" & "+showhide); if (showhide == "hide") { newclass = "adjustmentButtonsInvis"; document.getElementById("buttonHideLink").className="invisibleToolLink"; document.getElementById("buttonShowLink").className="toollink"; } else { newclass = "adjustmentButtonsVis"; document.getElementById("buttonShowLink").className="invisibleToolLink"; document.getElementById("buttonHideLink").className="toollink"; } for (var i = 0; i < arrowDivs.length; i++) { document.getElementById(arrowDivs[i]+"Buttons").className = newclass; } } function validateDrilldown() { var x=document.forms["drilldownForm"]["drilldown"].value; if (x==null || x=="") { alert("Please enter a Drilldown (page, campaign, keyword, site area, etc.)."); return false; } else { return true; } } function trackMailto() { var x = window.location.pathname; splitString = x.split("."); trackURL = splitString[0]+"/mailto/"; //alert(trackURL); _gaq.push(['_trackPageview', trackURL]); }