﻿$(document).ready(function(){getNewEbay();getNewScans();$("A[rel*=group1]").fancybox({transitionIn:"elastic",transitionOut:"elastic",speedIn:600,speedOut:600,overlayShow:false});$("#divTopView").dialog({autoOpen:false,width:640,title:"CPG Top Comic Watch",modal:true,resizable:false});$("A[ID*=aTTop]").click(function(){var a=$(this).attr("rel");$("#divTopView").dialog("open");openTopTen(a)});$("A[ID*=aTTop]").click(function(){var a=$(this).attr("rel");$("#divTopView").dialog("open");openTopTen(a)});function openTopTen(rw){$("IMG[ID*=simgTop]").attr("src","images/orngLoader160.gif");$.ajax({type:"POST",url:"services/topTenService.asmx/getSngTopTen",data:"{'rw':'"+rw+"'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(responseText){var tt=typeof responseText.d=="string"?eval("("+responseText.d+")"):responseText.d,title=tt[0].title,info=tt[0].info,ipath=tt[0].imagePath,next=tt[0].nextItem,prev=tt[0].previousItem;$("#divTopView").data("title.dialog","CPG Comic Watch #"+rw);$("IMG[ID*=simgTop]").attr("src",ipath);$("SPAN[ID*=slblInfo]").text(info);$("SPAN[ID*=slbltitle]").text(title);$("#A2").attr("rel",next);$("#A1").attr("rel",prev);$(".pn").click(function(){showPrevNext($(this))})},error:function(xhr){var err=eval("("+xhr.responseText+")");alert(err.Message)}})}function showPrevNext(obj){$("IMG[ID*=simgTop]").attr("src","images/orngLoader160.gif");var rw=obj.attr("rel");$.ajax({type:"POST",url:"services/topTenService.asmx/getSngTopTen",data:"{'rw':'"+rw+"'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(responseText){var tt=typeof responseText.d=="string"?eval("("+responseText.d+")"):responseText.d,title=tt[0].title,info=tt[0].info,ipath=tt[0].imagePath,next=tt[0].nextItem,prev=tt[0].previousItem;$("#divTopView").data("title.dialog","CPG Comic Watch #"+rw);$("IMG[ID*=simgTop]").attr("src",ipath);$("SPAN[ID*=slblInfo]").text(info);$("SPAN[ID*=slbltitle]").text(title);$("#A2").attr("rel",next);$("#A1").attr("rel",prev)},error:function(xhr){var err=eval("("+xhr.responseText+")");alert(err.Message)}})}function getNewScans(){$.ajax({type:"POST",url:"services/scans.asmx/getNewScans",data:"{}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(responseText,responseCode){for(var tt=typeof responseText.d=="string"?eval("("+responseText.d+")"):responseText.d,li=1,i=0;i<tt.length;i++){var iItem=$("#ncsi"+li);iItem.attr("src",tt[i].imgUrl);iItem.attr("alt",tt[i].imgTitle);var aItem=$("#ncsa"+li);aItem.attr("href",tt[i].lbUrl);var dItem=$("#ncsd"+li);dItem.html(tt[i].imgTitle+"<br/>"+tt[i].uploadedBy);li++}},error:function(xhr){var err=eval("("+xhr.responseText+")");alert(err.Message)}})}function getNewEbay(){var obj=$(".allissueslisting").children("#items");$.ajax({type:"POST",url:"services/ebayList.asmx/returnEbayList",data:"{'c':'20'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(responseText,responseCode){var tt=typeof responseText.d=="string"?eval("("+responseText.d+")"):responseText.d,li=0,dv=[];dv.push('<div style="margin-top:3px;">');dv.push('<table id="dlEbayItems" cellspacing="0" border="0" style="margin-left: auto;margin-right: auto;border-width:0px;border-style:None;width:854px;border-collapse:collapse;"><tr>');for(var i=0;i<tt.length;i++){if(li==5){dv.push("</tr><tr>");li=0}dv.push('<td id="tdEbayItem'+i+'" style="vertical-align:bottom;text-align:center;height:160px;border:solid 2px #ffffff; width:136px; background-image:url(/members/images/default/ebay/'+tt[i].imgLoc+');">');dv.push('<div id="pnlEbayItem'+i+'" style="background-color:#000000;height:50px; width:100%;display:none;">');dv.push('<div style="padding:5px;">');dv.push('<a id="hypEbay" href="http://rover.ebay.com/rover/1/711-6294-2978-0/1?PID=2552899&amp;AID=10381315&amp;SID=&amp;loc=http%3A%2F%2Fcgi.ebay.com%2Fws%2FeBayISAPI.dll%3FViewItem%26item%3D'+tt[i].ebayID+'%09"');dv.push(' target="_blank" style="color:#ffffff;font-family:arial;font-size:12px;font-weight:none;">'+tt[i].ebayTitle.toUpperCase()+"</a><br />");dv.push("</div>");dv.push("</div>");dv.push("</td>");li++}dv.push("</tr>");dv.push("</table>");dv.push("</div>");if(i>20){dv.push('<div style="text-align:right; padding:10px; width:800px;">');dv.push('<a href="../viewmarketplace.aspx" style="font-size:18px; color:#666666; font-weight:bold; font-family:Arial;">View More</a>');dv.push("</div>")}var msgInfo=dv.join("");obj.hide();obj.html(msgInfo).fadeIn("slow");$("TD[ID*=tdEbayItem]").mouseenter(function(){var a=$(this).children("DIV[ID*=pnlEbayItem]");a.show()});$("TD[ID*=tdEbayItem]").mouseleave(function(){var a=$(this).children("DIV[ID*=pnlEbayItem]");a.hide()});return;obj.html(msgInfo).fadeIn("slow",function(){$("img.rounded").one("load",function(){var a=$(this),e=a.parent(),d=a.width(),c=a.height(),b=$('<div class="rounded_wrapper"></div>');b.width(d);b.height(c);b.css("float",a.css("float"));a.css("float","none");b.css("margin-right",a.css("margin-right"));a.css("margin-right","0");b.css("margin-left",a.css("margin-left"));a.css("margin-left","0");b.css("margin-bottom",a.css("margin-bottom"));a.css("margin-bottom","0");b.css("margin-top",a.css("margin-top"));a.css("margin-top","0");b.css("display","block");a.css("display","block");if($.browser.msie&&$.browser.version=="6.0"){d%2!=0&&b.addClass("ie6_width");c%2!=0&&b.addClass("ie6_height")}!$.browser.msie&&e.css("padding-left","33px");a.wrap(b);a.after('<div class="tl"></div>');a.after('<div class="tr"></div>');a.after('<div class="bl"></div>');a.after('<div class="br"></div>')}).each(function(){this.complete&&$(this).trigger("load")})})},error:function(xhr){var err=eval("("+xhr.responseText+")");alert(err.Message)}})}})
