var gAutoPrint = true; // Tells whether to automatically call the print function function printSpecial() { if (document.getElementById != null) { var html = '\n\n'; if (document.getElementsByTagName != null) { var headTags = document.getElementsByTagName("head"); if (headTags.length > 0) html += headTags[0].innerHTML; } html += '\n\n\n'; var printReadyElem = document.getElementById("printReady"); if (printReadyElem != null) { html += printReadyElem.innerHTML; } else { alert("Could not find the printReady function"); return; } html += '\n\n'; var printWin = window.open("","printSpecial"); printWin.document.open(); printWin.document.write(html); printWin.document.close(); if (gAutoPrint) { printWin.print(); printWin.close(); } } } function GetXmlHttp(){var x=null;try{x=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{x=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){x=null}}if(!x&&typeof XMLHttpRequest!="undefined"){x=new XMLHttpRequest()}return x;} function $Q(name, tmpURL) { var regexS = "[\\?&]" + name + "=([^&#]*)"; var regex = new RegExp(regexS); var results = regex.exec(tmpURL); if (results == null) return ""; else return results[1]; } function RedirectToSite(url) { var date = new Date() var ticks = date.getTime() coupunID = $Q("CouponId", url); var xmlhttp = GetXmlHttp(); xmlhttp.open("GET", "http://www.poncou.com/GetRedirectURL.aspx?CouponId=" + coupunID + "&Time" + ticks, false); xmlhttp.send(null); if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { if (xmlhttp.responseText != "") window.open(xmlhttp.responseText); } } function PrintAll(url) { frames["PrintFrame"].location.href = url; setTimeout("printFrame()",1000); RedirectToSite(url); // var frm; // frm=document.getElementById("PrintFrame"); // //frm.src=url; // //frm.style.dispaly=''; // frm.focus(); // // frm.reload(); // frm.print(); //var printWin = window.open(url,"PrintText","left=0,top=0,height=500,width=380,status=yes,toolbar=no,menubar=no,location=no"); ////printWin.document.open(); ////printWin.document.close(); //printWin.print(); } function printFrame() { //alert(frames["PrintFrame"].location.href); frames["PrintFrame"].focus(); frames["PrintFrame"].print(); } function showCoupon(url) { var params = 'width='+screen.width; params += ', height='+screen.height; params += ', top=0, left=0' params += ', fullscreen=no'; newwin=window.open(url,'coupon_win', params); if (window.focus) {newwin.focus()} } var LastDivID LastDivID='' function ShowHideDiv(div) { //alert(div) var e; e=document.getElementById(div); //alert(e); if(e.style.display=='') e.style.display='none'; else e.style.display=''; if(LastDivID=='') { LastDivID=div } else { if(LastDivID!=div) document.getElementById(LastDivID).style.display='none'; LastDivID=div } } function ShowBigGalleryImage(newImageSrc,dest) { var BigImage=document.getElementById(dest); BigImage.src=newImageSrc; } function ShowMap(latitude,longitude,address,pageName,cityName){ var left = (screen.width/2)-(830/2)-20; var top = (screen.height/2)-(350/2)+20; features = 'width=830,height=350,left='+left+',top='+top+',toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no'; pop = window.open(pageName + '?address=' + escape(address) + '&lat=' + latitude + '&long=' + longitude + '&City=' + cityName,'ShowMapPopup',features); if(pop.focus){ pop.focus(); } } function CleanCheckboxes() { for (i=0;i