Vous êtes sur la page 1sur 35

// ======================================================== // Covered by U.S. Pat. No.

7,640,240 // ======================================================== // ======================================================== // settings var cincPID="13650"; var cincNID="10"; var cincZID="bt30"; var cincSFT="yes"; // new 'soft' look, rounded edges, srb 3/29/2006 var cincTYP="120x600"; // size of approved ad units (def 120x600) var cincPUB="0"; // publisher ID - not necessary for PID/NID/ZID mode var cincMOD="a"; // u|a sets underline or ad unit mode (def u) var cincUID=""; var cincBLD="yes"; // no|yes sets bold text (def yes) var cincFGC="green"; // text color - (def green) var cincBGC=""; // background color of the text (def no change in color) var cincTGT="_blank"; // sets the target attribute for the link to coupon var cincIMG="yes"; // yes|no turns off small down arrow image (def yes) var cincLCL=""; // yes indicates request for only local coupons var cincMerch=""; // yes indicates request for only coupons with Merch Keywor ds var cincCat = ""; // yes indicatesrequest for only coupons with category ke ywords var cincCOUPIMG="yes"; // yes|no turns on coupon images (def yes) var cincExcCat="no"; // yes|no exclude category coupon matches (def n o) var cincITL="no"; // no|yes sets italic text (def no) var cincDOT="green"; // color of dotted underline (def green) var cincNPP=7; // max keywords hit per page (def 7) var cincPIDCouponCount=0; var cincTYPw="120"; // width var cincTYPh="600"; // height var cincTYPm="10"; // motif count var cincTYPp="5px"; // padding var cincAdUnitMode = false; var cincConcordanceUrl = "http://www.oclus.com/"; var cincImageUrl = "http://cdn.cpnscdn.com/Ocellus.coupons.com/_images/"; var cincMicrositeUrl = "http://print.coupons.com/couponweb/index.aspx"; var cincAdditionalSupportedWords = ("el").split(","); var cincSupportDupPids = ("0"); var cinc_MOTIF_LEN_LIMIT = 2048; var cinc_DEPTH_MAX = 100; // extra added on 3/28/2008 var cincWDTH = ""; // Width specified for Ad unit mode var ciStrAdWdth = ""; if(cincFGC.indexOf("#")<= -1) { if(ci_isHex(cincFGC)) { cincFGC = "#" + cincFGC; } } if(cincDOT.indexOf("#")<= -1)

{ if(ci_isHex(cincDOT)) { cincDOT = "#" + cincDOT; } } if(cincFGC == cincBGC) // If both front text and Background color are same set o ne to Black if one is white and vice versa { if (cincBGC == "black" || cincBGC == "#000000" || cincBGC == "Black") cincFGC = "white"; if (cincBGC == "White" || cincBGC == "white" || cincBGC == "#FFFFFF") cincFGC = "Black"; } // if ( (cincBGC == "" && (cincFGC =="white" || cincFGC == "#FFFFFF" ) // If B ackground is Blank and Font is White, Default it to Black. (white might not be c lear) // { // cincFGC = "Black"; // } if(cincWDTH != "") { ciStrAdWdth = "width:" + cincWDTH + " px "; } // ======================================================== var cincie4=document.all; var cincns6=document.getElementById&&!document.all; var cimotifPopup=null; var cimotifAdImp=""; var motifCount = 0; var motifAdCount = 0; var var var var var var var var var var var var var var var var var motifArray; motifAdArray; motifHits = 0; motifActiveArrayIndex = null; concordanceMode = true; concordanceDemarcated; motifPreProcessToggle = true; motifProcessMerchcat = false; motifContentLength = 0; motifAllWords = new Array(); motifMerchWords = new Array(); motifMerchNodes = new Array(); concordanceNodes = new Array(); concordanceSupNodes = new Array(); motifLastWord = null; motifLastNode = null; motifMerchKey = "";

function ConcordanceNode(nd,sndIndex,kwd) { this.node = nd; this.sNodeIndex = sndIndex; this.keywords = kwd; } function ConcordanceSupNode(nd,kwd,ch) { this.node = nd; this.keyword = kwd; this.character = ch; } Array.prototype.cincContains = function (x) { for (var i = 0; i < this.length; i++) { if (this[i] == x) return true; } return false; } if (cincie4||cincns6) { if( cincMOD == "u" || cincMOD == "m" ) { // underline mode document.write('<style>'); document.write('#cimotifDiv a{ position: static; width: 100%; display: b lock; font:normal 11px Verdana; font-weight: normal; color: #005890; text-decora tion: none;}'); document.write('#cimotifDiv a:visited{ position: static; width: 100%; di splay: block; font:normal 11px Verdana; font-weight: normal; color: #0068aa; tex t-decoration: none;}'); document.write('#cimotifDiv a:hover{ position: static; background-color : White; font:normal 11px Verdana; text-decoration: underline;}'); document.write('#cimotifDiv table{ position: static; width: auto; height : auto; margin: 0px 0px 0px 0px; border-collapse: separate; border: 0px solid #f fffff; }'); document.write('#cimotifDiv tr{ position: static; width: auto; height: a uto; padding: 0px 0px; border-collapse: separate; border: 0px solid #ffffff; }') ; document.write('#cimotifDiv td{ position: static; vertical-align: middle ; color:#000000; padding: 0px 0px; border-collapse: separate; border: 0px solid #ffffff; }'); document.write('#cimotifDiv img{ position: static; border: 0px solid #ff ffff; }'); document.write('#cimotifDivAlt a{ position: static; width: 100%; display : block; font:normal 11px Verdana; font-weight: normal; color: #005890; text-dec oration: none;}'); document.write('#cimotifDivAlt a:visited{ position: static; width: 100%; display: block; font:normal 11px Verdana; font-weight: normal; color: #0068aa; text-decoration: none;}'); document.write('#cimotifDivAlt a:hover{ position: static; background-col or : White; font:normal 11px Verdana; text-decoration: underline;}'); document.write('#cimotifDivAlt table{ position: static; width: auto; hei ght: auto; margin: 0px 0px 0px 0px; border-collapse: separate; border: 0px solid #ffffff; }'); document.write('#cimotifDivAlt tr{ position: static; width: auto; height : auto; padding: 0px 0px; border-collapse: separate; border: 0px solid #ffffff;

}'); document.write('#cimotifDivAlt td{ position: static; vertical-align: mid dle; color:#000000; padding: 0px 0px; border-collapse: separate; border: 0px sol id #ffffff; }'); document.write('#cimotifDivAlt img{ position: static; border: 0px solid #ffffff; }'); document.write('</style>'); document.write('<div id="cimotifDiv" style="visibility:hidden;background -color:transparent; filter:alpha(opacity=98);position:absolute;z-index:114748364 7;" onMouseover="cimotifClearPopup()" onMouseout="cimotifHidePopup(event)"></div >'); } if( cincMOD != "u" ) { // ad mode document.write('<style>'); document.write('#cimotifdom a{ position: static; width:; align: left; display: block; font:normal 11px Verdana; font-weight: normal; color: ' + cincFG C + '; text-decoration: none; padding-left: 7; text-indent: -7; }'); document.write('#cimotifdom a:visited{ position: static; width:; display : block; font:normal 11px Verdana; font-weight: normal; color: ' + cincFGC + '; text-decoration: none;}'); document.write('#cimotifdom a:hover{ position: static; width:; backgroun d-color : ' + cincBGC + '; font:normal 11px Verdana; text-decoration: underline; }'); document.write('#cimotifdom table{ position: static; margin: 0px 0px 0 px 0px; border-collapse: separate; border: 0px solid #ffffff; ' + ciStrAdWdth + '; }'); document.write('#cimotifdom tr{ position: static; padding: 0px 0px; bord er-collapse: separate; border: 0px solid #ffffff; }'); document.write('#cimotifdom td{ position: static; vertical-align: middl e; background-color : ' + cincBGC + '; color:#000000; padding: 0px 0px; border-c ollapse: separate; border: 0px solid #ffffff; }'); document.write('#cimotifdom img{ position: static; border: 0px solid #ff ffff; }'); document.write(".ci_ccss_container, .ci_ccss_content, .ci_ccss_pod, .ci_ ccss, .ci_ccss_tr, .ci_ccss_td, .ci_ccss_a:link, .ci_ccss_a:visited, .ci_ccss_a: hover, .ci_ccss_divIndent, #ci_ccss_Header, #ci_ccss_Footer " +"{" +"vertical-align: top; visibility: visible; white-space: normal; width: auto; word-spacing: normal; z-index: auto;" + " }" +" .ci_ccss_tr {display: table-row;}" +" .ci_ccss_td {display: table-cell;}" +" .ci_ccss_divIndent {padding-left: 7px; text-indent: -7px;}" +" .ci_ccss_a:link{color: #0068aa;text-decoration: underline;}" +" .ci_ccss_a:visited{font-size: 11px;color: #788b97;text-decoration: un derline;}" +" .ci_ccss_container {background: transparent; margin:0px;}" ); document.write('</style>'); } } // ================================================= function cmotifInsertMotifDivElement(parentElem,type,id) { var elem = document.createElement(type); elem.id = id;

elem.setAttribute("visibility","hidden"); elem.setAttribute("background-color","transparent"); elem.setAttribute("filter","alpha(opacity=98)"); elem.setAttribute("position","hidden"); elem.setAttribute("onMouseover","cimotifClearPopup()"); elem.setAttribute("onMouseout","cimotifHidePopup(event)"); elem.style.zIndex = "2147483647"; elem.style.position = "absolute"; elem.style.top = "-2000px"; elem.style.left = "-2000px"; elem.style.width = "250px"; elem.style.height = "160px"; parentElem.appendChild(elem); } // ======================================================== function cmotifDefinePopup() { if( cincMOD == "m" && !cincie4 && document.getElementById("cimotifDivAlt") = = null && document.getElementsByTagName("body") ) { var bObjs = document.getElementsByTagName("body"); cmotifInsertMotifDivElement(bObjs[bObjs.length-1],"div","cimotifDivAlt") ; } if( document.getElementById("cimotifDivAlt") != null ) { cimotifPopup = document.getElementById("cimotifDivAlt"); } else { cimotifPopup = document.getElementById("cimotifDiv"); } if( cincSFT == "yes" ) { var rowspacer = "<tr><td height=4px width=16px BACKGROUND='" + c incImageUrl + "LMBlue.gif'></td><td colspan=5 height=4px bgcolor='#FCFDFD'></td> <td height=4px width=16px BACKGROUND='" + cincImageUrl + "RMBlue.gif'></td></tr> "; var rowstart = "<tr><td width=16px BACKGROUND='" + cincImageUrl + "LMBlue.gif'></td><td colspan=5 style='font:normal 11px Verdana;' bgcolor='#FC FDFD' align=left>"; var rowend = "</td><td width=16px BACKGROUND='" + cincImageUrl + "RMBlue.gif'></td></tr>"; divContents = "<table cellpadding=0 cellspacing=0 border=0 style ='" + (cincMOD == "m" ? "width: 244px; height: 152px;" : "" ) + "'><tr><td width =16px BACKGROUND='" + cincImageUrl + "ULBlue.gif'></td><td colspan=5 height=16px BACKGROUND='" + cincImageUrl + "TMBlue.gif'></td><td width=16px onclick='javasc ript:cimotifHide();' BACKGROUND='" + cincImageUrl + "URBlue.gif'></td></tr><tr>< td width=16px BACKGROUND='" + cincImageUrl + "LMBlue.gif'></td><td colspan=5 hei ght=2px bgcolor='#FCFDFD'></td><td width=16px BACKGROUND='" + cincImageUrl + "RM Blue.gif'></td></tr>"; if( cincTYP != "y" ) { divContents += "<tr><td width=16px BACKGROUND='" + cincImage Url + "LMBlue.gif'></td><td colspan=4 style='font:normal 11px Verdana;' align=le ft bgcolor='#FCFDFD'><strong>Print these coupons...</strong></td><td align=right

bgcolor='#FCFDFD'><img src='" + cincImageUrl + "CloseBoxBlue1.gif' height='9' w idth='9' border='0'></td><td width=16px BACKGROUND='" + cincImageUrl + "RMBlue.g if'></td></tr>" + rowspacer; } else { divContents += "<tr><td width=16px BACKGROUND='" + cincImage Url + "LMBlue.gif'></td><td colspan=4 style='font:normal 11px Verdana;' align=le ft bgcolor='#FCFDFD'><strong>Click to print a coupon...</strong></td><td align=r ight bgcolor='#FCFDFD'><img src='" + cincImageUrl + "CloseBoxBlue1.gif' height=' 9' width='9' border='0'></td><td width=16px BACKGROUND='" + cincImageUrl + "RMBl ue.gif'></td></tr>" + rowspacer; } divContents += "<tr><td width=16px BACKGROUND='" + cincImageUrl + "LMBlue.gif' style='border: 0px solid white;'></td><td id='motifCouponTD' cols pan=5 style='border: 1px solid white; font:normal 11px Verdana;' bgcolor='#FCFDF D' align=left>"+rowend; divContents += rowspacer + "<tr><td width=16px BACKGROUND='" + c incImageUrl + "LMBlue.gif'></td><td colspan=5 height=1px bgcolor='#DDE1DB'></td> <td width=16px BACKGROUND='" + cincImageUrl + "RMBlue.gif'></td></tr>" + rowspac er; divContents += "<tr><td width=16px BACKGROUND='" + cincImageUrl + "LMBlue.gif'></td><td colspan=3 bgcolor='#FCFDFD'><a href='javascript:cimotifA bout()' style='font:normal 10px Verdana; color: gray; text-decoration: none;' on mouseover=\"window.status='About Concordance';return true\" onmouseout=\"window. status=' ';return true\">About Concordance&#153</a></td><td bgcolor='#FCFDFD'></ td><td align=right bgcolor='#FCFDFD'><img src='" + cincImageUrl + "byCouponsInc. gif' width=45 height=12 border=0></td><td width=16px BACKGROUND='" + cincImageUr l + "RMBlue.gif'></td></tr>"; divContents += "<tr><td width=16px BACKGROUND='" + cincImageUrl + "BLBlue.gif'></td><td colspan=5 height=16px BACKGROUND='" + cincImageUrl + "BM Blue.gif'></td><td width=16px BACKGROUND='" + cincImageUrl + "BRBlue.gif'></td>< /tr></table>"; cimotifPopup.innerHTML = divContents; } else { var rowspacer = "<tr><td colspan=5 height=4px></td></tr>"; var rowstart = "<tr><td width=5px></td><td colspan=3 style='font :normal 11px Verdana;' align=left>"; var rowend = "</td><td width=5px></td></tr>"; divContents = "<table bgcolor='#ebebe7' cellpadding=0 cellspacin g=0 style='" + (cincMOD == "m" ? "width: 207px; height: 52px;" : "" ) + "'><tr>< td><table cellpadding=0 cellspacing=0 style='border:1px dashed #C2C2B7;' bgcolor =#fafafa>"; divContents += "<tr><td colspan=5 bgcolor='#ff5400' height=6></t d></tr><tr><td colspan=5 height=2px></td></tr>"; divContents += "<tr><td width=5px></td><td colspan=2 style='font :normal 11px Verdana;' align=left><strong>Print these coupons...</strong></td><t d align=right><img src='" + cincImageUrl + "closebox.gif' onclick='javascript:ci motifHide();' height='9' width='9' border='0'></td></tr>" + rowspacer; divContents += "<tr><td width=5px></td><td id='motifCouponTD' co lspan=3 style='font:normal 11px Verdana;' align=left>"+rowend; divContents += "<tr><td></td><td colspan=3 height=1px bgcolor='# c2c2b7'></td><td></td></tr>" + rowspacer; divContents += "<tr><td width=5px></td><td><a href='javascript:c imotifAbout()' style='font:normal 10px Verdana; color: gray; text-decoration: no

ne;' onmouseover=\"window.status='About Concordance';return true\" onmouseout=\" window.status=' ';return true\">About Concordance&#153</a></td><td width=30></td ><td align=right><img src='" + cincImageUrl + "byCouponsInc.gif' width=45 height =12 border=0></td><td width=5px></td></tr>" + rowspacer + "</table>"; divContents += "</td><td valign=top><img src='" + cincImageUrl + "dot_white.gif' height=8 width=3></td></tr>"; divContents += "<tr><td colspan=2><img src='" + cincImageUrl + " dot_white.gif' height=3 width=8></td></tr></table>"; cimotifPopup.innerHTML = divContents; } cimotifPopup.style.left=cimotifPopup.style.top="-1000px"; cimotifPopup.style.visibility = "visible"; } //======================================================== function getAltURL() { if (typeof(ciAltURL) != "undefined" && ciAltURL.length > 0) return "&altURL=" + ciAltURL; else return ""; } //======================================================== function getAltMoreURL() { if (typeof(ciAltURL) != "undefined" && ciAltURL.length > 0) return (ciAltURL.indexOf("?") > 0 ? ciAltURL + "&pid=" + cincPID : ciAlt URL + "?pid=" + cincPID) ; else return cincMicrositeUrl + "?pid=" + cincPID + "&nid=" + cincNID + "&zid= " + cincZID + (typeof(theCVL) != "undefined" ? theCVL : ""); } // ======================================================== function SetPrtCpnWStat(status) { window.status=(status ? 'Print this coupon' : ' '); return true; } // ======================================================== function cmotifHtmlDecode(s) { var out = ""; if (s==null) return; var l = s.length; for (var i=0; i<l; i++) { var ch = s.charAt(i); if (ch == '&') { var semicolonIndex = s.indexOf(';', i+1); if (semicolonIndex > 0) { var entity = s.substring(i + 1, semicolonIndex); if (entity.length > 1 && entity.charAt(0) == '#' ) { if (entity.charAt(1) == 'x' || entity.ch arAt(1) == 'X') ch = String.fromCharCode(eval('0 '+entity.substring(1)));

else ch = String.fromCharCode(eval(en tity.substring(1))); } else { switch (entity) { case 'quot': ch = String.fromCha rCode(0x0022); break; case 'amp': ch = String.fromChar Code(0x0026); break; case 'lt': ch = String.fromCharC ode(0x003c); break; case 'gt': ch = String.fromCharC ode(0x003e); break; case 'nbsp': ch = String.fromCha rCode(0x00a0); break; case 'iexcl': ch = String.fromCh arCode(0x00a1); break; case 'cent': ch = String.fromCha rCode(0x00a2); break; case 'pound': ch = String.fromCh arCode(0x00a3); break; case 'curren': ch = String.fromC harCode(0x00a4); break; case 'yen': ch = String.fromChar Code(0x00a5); break; case 'brvbar': ch = String.fromC harCode(0x00a6); break; case 'sect': ch = String.fromCha rCode(0x00a7); break; case 'uml': ch = String.fromChar Code(0x00a8); break; case 'copy': ch = String.fromCha rCode(0x00a9); break; case 'ordf': ch = String.fromCha rCode(0x00aa); break; case 'laquo': ch = String.fromCh arCode(0x00ab); break; case 'not': ch = String.fromChar Code(0x00ac); break; case 'shy': ch = String.fromChar Code(0x00ad); break; case 'reg': ch = String.fromChar Code(0x00ae); break; case 'macr': ch = String.fromCha rCode(0x00af); break; case 'deg': ch = String.fromChar Code(0x00b0); break; case 'plusmn': ch = String.fromC harCode(0x00b1); break; case 'sup2': ch = String.fromCha rCode(0x00b2); break; case 'sup3': ch = String.fromCha rCode(0x00b3); break; case 'acute': ch = String.fromCh arCode(0x00b4); break; case 'micro': ch = String.fromCh arCode(0x00b5); break;

case 'para': ch = String.fromCha rCode(0x00b6); break; case 'middot': ch = String.fromC harCode(0x00b7); break; case 'cedil': ch = String.fromCh arCode(0x00b8); break; case 'sup1': ch = String.fromCha rCode(0x00b9); break; case 'ordm': ch = String.fromCha rCode(0x00ba); break; case 'raquo': ch = String.fromCh arCode(0x00bb); break; case 'frac14': ch = String.fromC harCode(0x00bc); break; case 'frac12': ch = String.fromC harCode(0x00bd); break; case 'frac34': ch = String.fromC harCode(0x00be); break; case 'iquest': ch = String.fromC harCode(0x00bf); break; case 'Agrave': ch = String.fromC harCode(0x00c0); break; case 'Aacute': ch = String.fromC harCode(0x00c1); break; case 'Acirc': ch = String.fromCh arCode(0x00c2); break; case 'Atilde': ch = String.fromC harCode(0x00c3); break; case 'Auml': ch = String.fromCha rCode(0x00c4); break; case 'Aring': ch = String.fromCh arCode(0x00c5); break; case 'AElig': ch = String.fromCh arCode(0x00c6); break; case 'Ccedil': ch = String.fromC harCode(0x00c7); break; case 'Egrave': ch = String.fromC harCode(0x00c8); break; case 'Eacute': ch = String.fromC harCode(0x00c9); break; case 'Ecirc': ch = String.fromCh arCode(0x00ca); break; case 'Euml': ch = String.fromCha rCode(0x00cb); break; case 'Igrave': ch = String.fromC harCode(0x00cc); break; case 'Iacute': ch = String.fromC harCode(0x00cd); break; case 'Icirc': ch = String.fromCh arCode(0x00ce); break; case 'Iuml': ch = String.fromCha rCode(0x00cf); break; case 'ETH': ch = String.fromChar Code(0x00d0); break; case 'Ntilde': ch = String.fromC harCode(0x00d1); break; case 'Ograve': ch = String.fromC harCode(0x00d2); break; case 'Oacute': ch = String.fromC harCode(0x00d3); break;

case 'Ocirc': ch = String.fromCh arCode(0x00d4); break; case 'Otilde': ch = String.fromC harCode(0x00d5); break; case 'Ouml': ch = String.fromCha rCode(0x00d6); break; case 'times': ch = String.fromCh arCode(0x00d7); break; case 'Oslash': ch = String.fromC harCode(0x00d8); break; case 'Ugrave': ch = String.fromC harCode(0x00d9); break; case 'Uacute': ch = String.fromC harCode(0x00da); break; case 'Ucirc': ch = String.fromCh arCode(0x00db); break; case 'Uuml': ch = String.fromCha rCode(0x00dc); break; case 'Yacute': ch = String.fromC harCode(0x00dd); break; case 'THORN': ch = String.fromCh arCode(0x00de); break; case 'szlig': ch = String.fromCh arCode(0x00df); break; case 'agrave': ch = String.fromC harCode(0x00e0); break; case 'aacute': ch = String.fromC harCode(0x00e1); break; case 'acirc': ch = String.fromCh arCode(0x00e2); break; case 'atilde': ch = String.fromC harCode(0x00e3); break; case 'auml': ch = String.fromCha rCode(0x00e4); break; case 'aring': ch = String.fromCh arCode(0x00e5); break; case 'aelig': ch = String.fromCh arCode(0x00e6); break; case 'ccedil': ch = String.fromC harCode(0x00e7); break; case 'egrave': ch = String.fromC harCode(0x00e8); break; case 'eacute': ch = String.fromC harCode(0x00e9); break; case 'ecirc': ch = String.fromCh arCode(0x00ea); break; case 'euml': ch = String.fromCha rCode(0x00eb); break; case 'igrave': ch = String.fromC harCode(0x00ec); break; case 'iacute': ch = String.fromC harCode(0x00ed); break; case 'icirc': ch = String.fromCh arCode(0x00ee); break; case 'iuml': ch = String.fromCha rCode(0x00ef); break; case 'eth': ch = String.fromChar Code(0x00f0); break; case 'ntilde': ch = String.fromC harCode(0x00f1); break;

case 'ograve': ch = String.fromC harCode(0x00f2); break; case 'oacute': ch = String.fromC harCode(0x00f3); break; case 'ocirc': ch = String.fromCh arCode(0x00f4); break; case 'otilde': ch = String.fromC harCode(0x00f5); break; case 'ouml': ch = String.fromCha rCode(0x00f6); break; case 'divide': ch = String.fromC harCode(0x00f7); break; case 'oslash': ch = String.fromC harCode(0x00f8); break; case 'ugrave': ch = String.fromC harCode(0x00f9); break; case 'uacute': ch = String.fromC harCode(0x00fa); break; case 'ucirc': ch = String.fromCh arCode(0x00fb); break; case 'uuml': ch = String.fromCha rCode(0x00fc); break; case 'yacute': ch = String.fromC harCode(0x00fd); break; case 'thorn': ch = String.fromCh arCode(0x00fe); break; case 'yuml': ch = String.fromCha rCode(0x00ff); break; case 'OElig': ch = String.fromCh arCode(0x0152); break; case 'oelig': ch = String.fromCh arCode(0x0153); break; case 'Scaron': ch = String.fromC harCode(0x0160); break; case 'scaron': ch = String.fromC harCode(0x0161); break; case 'Yuml': ch = String.fromCha rCode(0x0178); break; case 'fnof': ch = String.fromCha rCode(0x0192); break; case 'circ': ch = String.fromCha rCode(0x02c6); break; case 'tilde': ch = String.fromCh arCode(0x02dc); break; case 'Alpha': ch = String.fromCh arCode(0x0391); break; case 'Beta': ch = String.fromCha rCode(0x0392); break; case 'Gamma': ch = String.fromCh arCode(0x0393); break; case 'Delta': ch = String.fromCh arCode(0x0394); break; case 'Epsilon': ch = String.from CharCode(0x0395); break; case 'Zeta': ch = String.fromCha rCode(0x0396); break; case 'Eta': ch = String.fromChar Code(0x0397); break; case 'Theta': ch = String.fromCh arCode(0x0398); break;

case 'Iota': ch = String.fromCha rCode(0x0399); break; case 'Kappa': ch = String.fromCh arCode(0x039a); break; case 'Lambda': ch = String.fromC harCode(0x039b); break; case 'Mu': ch = String.fromCharC ode(0x039c); break; case 'Nu': ch = String.fromCharC ode(0x039d); break; case 'Xi': ch = String.fromCharC ode(0x039e); break; case 'Omicron': ch = String.from CharCode(0x039f); break; case 'Pi': ch = String.fromCharC ode(0x03a0); break; case 'Rho': ch = String.fromChar Code(0x03a1); break; case 'Sigma': ch = String.fromCh arCode(0x03a3); break; case 'Tau': ch = String.fromChar Code(0x03a4); break; case 'Upsilon': ch = String.from CharCode(0x03a5); break; case 'Phi': ch = String.fromChar Code(0x03a6); break; case 'Chi': ch = String.fromChar Code(0x03a7); break; case 'Psi': ch = String.fromChar Code(0x03a8); break; case 'Omega': ch = String.fromCh arCode(0x03a9); break; case 'alpha': ch = String.fromCh arCode(0x03b1); break; case 'beta': ch = String.fromCha rCode(0x03b2); break; case 'gamma': ch = String.fromCh arCode(0x03b3); break; case 'delta': ch = String.fromCh arCode(0x03b4); break; case 'epsilon': ch = String.from CharCode(0x03b5); break; case 'zeta': ch = String.fromCha rCode(0x03b6); break; case 'eta': ch = String.fromChar Code(0x03b7); break; case 'theta': ch = String.fromCh arCode(0x03b8); break; case 'iota': ch = String.fromCha rCode(0x03b9); break; case 'kappa': ch = String.fromCh arCode(0x03ba); break; case 'lambda': ch = String.fromC harCode(0x03bb); break; case 'mu': ch = String.fromCharC ode(0x03bc); break; case 'nu': ch = String.fromCharC ode(0x03bd); break; case 'xi': ch = String.fromCharC ode(0x03be); break;

case 'omicron': ch = String.from CharCode(0x03bf); break; case 'pi': ch = String.fromCharC ode(0x03c0); break; case 'rho': ch = String.fromChar Code(0x03c1); break; case 'sigmaf': ch = String.fromC harCode(0x03c2); break; case 'sigma': ch = String.fromCh arCode(0x03c3); break; case 'tau': ch = String.fromChar Code(0x03c4); break; case 'upsilon': ch = String.from CharCode(0x03c5); break; case 'phi': ch = String.fromChar Code(0x03c6); break; case 'chi': ch = String.fromChar Code(0x03c7); break; case 'psi': ch = String.fromChar Code(0x03c8); break; case 'omega': ch = String.fromCh arCode(0x03c9); break; case 'thetasym': ch = String.fro mCharCode(0x03d1); break; case 'upsih': ch = String.fromCh arCode(0x03d2); break; case 'piv': ch = String.fromChar Code(0x03d6); break; case 'ensp': ch = String.fromCha rCode(0x2002); break; case 'emsp': ch = String.fromCha rCode(0x2003); break; case 'thinsp': ch = String.fromC harCode(0x2009); break; case 'zwnj': ch = String.fromCha rCode(0x200c); break; case 'zwj': ch = String.fromChar Code(0x200d); break; case 'lrm': ch = String.fromChar Code(0x200e); break; case 'rlm': ch = String.fromChar Code(0x200f); break; case 'ndash': ch = String.fromCh arCode(0x2013); break; case 'mdash': ch = String.fromCh arCode(0x2014); break; case 'lsquo': ch = String.fromCh arCode(0x2018); break; case 'rsquo': ch = String.fromCh arCode(0x2019); break; case 'sbquo': ch = String.fromCh arCode(0x201a); break; case 'ldquo': ch = String.fromCh arCode(0x201c); break; case 'rdquo': ch = String.fromCh arCode(0x201d); break; case 'bdquo': ch = String.fromCh arCode(0x201e); break; case 'dagger': ch = String.fromC harCode(0x2020); break;

case 'Dagger': ch = String.fromC harCode(0x2021); break; case 'bull': ch = String.fromCha rCode(0x2022); break; case 'hellip': ch = String.fromC harCode(0x2026); break; case 'permil': ch = String.fromC harCode(0x2030); break; case 'prime': ch = String.fromCh arCode(0x2032); break; case 'Prime': ch = String.fromCh arCode(0x2033); break; case 'lsaquo': ch = String.fromC harCode(0x2039); break; case 'rsaquo': ch = String.fromC harCode(0x203a); break; case 'oline': ch = String.fromCh arCode(0x203e); break; case 'frasl': ch = String.fromCh arCode(0x2044); break; case 'euro': ch = String.fromCha rCode(0x20ac); break; case 'image': ch = String.fromCh arCode(0x2111); break; case 'weierp': ch = String.fromC harCode(0x2118); break; case 'real': ch = String.fromCha rCode(0x211c); break; case 'trade': ch = String.fromCh arCode(0x2122); break; case 'alefsym': ch = String.from CharCode(0x2135); break; case 'larr': ch = String.fromCha rCode(0x2190); break; case 'uarr': ch = String.fromCha rCode(0x2191); break; case 'rarr': ch = String.fromCha rCode(0x2192); break; case 'darr': ch = String.fromCha rCode(0x2193); break; case 'harr': ch = String.fromCha rCode(0x2194); break; case 'crarr': ch = String.fromCh arCode(0x21b5); break; case 'lArr': ch = String.fromCha rCode(0x21d0); break; case 'uArr': ch = String.fromCha rCode(0x21d1); break; case 'rArr': ch = String.fromCha rCode(0x21d2); break; case 'dArr': ch = String.fromCha rCode(0x21d3); break; case 'hArr': ch = String.fromCha rCode(0x21d4); break; case 'forall': ch = String.fromC harCode(0x2200); break; case 'part': ch = String.fromCha rCode(0x2202); break; case 'exist': ch = String.fromCh arCode(0x2203); break;

case 'empty': ch = String.fromCh arCode(0x2205); break; case 'nabla': ch = String.fromCh arCode(0x2207); break; case 'isin': ch = String.fromCha rCode(0x2208); break; case 'notin': ch = String.fromCh arCode(0x2209); break; case 'ni': ch = String.fromCharC ode(0x220b); break; case 'prod': ch = String.fromCha rCode(0x220f); break; case 'sum': ch = String.fromChar Code(0x2211); break; case 'minus': ch = String.fromCh arCode(0x2212); break; case 'lowast': ch = String.fromC harCode(0x2217); break; case 'radic': ch = String.fromCh arCode(0x221a); break; case 'prop': ch = String.fromCha rCode(0x221d); break; case 'infin': ch = String.fromCh arCode(0x221e); break; case 'ang': ch = String.fromChar Code(0x2220); break; case 'and': ch = String.fromChar Code(0x2227); break; case 'or': ch = String.fromCharC ode(0x2228); break; case 'cap': ch = String.fromChar Code(0x2229); break; case 'cup': ch = String.fromChar Code(0x222a); break; case 'int': ch = String.fromChar Code(0x222b); break; case 'there4': ch = String.fromC harCode(0x2234); break; case 'sim': ch = String.fromChar Code(0x223c); break; case 'cong': ch = String.fromCha rCode(0x2245); break; case 'asymp': ch = String.fromCh arCode(0x2248); break; case 'ne': ch = String.fromCharC ode(0x2260); break; case 'equiv': ch = String.fromCh arCode(0x2261); break; case 'le': ch = String.fromCharC ode(0x2264); break; case 'ge': ch = String.fromCharC ode(0x2265); break; case 'sub': ch = String.fromChar Code(0x2282); break; case 'sup': ch = String.fromChar Code(0x2283); break; case 'nsub': ch = String.fromCha rCode(0x2284); break; case 'sube': ch = String.fromCha rCode(0x2286); break;

case 'supe': ch = String.fromCha rCode(0x2287); break; case 'oplus': ch = String.fromCh arCode(0x2295); break; case 'otimes': ch = String.fromC harCode(0x2297); break; case 'perp': ch = String.fromCha rCode(0x22a5); break; case 'sdot': ch = String.fromCha rCode(0x22c5); break; case 'lceil': ch = String.fromCh arCode(0x2308); break; case 'rceil': ch = String.fromCh arCode(0x2309); break; case 'lfloor': ch = String.fromC harCode(0x230a); break; case 'rfloor': ch = String.fromC harCode(0x230b); break; case 'lang': ch = String.fromCha rCode(0x2329); break; case 'rang': ch = String.fromCha rCode(0x232a); break; case 'loz': ch = String.fromChar Code(0x25ca); break; case 'spades': ch = String.fromC harCode(0x2660); break; case 'clubs': ch = String.fromCh arCode(0x2663); break; case 'hearts': ch = String.fromC harCode(0x2665); break; case 'diams': ch = String.fromCh arCode(0x2666); break; default: ch = ''; break; } } i = semicolonIndex; } } out += ch; } return out; } // ======================================================== cimotifGetWinSize = function() { var sizeOfX = 0, sizeOfY = 0; if( typeof( window.innerWidth ) == 'number' ) { // Firefox compliant sizeOfX = window.innerWidth; sizeOfY = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { // IE 6+ in 'standards compliant mode' sizeOfX = document.documentElement.clientWidth;

sizeOfY = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clie ntHeight ) ) { // IE 6 compatible sizeOfX = document.body.clientWidth; sizeOfY = document.body.clientHeight; } return [ sizeOfX-25, sizeOfY-25 ]; } // ======================================================== cimotifGetScrollXY = function() { var scrOfX = 0, scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { // Firefox compliant scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrol lTop ) ) { // DOM compliant scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { // IE6 standards compliant mode scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; } return [ scrOfX, scrOfY ]; } // ======================================================== function cimotifcalcPosition(e,ob,pop) { if( cincMOD == "m" && e != null && e.clientX != null && e.clientY != null ) { var winSize = cimotifGetWinSize(); var scrollPos = cimotifGetScrollXY(); var motifClientX = e.clientX; var motifClientY = e.clientY; if( winSize[1] < motifClientY ) { winSize[1] = motifClientY + pop.offset Height; } motifClientY = (e != null && e.clientY + pop.offsetHeight > winSize[1] ? motifClientY - ((e.clientY + pop.offsetHeight)-winSize[1]): motifClientY) + scr ollPos[1] + 10; if( winSize[0] < motifClientX ) { winSize[0] = motifClientX + pop.offset Width; } motifClientX = (e != null && e.clientX + pop.offsetWidth > winSize[0] ? motifClientX - ((e.clientX + pop.offsetWidth)-winSize[0]): motifClientX) + scrol lPos[0] - 20; pop.style.top = (motifClientY < 0 ? 0 : motifClientY) + "px";

pop.style.left = (motifClientX < 0 ? 0 : motifClientX) + "px"; return; } var cimotifL=0,cimotifR=0,cimotifT=0,cimotifB=0; var cimotifpob = ob; while (cimotifpob!=null){ cimotifL=cimotifL+cimotifpob.offsetLeft; cimotifT=cimotifT+cimotifpob.offsetTop; cimotifpob=cimotifpob.offsetParent; } var edgeRt,edgeBt,edgeTp; if (cincie4 && !window.opera){ var paneRef = (document.compatMode && document.compatMode!="Back Compat") ? document.documentElement : document.body; edgeRt = (paneRef.scrollLeft+paneRef.clientWidth-15); edgeBt = (paneRef.scrollTop+paneRef.clientHeight-15); edgeTp = (paneRef.scrollTop); }else{ edgeRt = (window.pageXOffset+window.innerWidth-15); edgeBt = (window.pageYOffset+window.innerHeight-18); edgeTp = (window.pageYOffset); } pop.contentmeasure=pop.offsetWidth if (edgeRt-cimotifL < pop.contentmeasure){ cimotifR=pop.contentmeasure-ob.offsetWidth; } pop.contentmeasure=pop.offsetHeight; if (edgeBt-cimotifT < pop.contentmeasure){ cimotifB=pop.contentmeasure+ob.offsetHeight; if (cimotifT-edgeTp < pop.contentmeasure) cimotifB=pop.y+ob.offsetHeight-edgeTp; } if( cimotifL < cimotifR ){ cimotifL = cimotifR; } if( cimotifT < cimotifB ){ cimotifT = cimotifB; } pop.x=cimotifL; pop.y=cimotifT; pop.style.left=cimotifL-cimotifR+"px"; pop.style.top=cimotifT-cimotifB+ob.offsetHeight+"px"; } // ======================================================== function cimotifShowPopup(e, obj, cimotiflinkarray, index) { if (cincie4 && event) { event.cancelBubble = true; if (event.stopPropagation) event.stopPropagation(); } cimotifClearPopup();

if ((cincie4||cincns6) && (cimotifPopup != null)) { if (cimotiflinkarray != null && motifActiveArrayIndex != index) { var numItems = cimotiflinkarray.length; var innerpart = ""; if( cincTYP != "y" ) { if(numItems < cincPIDCouponCount) { var theCVL = ""; var idxCVL = cimotiflinkarray[0].indexOf ("&cvl="); if (idxCVL > -1) { endCVL = cimotiflinkarray[0].ind exOf("'",idxCVL); // if CVL is the last param if (endCVL > -1) { en2CVL = cimotiflinkarra y[0].indexOf("&",idxCVL+1); // if CVL is the last param if ((en2CVL > -1) && (en 2CVL < endCVL)) endCVL = en2CVL; theCVL = cimotiflinkarra y[0].substring(idxCVL,endCVL); } } innerpart = "<table cellspacing=0 cellpa dding=0 border=0><tr><td height='20' width='3' style='width: 3px; border-collaps e: separate; padding: 0px 0px;'></td><td><a href='" + cincMicrositeUrl + "?pid=" + cincPID + "&nid=" + cincNID + "&zid=" + cincZID + theCVL + "' target='" + ci ncTGT + "' onmouseover=\"window.status='Print more Coupons';return true\" onmous eout=\"window.status=' ';return true\" onclick='this.href=getAltMoreURL();cimot ifDelayHide(); return true;'><b>Plus " + (cincPIDCouponCount-numItems) + " more. ..</b></a></td></tr></table>"; } } if(numItems > 2) {innerpart = cimotiflinkarray[2] + inne rpart;} if(numItems > 1) {innerpart = cimotiflinkarray[1] + inne rpart;} if(numItems > 0) {innerpart = cimotiflinkarray[0] + inne rpart;} document.getElementById("motifCouponTD").innerHTML=inner part; } motifActiveArrayIndex = index; cimotifPopup.style.left=cimotifPopup.style.top="-1000px"; cimotifcalcPosition(e,obj,cimotifPopup); return false; } else { return true; } } // ======================================================== function cimotifHidePopup(e) { var ok = 0; if (cincie4) {

if (!cimotifPopup.contains(e.toElement)) { ok = 1 } } else if (cincns6) { try { a = e.currentTarget; b = e.relatedTarget; foundit = 0; if (a != b) { if (b.parentNode != null) { ok = 1; while (!foundit) { if ((b = b.parentNode) == a) {fo undit = 1; ok = 0;} } } } } catch (e) {;} } if (ok) cimotifDelayHide(); } // ======================================================== function cimotifHide() { if (cimotifPopup!=null){ cimotifPopup.style.top = "-1000px"; motifActiveArrayIndex = -1; } return false; } // ======================================================== function cimotifDelayHide() { if (cincie4||cincns6) delayhide=setTimeout("cimotifHide()",500); return false; } // ======================================================== function cimotifClearPopup() { if (typeof delayhide!="undefined") clearTimeout(delayhide); } // ======================================================== function cimotifAbout() { winStats='resizable=no,toolbar=no,location=no,directories=no,menubar=no,'; winStats+='scrollbars=yes,width=475,height=300'; if (navigator.appName.indexOf("Microsoft")>=0) { winStats+=',left=10,top=25' }else{ winStats+=',screenX=10,screenY=25' } helper=window.open(cincConcordanceUrl+"Ocellus-C.aspx?pub=" + cincPUB + "&typ =0&pid=" + cincPID + "&nid=" + cincNID + "&zid=" + cincZID + "&mod=" + cincMOD + "&typ=" + cincTYP + "&redirect=Concordance.aspx","",winStats);

} // ======================================================== function motifaddmousehandlers(motifnode,index) { //alert(motifnode.innerHTML + " --"); motifnode.onmouseover=function(){ this.style.color=cincFGC; if( cincBGC.length ) { this.style.backgroundColor=cincBGC; } this.style.borderBottom='none'; return cimotifShowPopup(arguments[0] || window.event, this, moti fArray[1][index], index); }; motifnode.onmouseout=function(){ this.style.color=cincFGC; this.style.backgroundColor=( cincBGC.length > 0 ? cincBGC : 'tra nsparent'); this.style.borderTop='None'; this.style.borderBottom='dotted 2px '+cincDOT; return cimotifDelayHide(); }; //20091120: added image tagging motifaddimagemousehandlers(motifnode.innerHTML, index); } //========================================================= function motifaddimagemousehandlers(id, index) { try { var img = id; if (id.indexOf("IMGID=") > -1) img = id.substr(id.indexOf("IMGID=") + 6); //20091120: support mouse over for image tag if (document.getElementById(img) != null) { document.getElementById(img).onmouseover = function(){ this.style.color=cincFGC; if( cincBGC.length ) { this.style.backgroundCol or=cincBGC; } this.style.borderBottom='none'; return cimotifShowPopup(arguments[0] || window.event , this, motifArray[1][index], index); }; document.getElementById(img).onmouseout = function(){ this.style.color=cincFGC; this.style.backgroundColor=( cincBGC.length > 0 ? ci ncBGC : 'transparent'); this.style.borderTop='None'; this.style.borderBottom='dotted 2px '+cincDOT; return cimotifDelayHide(); }; } } catch (err) {}

} // ======================================================== function motifaddplainmousehandlers(motifnode,index) { motifnode.onmouseover=function(){ return cimotifShowPopup(arguments[0] || window.event, this, moti fArray[1][index], index); }; motifnode.onmouseout=function(){ return cimotifDelayHide(); }; } // ======================================================== function motifaddclickhandlers(motifnode,index) { motifnode.onclick=function(){ return cimotifShowPopup(arguments[0] || window.event, this, moti fArray[1][index], index); }; motifnode.onmouseout=function(){ return cimotifDelayHide(); }; } // ======================================================== function motifcouponword(index,hitFound,nodeIndex,word) { var node = concordanceNodes[nodeIndex].node; var motifpn = node.parentNode; var supChars = ""; var sNodeIndex = concordanceNodes[nodeIndex].sNodeIndex; if( sNodeIndex > -1 && word.indexOf(concordanceSupNodes[sNodeIndex].keyword) > -1 ) { // superscript node ! // make sure this word is the last word var bLastWord = true; for( var i=hitFound+word.length; i<concordanceNodes[nodeIndex].keywords. length; i++ ) { if( !( ( concordanceNodes[nodeIndex].keywords.charAt(i) >= 'a' && co ncordanceNodes[nodeIndex].keywords.charAt(i) <= 'z') || concordanceNodes[nodeIndex].keywords.charCodeAt(i) > 128 ) ) { for( var j=i+1; j<concordanceNodes[nodeIndex].keywords.length; j+ + ) { if( ( concordanceNodes[nodeIndex].keywords.charAt(j) >= 'a' && concordanceNodes[nodeIndex].keywords.charAt(j) <= 'z') || concordanceNodes[nodeIndex].keywords.charCodeAt(j) > 128 ) { // another word !

bLastWord = false; break; } } break; } } if( bLastWord ) { supChars = concordanceSupNodes[sNodeIndex].character; } } if (motifpn != null && motifpn.className != "cimotif") { if(node.nodeType != 1) { motifnv = node.nodeValue; } motifni = hitFound; motifpre = document.createTextNode(motifnv.substr(0,motifni)); motifpost = document.createTextNode(motifnv.substr(motifni+word. length)); motif = document.createElement("A"); motif.innerHTML = motifnv.substr(motifni,word.length) + ( supCha rs.length > 0 ? "<sup style='font-weight: normal;'>"+supChars+"</sup>" : ""); motif.style.backgroundColor.filter = "alpha(opacity = 20)"; motif.style.borderBottom = 'dotted 2px '+cincDOT; motif.style.color = cincFGC; if( cincBGC.length ) { motif.style.backgroundColor=cincBGC; } if( cincBLD == "yes" ) { motif.style.fontWeight='bold'; } if( cincITL == "yes" ) { motif.style.fontStyle='italic'; } motif.style.textDecoration='none'; motif.style.cursor='pointer'; motif.className = 'cimotif'; motifaddmousehandlers(motif,index); if( cincIMG == "yes" ) // show image next to highlighed word unl ess asked not to do so { motifimg = document.createElement('img'); motifimg.src = cincImageUrl + "showlist_icon.gif"; motifimg.height = '10'; motifimg.width = '10'; motifimg.style.borderWidth = '0'; motifimg.style.margin = '0px 0px 0px 0px'; motifimg.style.padding = '0px'; motifimg.style.styleFloat = 'none'; motifimg.style.cssFloat = 'none'; // needed for FireFox motifimg.style.position = 'static'; } motifpn.insertBefore(motifpre,node); motifpn.insertBefore(motif,node); if( cincIMG == "yes" ) { // show image next to highlighted word unless asked not to do so

motifpn.insertBefore(motifimg,node); } var nNode = motifpn.insertBefore(motifpost,node); concordanceNodes[nodeIndex] = new ConcordanceNode(nNode,concorda nceNodes[nodeIndex].sndIndex,cmotifHtmlDecode(nNode.nodeValue.toLowerCase())); motifpn.removeChild(node); if( supChars.length > 0 ) { var sNode = concordanceSupNodes[sNodeIndex].node; sNode.parentNode.removeChild(sNode); } ++motifHits; return true; } return false; } // ======================================================== function motifexecute() { var merchNodesArr = null; // underline mode if( cincMOD == "u" || cincMOD == "m" ) { cmotifDefinePopup(); for (var i=0 ; i < motifCount; i++) { if ( motifHits >= cincNPP ) break; var mWord = cmotifHtmlDecode(motifArray[0][i]); var regExp = new RegExp("[^a-z0-9]" + mWord + "[^a-z0-9]",""); for( var j=0; j < concordanceNodes.length; j++ ) { var mData = " " + concordanceNodes[j].keywords + " ";

if(typeof(motifMerchNodes[mWord]) != "undefined") { if(motifMerchNodes[mWord].indexOf("|") > -1) { merchNodesArr = motifMerchNodes[mWord].split("|"); for (var k=0;k < merchNodesArr.length; k++) { var regExp2 = new RegExp("[^a-z0-9]" + merchNodesArr[ k] + "[^a-z0-9]",""); hitFound2 = mData.search(regExp2); if( hitFound2 >= 0 && motifcouponword(i,hitFound2 ,j, merchNodesArr[k]) ) { break; } } } else { var regExp2 = new RegExp("[^a-z0-9]" + motifMerchNodes[mWo

rd] + "[^a-z0-9]",""); hitFound2 = mData.search(regExp2); if( hitFound2 >= 0 && motifcouponword(i,hitFound2,j, motif MerchNodes[mWord]) ) { break; } } } else { hitFound = mData.search(regExp); if( hitFound >= 0 && motifcouponword(i,hitFound,j,mWord) ) { break; } } } } if( cincMOD == "u" ) { return; } } // ad unit mode // -----------------------------------------------if( cincAdUnitMode ) { // simple lines of text with n number of offers if(motifAdCount > cincTYPm) { motifAdCount = cincTYPm; } var cimotifadunit = document.createElement('table'); var cimotifadunitb = document.createElement('tbody'); // set table to Background color passed in cimotifadunit.style.backgroundColor=cincBGC; headerDiv = document.createElement('div'); headerDiv.id = 'ci_ccss_Header'; tr = document.createElement('tr'); td = document.createElement('td'); td.style.textAlign='left'; td.style.backgroundColor=cincBGC; var ciaHeader=document.createElement('A'); ciaHeader.innerHTML = 'Print Coupons'; //ciaHeader.style.cursor='pointer'; ciaHeader.onmouseover=function() { window.status='Print Coupons'; }; ciaHeader.onmouseout=function() { window.status=''; };

ciaHeader.target = '_blank'; //cia.style.color= '#0068aa'; //cia.style.width = cincWDTH; //cia.style.background = cincBGC; //cia.style.fontSize='11px'; //cia.style.textDecoration='none'; //cia.style.fontWeight='bold'; //cia.style.fontFamily='verdana'; ciaHeader.href = cincMicrositeUrl + "?pid=" + cincPID + "&nid=" + cincNID + "&zid=" + cincZID; headerDiv.appendChild (ciaHeader); td.appendChild(headerDiv); tr.appendChild(td); cimotifadunitb.appendChild(tr); //document.getElementById('cimotifdom').appendChild( cia ); tr = document.createElement('tr'); td = document.createElement('td'); td.style.textAlign='left'; td.style.backgroundColor=cincBGC; var motifHTML = ""; for (i=0 ; i < motifAdCount ; i++) { motifHTML += motifAdArray[0][i]; } //document.getElementById('cimotifdom').innerHTML += motifHTML; td.innerHTML += motifHTML; tr.appendChild(td); cimotifadunitb.appendChild(tr); tr = document.createElement('tr'); td = document.createElement('td'); td.style.textAlign='right'; td.style.backgroundColor=cincBGC; FooterDiv = document.createElement('div'); FooterDiv.id = 'ci_ccss_Footer'; ciaFooter=document.createElement('A'); ciaFooter.innerHTML = 'By Coupons.com'; //ciaFooter.style.cursor='pointer'; ciaFooter.onmouseover=function() { window.status='By Coupons.com'; }; ciaFooter.onmouseout=function() { window.status=''; };

//cia.target = '_blank'; //cia.style.color='#0068aa'; //cia.style.width = cincWDTH; //cia.style.background = cincBGC; //cia.style.fontSize='11px'; //cia.style.textDecoration='none'; //cia.style.fontWeight='bold'; //cia.style.fontFamily='verdana'; //cia.style.textAlign ='right'; ciaFooter.href = cincMicrositeUrl + "?pid=" + cincPID + "&nid=" + cincNID + "&zid=" + cincZID; FooterDiv.appendChild(ciaFooter); td.appendChild(FooterDiv); tr.appendChild(td); cimotifadunitb.appendChild(tr); if(motifAdCount > 0) { cimotifadunit.appendChild(cimotifadunitb); } document.getElementById('cimotifdom').appendChild( cimotifadunit );

} // ad unit format with proper table structure // -----------------------------------------------else { if (motifAdCount > cincTYPm) { motifAdCount = cincTYPm; } var cimotifadunit = document.createElement('table'); cimotifadunit.style.border = '1px dashed #C2C2B7'; cimotifadunit.width = cincTYPw; cimotifadunit.height = cincTYPh; cimotifadunit.backgroundColor = '#fafafa'; cimotifadunit.setAttribute('cellPadding',0); cimotifadunit.setAttribute('cellSpacing',0); var cimotifadunitb = document.createElement('tbody'); cimotifadunitb.setAttribute('cellPadding',0); cimotifadunitb.setAttribute('cellSpacing',0); cimotifadunitb.backgroundColor = '#fafafa'; tr = document.createElement('tr'); tr.style.height='6px'; td = document.createElement('td'); td.style.textAlign='left'; td.style.padding='0px'; td.style.backgroundColor='#ff5400'; tr.appendChild(td); cimotifadunitb.appendChild(tr); tr = document.createElement('tr'); tr.style.height='10px'; td = document.createElement('td');

td.style.textAlign='left'; td.style.padding=cincTYPp; td.style.fontFamily='verdana'; td.style.backgroundColor='#fafafa'; td.style.fontSize='11px'; td.style.fontWeight='bold'; td.style.color='black'; cia =document.createTextNode('Print Coupons'); td.appendChild(cia); tr.appendChild(td); cimotifadunitb.appendChild(tr); for (i=0 ; i < motifAdCount ; i++) { // beginning of loop tr = document.createElement('tr'); td = document.createElement('td'); td.style.textAlign='left'; td.style.padding=cincTYPp; td.style.backgroundColor='#fafafa'; td.innerHTML = motifAdArray[0][i]; tr.appendChild(td); cimotifadunitb.appendChild(tr); if( cincTYP != "468x60" && cincTYP != "728x90" ) { tr = document.createElement('tr'); td = document.createElement('td'); td.style.textAlign='center'; td.style.padding=cincTYPp; td.style.backgroundColor='#fafafa'; if(i != motifAdCount-1) { cia = document.createElement('img'); cia.src = cincImageUrl + "dot_divgray.gif"; cia.height = '1'; cia.width = cincTYPw; td.appendChild(cia); tr.appendChild(td); cimotifadunitb.appendChild(tr); } } } // end of loop if( cincTYP != "468x60" && cincTYP != "728x90" ) { tr=document.createElement('tr'); tr.style.height='10px'; td=document.createElement('td'); td.style.textAlign='left'; td.style.padding=cincTYPp; td.style.fontFamily='verdana'; td.style.fontSize='9px'; td.style.fontWeight='bold'; td.style.backgroundColor='#fafafa'; td.style.color='#0068aa'; cia =document.createElement('A'); cia.innerHTML = 'by Coupons.com'; cia.style.cursor='pointer'; cia.onmouseover=function(){ window.status='Print Coupons'; }; cia.onmouseout=function(){ window.status=''; };

cia.onclick=function(){ return cimotifAbout(); }; cia.target = '_blank'; cia.style.color='#0068aa'; cia.style.fontSize='9px'; cia.style.textDecoration='none'; cia.style.fontWeight='bold'; cia.style.fontFamily='verdana'; td.appendChild(cia); tr.appendChild(td); cimotifadunitb.appendChild(tr); } cimotifadunit.appendChild(cimotifadunitb); document.getElementById('cimotifdom').appendChild( cimotifadunit ); } } // ======================================================== function cmotifIsValidWord(word) { var charCount = 0; if( cincAdditionalSupportedWords.cincContains(word) ) { return true; } else if( word.length > 2 ) { for( var i = 0; i < word.length; i++ ) { if( (word.charAt(i) >= 'a' && word.charAt(i) <= 'z') || word.charCodeA t(i) > 128 ) { charCount++; if( charCount > 2 ) return true; } } } return false; } // ======================================================== function motifPreProcess(node,depth,parentNodeNames) {

if( motifContentLength > cinc_MOTIF_LEN_LIMIT || depth > cinc_DEPTH_MAX ) re turn; if (node.hasChildNodes) { var hi_cn; for (hi_cn=0;hi_cn < node.childNodes.length;hi_cn++) { motifPreProcess(node.childNodes[hi_cn],depth+1,parentNod eNames+"|"+node.nodeName+"|"); } }

if (node.nodeType == 3 && !(parentNodeNames.length >= 8 && parentNod eNames.substring(parentNodeNames.length-8) == "|SCRIPT|") ) { // superscripted tag node if( motifPreProcessToggle && motifLastNode != null && parentNodeName s.indexOf("|SUP|") > -1 ) { var sWord = cmotifFilterContent(node.nodeValue.toLowerCase() );

// last word is the last one considered ? if( motifAllWords.length > 0 && motifLastWord == motifAllWords[m otifAllWords.length-1] ) { motifAllWords[motifAllWords.length-1] = motifLastWord+sWord; motifContentLength += sWord.length; } // last word is not the last one considered else { motifAllWords.push(motifLastWord+sWord); motifContentLength += (motifLastWord.length+sWord.length); } // superscript node ! var cNodeIndex = -1; for( var j=concordanceNodes.length-1; j >= 0; j-- ) { if( concordanceNodes[j].node == motifLastNode ) { cNodeIndex = j; concordanceNodes[j] = new ConcordanceNode(motifLastNode,co ncordanceSupNodes.length, cmotifHtmlDecode(motifLastNode.nodeValue.toLowerCase())+cm otifHtmlDecode(sWord)); break; } } if( cNodeIndex == -1 ) { // word is valid ! var cNode = new ConcordanceNode(motifLastNode,concordanc eSupNodes.length,cmotifHtmlDecode(motifLastNode.nodeValue.toLowerCase())+cmotifH tmlDecode(sWord)); concordanceNodes.push(cNode); } var sNode = new ConcordanceSupNode(node,cmotifHtmlDecode(motifLa stWord)+cmotifHtmlDecode(sWord),cmotifHtmlDecode(sWord)); concordanceSupNodes.push(sNode); } else if(motifPreProcessToggle && node.nodeType ==1) { // process Image nodes var imgs,i,strImg;

var bValid = false; imgs=document.getElementsByTagName('img'); // word is valid ! if(motifMerchKey != "" && motifMerchKey.length >=1) { if( typeof(motifMerchNodes[motifMerchKey]) != "undefin ed") { //for(i in imgs) //{ //if(typeof(imgs[i].id) != "undefined" && imgs[i].id.leng th >=1) //{ // if(imgs[i].id == motifMerchKey) // {

// motifMerchNodes[motifMerchKey] = motifMerchNodes [motifMerchKey] + "|" + "IMG"; //var cNode = new ConcordanceNode(node,-1,"IMG:" + motifMerchKey); //concordanceNodes.push(cNode); //} //} //} } else { //for(i in imgs) //{ // if(typeof(imgs[i].id) != "undefined" && imgs[i].id.leng th >=1) //{ // if(imgs[i].id == motifMerchKey) // { // motifMerchNodes[motifMerchKey] = "IMG"; //var cNode = new ConcordanceNode(node,-1,"IMG:" + //concordanceNodes.push(cNode); //} //} //} } } } else if (motifPreProcessToggle && node.nodeValue.length > 2) { var bValid = false;

motifMerchKey);

var mWords = cmotifFilterContent(node.nodeValue.toLowerCase()).split (" "); if( mWords.length > 0 ) { motifLastNode = node; motifLastWord = mWords[mWords.length-1]; } else { motifLastNode = null; } for (i=0 ; i < mWords.length ; i++) { if( cmotifIsValidWord(mWords[i]) && (!motifAllWords.cincCont ains(mWords[i]) || cincSupportDupPids == 1) ) { if( !(node.nodeValue == "Print these coupons..." || node.nodeValue == "Click to print a coupon...") ) { bValid = true; if(motifProcessMerchcat == false) { motifAllWords.push(mWords[i]); motifContentLength += mWords[i].length; } if( motifContentLength > cinc_MOTIF_LEN_LIMIT ) break; } } } if( bValid ) { // word is valid ! if(motifMerchKey != "" && motifMerchKey.length >=1) { if( typeof(motifMerchNodes[motifMerchKey]) != "undefin ed") { motifMerchNodes[motifMerchKey] = motifMerchNodes[moti fMerchKey] + "|" + node.nodeValue.toLowerCase(); } else { motifMerchNodes[motifMerchKey] = node.nodeValue.toLow erCase(); } } var cNode = new ConcordanceNode(node,-1,cmotifHtmlDecode (node.nodeValue.toLowerCase())); concordanceNodes.push(cNode); } } } var concordanceCheck = (node.nodeType == 8 ? node.nodeValue.toLowerCase( ) : node.nodeName.toLowerCase()); if (concordanceCheck.substring(0,11) == "concordance") { if (concordanceMode) { // purge existing content motifAllWords = new Array(); concordanceNodes = new Array(); concordanceMode = false; }

motifMerchKey = ""; if(concordanceCheck.indexOf("merchid") > -1 ) { motifMerchKey = concordanceCheck.substring(26); if(!motifMerchWords.cincContains(concordanceCheck.substring(26))) { motifMerchWords.push(concordanceCheck.substring(26)); } } if(concordanceCheck.indexOf("catid") > -1 ) { motifMerchKey = concordanceCheck.substring(24); if(!motifMerchWords.cincContains(concordanceCheck.substring(24))) { motifMerchWords.push(concordanceCheck.substring(24)); } } if ((concordanceCheck == "concordance-begin") || (concordanceChe ck.indexOf("merchid") > -1) || (concordanceCheck.indexOf("catid") > -1)) { //for case when merchid exists in concordancecheck, //process tag content and save to highlight motifPreProcessToggle = true; if(concordanceCheck.indexOf("merchid") > -1) { motifProcessMerchcat = true; } else if(concordanceCheck.indexOf("catid") > -1) { motifProcessMerchcat = true; } else { motifProcessMerchcat = false; } } else if (concordanceCheck == "concordance-end") motifPreProcessT oggle = false; } } // ======================================================== function cimotifreplace(checkMe,toberep,repwith) { var temp = checkMe; var i = temp.indexOf(toberep); while(i > -1) { temp = temp.replace(toberep, repwith); i = temp.indexOf(toberep); } return temp; } // ======================================================== function cmotifFilterContent(content) {

content = cimotifreplace(content,".",""); content = cimotifreplace(content,",",""); content = cimotifreplace(content,":",""); content = cimotifreplace(content,"\"",""); content = cimotifreplace(content,"&quot;",""); content = cimotifreplace(content,"?",""); content = cimotifreplace(content,"!",""); content = cimotifreplace(content,"[",""); content = cimotifreplace(content,"]",""); content = cimotifreplace(content,"\\",""); content = cimotifreplace(content,"/",""); content = cimotifreplace(content,"=",""); content = cimotifreplace(content,">",""); content = cimotifreplace(content,"<",""); content = cimotifreplace(content,"^",""); content = cimotifreplace(content,"&",""); content = cimotifreplace(content,"*",""); content = cimotifreplace(content,"+",""); content = cimotifreplace(content,"(",""); content = cimotifreplace(content,")",""); content = cimotifreplace(content,"|",""); content = cimotifreplace(content,"%u2019","'"); content = cimotifreplace(content,"\n"," "); content = cimotifreplace(content,"\r"," "); content = cimotifreplace(content,"\t"," "); content = cimotifreplace(content," "," "); return content; } // ======================================================== function cimotifLoad() { motifPreProcess(document.getElementsByTagName("body")[0],0,""); var motifContent = motifAllWords.join(" "); motifContent = escape(motifContent); // Code Added by AD -722009 var motifMerchContent = motifMerchWords.join(" "); motifMerchContent = escape(motifMerchContent); motifContent = motifContent + "+" + motifMerchContent; // minimize the white space motifContent = cimotifreplace(motifContent,"%0A",""); motifContent = cimotifreplace(motifContent,"%09%09","%09"); motifContent = cimotifreplace(motifContent,"%09%20","%20"); motifContent = cimotifreplace(motifContent,"%20%09","%20"); motifContent = cimotifreplace(motifContent,"%20%20","%20"); motifContent = cimotifreplace(motifContent,"%20","+"); var cimotifgoStr = cincConcordanceUrl + "Ocellus-G.aspx?pub=" + cincPUB + "&mod=" + cincMOD + "&typ=" + cincTYP + "&pid=" + cincPID + "&nid=" + cincNID + "&zid=" + cincZID + "&uid=" + cincUID + "&bAdUnitMode=" + cincAdUnitMode + "&c oupimg=" + cincCOUPIMG + "&exccat=" + cincExcCat + "&tgt=" + cincTGT + "&lcl=" + cincLCL + "&merch=" + cincMerch + "&cat=" + cincCat + "&input=" ; cimotifgoStr += (motifContent.charAt(0) == '+' ? '' : '+') + motifContent.substring(0,(cinc_MOTIF_LEN_LIMIT - 3 - cimot ifgoStr.length)) + (motifContent.charAt(motifContent.length-1) == '+' ? '' : '+');

var e = document.createElement("script"); e.src = cimotifgoStr; e.type = "text/javascript"; document.getElementsByTagName("body")[0].appendChild(e); } var cimotifprevonload = null; if (typeof window.onload == 'function') { cimotifprevonload = window.onload; window.onload = function(){cimotifprevonload(); cimotifLoad(); return fa lse;} } else { window.onload = function(){return cimotifLoad();} } if( cincMOD != "u" ) { document.write("<div id='cimotifdom'></div>"); } //====================================================================== function ci_isHex(value) { validChars='0123456789ABCDEF'; strlen=value.length; if(strlen<1){return false;} value=value.toUpperCase(); for(i=0; i < strlen;i++) { if(validChars.indexOf(value.charAt(i))<0) { return false; } } return true; }

Vous aimerez peut-être aussi