$(document).ready(function(){ $(".sub_ad_box a").click(function(){ var g = $(this).attr("id"); $(this).attr("href","javascript:void(0);"); wait("on",$(".mm").position().left-8,$(".mm").position().top-(-77),$(".mm").width()-(-16),$(".mm").height()-(-42),"#FFFFFF"); $.get("http://www.skayo.ch/includes/home_ad_table.php",{ g: g },function(data){ $(".mm").html(data); $(".sub_ad_box a").removeAttr("style"); if(g == "top") $("#"+g).attr("style","background-image: url(http://www.skayo.ch/style/img/design/sub_ad_box_left_3.gif); border-top-color: #F0F0F0;"); else if(g == "popular") $("#"+g).attr("style","background-color: #F0F0F0; border-top-color: #F0F0F0; border-bottom-color: #D7D7D7;"); else if(g == "new") $("#"+g).attr("style","background-image: url(http://www.skayo.ch/style/img/design/sub_ad_box_right_3.gif); border-top-color: #F0F0F0;"); ad_product_detail_mouseover(); wait("off"); }); }); $(".sub_ad_box a").click(function(){ $(this).blur(); }); ad_product_detail_mouseover(); ad_product_detail_mouseout(); }); function ad_product_detail_mouseover(){ $(".ad_frame_foreground img").mouseover(function(){ var new_title = $(this).attr("title").substr(0,$(this).attr("title").lastIndexOf(",")); new_title = new_title.length > 35 ? new_title.substr(0,32) + "..." : new_title; var new_price = $(this).attr("title").substr($(this).attr("title").lastIndexOf(",")-(-1),99); var new_content = '<table cellspacing="0" cellpadding="5" border="0" width="100%" height="100%"><tr><td height="150" align="center" valign="middle" colspan="2" style="border-bottom: 1px solid #DCDCDC;"><a href="' + $(this).parent().attr("href") + '"><img src="' + $(this).attr("src") + '" width="' + (($(this).attr("width")/80)*150) + '" height="' + (($(this).attr("height")/80)*150) + '" border="0"></a><br></td></tr><tr><td height="35" align="left" valign="middle">' + new_title + '</td><td align="right" valign="middle"><b>' + new_price + '</b></td></tr></table>'; $("#ad_frame_product_details").html(new_content).show().css({ "top" : ($(this).parent().parent().position().top-160) + "px", "left" : ($(this).parent().parent().position().left-44) + "px" }); $("#ad_frame_product_details img").attr("src",$(this).attr("src").replace(new RegExp("\_s\.jpg"), "_m.jpg")); }); } function ad_product_detail_mouseout(){ $("#ad_frame_product_details").mouseout(function(){ $("#ad_frame_product_details").hide(); }); }
