

function wopen(url,name,w,h)
{w+=32;h+=96;var win=window.open(url,name,'width='+w+', height='+h+', '+'location=no, menubar=no, '+'status=no, toolbar=no, scrollbars=no, resizable=no');win.resizeTo(w,h);win.focus();}
$(document).ready(function(){$(".expand-button, .collapse-button").click(function(){target=$(this).attr("targeting");state=$(this).attr("state");if(state=='collapsed')
{$("#"+target).slideDown();$(this).css("backgroundImage","url(http://www.thecouponbay.com/images/collapse.png)");$(this).attr("state","expanded");}
else if(state=='expanded')
{$("#"+target).slideUp();$(this).css("backgroundImage","url(http://www.thecouponbay.com/images/expand.png)");$(this).attr("state","collapsed");}});});$(document).ready(function(){$('img.Tips2').cluetip({width:'400px',splitTitle:'::',arrows:false,dropShadow:false,cluetipClass:'jtip'});$('img.Tips5').cluetip({width:'400px',splitTitle:'::',arrows:false,dropShadow:false,cluetipClass:'jtip'});$('img.Tips7').cluetip({width:'400px',splitTitle:'::',arrows:false,dropShadow:false,cluetipClass:'jtip'});$(".jtooltips").cluetip({width:'230px',splitTitle:'::',arrows:false,dropShadow:false,cluetipClass:'jtip'});$('a.Tips6[@title]').cluetip({width:'400px',splitTitle:'::',arrows:false,dropShadow:false,cluetipClass:'jtip'});$(".jtooltips2").cluetip({width:'400px',splitTitle:'::',arrows:false,dropShadow:false,cursor:'pointer',cluetipClass:'jtip'});});$(document).ready(function(){$(".jtooltips2").mouseenter(function(){var titulo=$(this).attr("titulo");var description=$(this).attr("description");var coupon=$(this).attr("coupon");var image=$(this).attr("imagen");if(coupon.length==0){var couponline1='Discount: <span style="color: orange;font-weight:bold">Embedded in Link</span>';var couponline2="Click to get deal and go to site...";}
else{var couponline1='Coupon Code: <span style="color: orange;font-weight:bold">'+coupon+'</span>';var couponline2="Click to copy coupon and go to site...";}
var description2='<table><tr><td width="110px"><img src="'+image+'" style="border: 1px solid rgb(204, 204, 204);" height="100px"></td><td align="left" valign="top" width="100%"><table align="center" style="padding-top:2px;"><tr><td><div style="border: 1px dashed grey; padding:8px;">'+couponline1+'</div></td></tr></table><div align="center" style="padding-top:8px; font-weight:bold;">'+couponline2+'</div><div align="center" style="padding:2px; font-weight:bold;">or</div><div align="center" style="padding-top:0px; font-weight:bold;">Click Details for more info</div> </td></td></tr><tr><td colspan="2"><div style="margin-top:6px">'+description+'</div></td></tr></table>';$('#cluetip-title').html(titulo);$('#cluetip-inner').html(description2);});});$(document).ready(function(){$(".stripeMe tr:even").addClass("alt");});function ShowLogo(id,action)
{temp=document.getElementById('small_logo_'+id);temp2=document.getElementById('right_coupon_'+id);if(action=="off")
{$('#small_logo_'+id).css("display","none");$('#right_coupon_'+id).addClass('right_highlite').removeClass('right_highlite_on');}
else
{$('#small_logo_'+id).css("display","block");$('#right_coupon_'+id).addClass('right_highlite_on').removeClass('right_highlite');}}
function ShowPrice(id,action)
{if(action=="off")
{$('#small_logo_'+id).css("font-size","13px");$('#right_coupon_'+id).addClass('right_highlite').removeClass('right_highlite_on');}
else
{$('#small_logo_'+id).css("font-size","14px");$('#right_coupon_'+id).addClass('right_highlite_on').removeClass('right_highlite');}}
var clip=null;ZeroClipboard.setMoviePath('http://www.thecouponbay.com/css/ZeroClipboard.swf');clip=new ZeroClipboard.Client();clip.setHandCursor(true);function flashChecker()
{var hasFlash=0;var flashVersion=0;if(document.all){var swf=new ActiveXObject('ShockwaveFlash.ShockwaveFlash');if(swf){hasFlash=1;VSwf=swf.GetVariable("$version");flashVersion=parseInt(VSwf.split(" ")[1].split(",")[0]);}}
else{if(navigator.plugins&&navigator.plugins.length>0){var theswf=navigator.plugins["Shockwave Flash"];if(theswf){hasFlash=1;var words=theswf.description.split(" ");for(var i=0;i<words.length;++i)
{if(isNaN(parseInt(words[i])))continue;flashVersion=parseInt(words[i]);}}}}
return{f:hasFlash,v:flashVersion};}
function Zclipboard(coupon,url,object,container,mode)
{if(mode=="manual")
{$('#'+object).css("display","block");}
$('.zeroclip').remove();ZeroClipboard.setMoviePath('http://www.thecouponbay.com/css/ZeroClipboard.swf');clip=new ZeroClipboard.Client();clip.setHandCursor(true);var fls=flashChecker();if(fls.f==1&&fls.v>8){clip.setText(coupon);clip.glue(object,container);clip.setEventListener('mouseup',function(client){window.open(url);});}}
(function($){$.fn.equalHeights=function(minHeight,maxHeight){tallest=(minHeight)?minHeight:0;this.each(function(){if($(this).height()>tallest){tallest=$(this).height();}});if((maxHeight)&&tallest>maxHeight)tallest=maxHeight;return this.each(function(){$(this).height(tallest).css("overflow","auto");});}})(jQuery);$(document).ready(function(){$(".jtooltips3").cluetip({width:'400px',splitTitle:'::',arrows:false,dropShadow:false,cursor:'pointer',cluetipClass:'jtip'});$(".jtooltips3").mouseenter(function(){var images=$(this).attr("image_list").split('**');var descriptions=$(this).attr("description_list").split('**');var fprices=$(this).attr("fprice_list").split('**');var titulo=$(this).attr("titulo");var total=$(this).attr("total");var maximo=5;var coupon=$(this).attr("coupon");if(coupon==''){var type='associated to this offer';var type2=type;var word='deal'}else{var type='that uses this coupon';var type2='that use this coupon';var word='deals'}
if(total>maximo){var appended=". For example:";}else{var appended=":";}
var howmany=images.length;if(howmany==1){var intro='There is <span style="font-weight:bold; color:gold">1 deal</span> '+type+appended;}
else{var intro='There are <span style="font-weight:bold; color:gold">'+total+' deals </span>'+type2+appended;}
var description2='<table cellpadding="2"><tr><td colspan="2" style="padding-bottom:8px">'+intro+'</td></tr>';$.each(images,function(index){var image=images[index];var description=descriptions[index];var fprice=fprices[index];description2=description2+'<tr><td width="60px" style="padding-bottom:7px"><img src="'+image+'" style="border: 1px solid rgb(204, 204, 204);" height="47px" width="61px"></td><td style="padding-bottom:7px">'+description+' <b>» &nbsp;</b><span style="color: orange;font-weight:bold">$'+fprice+'</span></td></tr>';});description2=description2+'<tr><td style="font-weight:bold; color:gold; padding-top:6px;" colspan="2">Click to view the '+word+'...</td></tr></table>';if(coupon.length==0){var couponline1='Discount: <span style="color: orange;font-weight:bold">Embedded in Link</span>';var couponline2="Click to get deal and go to site...";}
else{var couponline1='Coupon Code: <span style="color: orange;font-weight:bold">'+coupon+'</span>';var couponline2="Click to copy coupon and go to site...";}
$('#cluetip-title').html(titulo);$('#cluetip-inner').html(description2);});});$(document).ready(function(){$('.featured_coupon_td').mouseenter(function(){$(this).addClass("featured_coupon_on");var what=$(this).attr("selection");if(what=='coupon'){$('span',this).addClass("featured_coupon_span_on");}
else if(what=='scissors'){$('a',this).addClass("featured_scissors_on");}
else if(what=='plus'){$('a',this).addClass("featured_plus_on");}}).mouseleave(function(){$(this).removeClass("featured_coupon_on");var what=$(this).attr("selection");if(what=='coupon'){$('span',this).removeClass("featured_coupon_span_on");}
else if(what=='scissors'){$('a',this).removeClass("featured_scissors_on");}
else if(what=='plus'){$('a',this).removeClass("featured_plus_on");}});$('.featured_intro_expand').click(function(){var state=$(this).attr("state");if(state=='0')
{$('.featured_expandcollapse',$(this).parent().parent()).css("display","block");$(this).attr("state","1");$(this).html('(Less)');}
else
{$('.featured_expandcollapse',$(this).parent().parent()).css("display","none");$(this).attr("state","0");$(this).html('(More)');}});$('.top_product_thumb').css("opacity",0.85);$('.top_product_getoffer').css('opacity',0.85);$('.noborder4').parent().parent().parent().parent().css("border","none");$('.featured_intro').equalHeights();$('.featured_intro').parent().addClass('top_product_container');$('.top_product_container').mouseenter(function(){$(this).css("background-color","rgb(246, 248, 250)");$('.top_product_images',this).addClass("top_product_images_on");$('.top_product_ftitle',this).css("background-color","#527ab6");$('.top_product_ftitle_span',this).addClass("top_product_ftitle_span_on");$('.top_product_so_links a',this).css('color','#0066CC');$('.top_product_saleprice',this).addClass("top_product_saleprice_on");$('.top_product_thumb',this).css("opacity",1);$('.top_product_getoffer',this).css("opacity",1);}).mouseleave(function(){$(this).css("background-color","");$('.top_product_images',this).removeClass("top_product_images_on");$('.top_product_ftitle',this).css("background-color","#eeeeee");$('.top_product_ftitle_span',this).removeClass("top_product_ftitle_span_on");$('.top_product_so_links a',this).css('color','');$('.top_product_saleprice',this).removeClass("top_product_saleprice_on");$('.top_product_thumb',this).css("opacity",0.85);$('.top_product_getoffer',this).css('opacity',0.85);});});$(document).ready(function(){item_width_array=new Array();left_value_array=new Array();$("div[name^='featured_carousel']").each(function(index){var width_carousel=$(this).outerWidth();jQuery("#slides",this).css("width",width_carousel);jQuery("#slides ul li",this).css("width",width_carousel);var number_slides=$("#slides ul li").length;jQuery("#slides ul",this).css("width",width_carousel*number_slides);if(number_slides>1)
{var newwidth=width_carousel-20;jQuery("#buttons_right",$(this).parent()).css("left",newwidth+"px");}
number=$(this).attr("number");item_width=jQuery("#slides li",this).outerWidth();var left_value=item_width*(-1);item_width_array[number]=item_width;left_value_array[number]=left_value;$('#slides li:first',this).before($('#slides li:last',this));$('#slides ul',this).css({'left':left_value});});$('.prev').click(function(){var a=$(this).attr("targeting");var item_width_temp=item_width_array[a];var left_value_temp=left_value_array[a];var obj=$("div[name='featured_carousel_"+a+"']");var left_indent=parseInt($('#slides ul',obj).css('left'))+item_width_temp;$('#slides ul:not(:animated)',obj).animate({'left':left_indent},200,function(){$('#slides li:first',obj).before($('#slides li:last',obj));$('#slides ul',obj).css({'left':left_value_temp});});return false;});$('.next').click(function(){var a=$(this).attr("targeting");var item_width_temp=item_width_array[a];var left_value_temp=left_value_array[a];var obj=$("div[name='featured_carousel_"+a+"']");var left_indent=parseInt($('#slides ul',obj).css('left'))-item_width_temp;$('#slides ul:not(:animated)',obj).animate({'left':left_indent},200,function(){$('#slides li:last',obj).after($('#slides li:first',obj));$('#slides ul',obj).css({'left':left_value_temp});});return false;});});$(document).ready(function(){(function($){var version='1.1';var locationPath=filterPath(location.pathname);$.fn.extend({smoothScroll:function(options){this.each(function(){var opts=$.extend({},$.fn.smoothScroll.defaults,options);$(this).bind('click',function(event){var link=this,$link=$(this),hostMatch=((location.hostname===link.hostname)||!link.hostname),pathMatch=opts.scrollTarget||(filterPath(link.pathname)||locationPath)===locationPath,thisHash=link.hash&&'#'+link.hash.replace('#',''),include=true;if(!opts.scrollTarget&&(!hostMatch||!pathMatch||thisHash.length==1)){include=false;}else{var exclude=opts.exclude,elCounter=0,el=exclude.length;while(include&&elCounter<el){if($link.is(exclude[elCounter++])){include=false;}}
var excludeWithin=opts.excludeWithin,ewlCounter=0,ewl=excludeWithin.length;while(include&&ewlCounter<ewl){if($link.parents(excludeWithin[ewlCounter++]+':first').length){include=false;}}}
if(include){opts.scrollTarget=opts.scrollTarget||thisHash;opts.link=link;event.preventDefault();$.smoothScroll(opts);}});});return this;}});$.smoothScroll=function(options,px){var opts,scrollTargetOffset,scrollElem=scrollableElement('html','body');if(typeof options==='number'){opts=$.fn.smoothScroll.defaults;scrollTargetOffset=options;}else{opts=$.extend({},$.fn.smoothScroll.defaults,options);scrollTargetOffset=px||$(opts.scrollTarget).offset().top;}
opts=$.extend({link:null},opts);$(scrollElem).animate({scrollTop:scrollTargetOffset+opts.offset},{duration:opts.speed,easing:opts.easing,complete:function(){if(opts.afterScroll&&$.isFunction(opts.afterScroll)){opts.afterScroll.call(opts.link,opts);}}});};$.smoothScroll.version=version;$.fn.smoothScroll.defaults={exclude:[],excludeWithin:[],offset:0,scrollTarget:null,afterScroll:null,easing:'swing',speed:400};function scrollableElement(els){for(var i=0,argLength=arguments.length;i<argLength;i++){var el=arguments[i],$scrollElement=$(el);if($scrollElement.scrollTop()>0){return el;}else{$scrollElement.scrollTop(1);var isScrollable=$scrollElement.scrollTop()>0;$scrollElement.scrollTop(0);if(isScrollable){return el;}}}
return[];}
function filterPath(string){return string.replace(/^\//,'').replace(/(index|default).[a-zA-Z]{3,4}$/,'').replace(/\/$/,'');}})(jQuery);});$(document).ready(function(){$('.top_product_container a').smoothScroll({afterScroll:function(){}});});