var cont_root; var ie = !window.getComputedStyle; var ie7 = ie && navigator.appVersion.indexOf("MSIE 7") != -1; window.onload = function(){ cont_root = $("text-content"); init_tables(); var cat_root = $("cat-text"); init_cat(cat_root); if(ie && !ie7){ init_png(); } //init_prizes_popup(); } function init_tables(){ var tables = $C("tbl", cont_root, "TABLE"); tables.each(function(tbl){ var trs = $T("TR", tbl); var val = 1; trs.each(function(tr, index){ var tds = $T("TD", tr); tds.last().className = "last"; if(!index){ if(tr.className.indexOf("theader") != -1 || $C("theader", tr, "TD") ){ val = 0; } throw $continue; } if(index % 2 == val){ if(tr.className){ tr.className += " zebra"; }else{ tr.className = "zebra"; } } }); trs.last().className = "last"; }) } function init_cat(root){ if(!root){ return false; } var cat_bottle = $("cat-bottle"); cat_bottle.img = $T("IMG", cat_bottle)[0]; if(cat_bottle.img.height == 30 && cat_bottle.img.width == 28){ cat_bottle.img.NO_SRC = true; cat_bottle.img.style.visibility = "hidden"; } cat_bottle.here = null; var lines = $C("line", root, "DIV"); lines.each(function(line){ var link = $T("A", line); if(link.length){ line.links = link; line.links.each(function(lnk){ if(lnk.href.match(/\.jpg$/)){ if(lnk.href == cat_bottle.img.src){ lnk.className = "here"; cat_bottle.here = lnk; } lnk.onclick = function(){ if(this.className.indexOf("here") != -1){ return false; } cat_bottle.img.src = this.href; if(cat_bottle.img.NO_SRC){ cat_bottle.img.NO_SRC = false; cat_bottle.img.style.visibility = "visible"; } if(cat_bottle.here){ cat_bottle.here.className = ""; } this.className = "here"; cat_bottle.here = this; return false; } } }); } }) } function init_png(){ var root = $('left_img_img'); root.imag = $T("IMG", root)[0]; root.style.width = root.imag.width + "px"; root.style.height = root.imag.height + "px"; root.imag.style.display = "none"; root.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + root.imag.src + "', sizingMethod='crop')"; var root2 = $("text-content"); if(!root2){ return false; } var imgs = $T("IMG", root2); if(!imgs){ return false; } imgs.each(function(img){ if(img.src.match(/\.png$/)){ img.style.width = img.width + "px"; img.style.height = img.height + "px"; var src = img.src; img.src = img.src.replace(src.substr(src.lastIndexOf("\/") + 1), "blank.gif"); img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='crop')"; } }) } /* function init_prizes_popup(){ // about/prizes/ if(document.location.href.match(/about\/prizes\/$/)){ var root = $("text-content"); var links = $T("A", root); links.each(function(link){ if(link.href.match(/\.jpg$/)){ link.onclick = function(){ var w = wo(link.href, '', '', ""); try{ var img = $T("IMG", w.document.body)[0]; w.resizeTo(img.width, img.height + 50); img.onload = function(){ w.resizeTo(this.width, this.height + 50); } }catch(e){ w.onload = function(){ var img = $T("IMG", this.document.body)[0]; w.resizeTo(img.width, img.height + 50); }.bind(w); } w.document.onclick = function(){ this.close(); }.bind(w); return false; } } }) } } */ function wo(link,ww,hh,title) { w=window.open(link,'',(ww ? 'width='+ww+',' : '')+(hh ? 'height='+hh+',' : '')+'toolbar=0,scrollbars=0,resizable=1'); if (link.indexOf('.html')==-1) { if (document.layers) title=''; w.document.open(); w.document.write('