// initialize jQuery var jQueryScriptOutputted = false; initJQuery(); // iframe resize document.write(''); document.write(''); function get(name) { var q = unescape(location.search.substring(1)).split(/[=&]/); for (var j=0; j= 2) return stringValue; if (stringValue.length == 1) return ("0" + stringValue); return "00"; } /****************************************************************************************/ /* Draws portal for puzzlesd and horoscopes */ function drawPortal(clientID, contentType, contentID) { // get url vars not passed outside of handler var content_name = get("content_name"); var content_sign = get("content_sign"); var date = get("date"); var print_opt = get("print_opt"); if (contentID!=null) { // puzzle can only be alacarte based on this request; ignore content_name var isAlacarte = "yes" } else { var isAlacarte = "no" } // if ((content_name==null) && (contentID!=null)) { if (contentID!=null) { var content_name = contentID; } // if it's a sample, default to first day of last month, if no month is provided if ((date==null) && (clientID=="sample_alacarte")){ var tempDate = new Date(); var curYear = tempDate.getFullYear(); var curMonth = tempDate.getMonth(); var sampleDate=new Date(curYear, curMonth-1, 0); sampleDate.setDate(sampleDate.getDate()+1); // add a day date = dateToString(sampleDate); } // set base iframe url var viewURL = "//puzzles.kingdigital.com/v3.1s/server/display.php"; // build out iframe url viewURL += ("?client="+clientID+"&alacarte="+isAlacarte); if (content_name!=null){ // content name is specified if (date!=null){ // date is specified viewURL += ("&date="+date); // +"&content_name="+content_name); } if (print_opt!=null){ viewURL += ("&print_opt="+print_opt); } viewURL += ("&content_name="+content_name); // +"\""); } /******** First write iframe code to page ******/ document.write(''); } /****************************************************************************************/ /* initialize jQuery if it's not present */ function initJQuery() { // if the jQuery object isn't available if (typeof(jQuery) == 'undefined') { if (! jQueryScriptOutputted) { //only output the script once. jQueryScriptOutputted = true; //output the script (load it from google api) document.write(''); } setTimeout("initJQuery()", 50); } }