/*!
 * $Id: common.js 2531 2010-08-17 18:41:34Z mloftis $
 *
 * Common javascript, eg page ready.
 * Must be loaded AFTER the jQuery modules.
 */
if(!Array.prototype.indexOf){Array.prototype.indexOf=function(b){var a=this.length;var c=Number(arguments[1])||0;c=(c<0)?Math.ceil(c):Math.floor(c);if(c<0){c+=a}for(;c<a;c++){if(c in this&&this[c]===b){return c}}return -1}}var ratingStarsRunOn=[];function getCookieVal(b){var a=document.cookie.indexOf(";",b);if(a==-1){a=document.cookie.length}return unescape(document.cookie.substring(b,a))}function GetCookie(d){var b=d+"=";var f=b.length;var a=document.cookie.length;var e=0;while(e<a){var c=e+f;if(document.cookie.substring(e,c)==b){return getCookieVal(c)}e=document.cookie.indexOf(" ",e)+1;if(e==0){break}}return null}function SetCookie(c,e){var a=SetCookie.arguments;var h=SetCookie.arguments.length;var b=(h>2)?a[2]:null;var g=(h>3)?a[3]:null;var d=(h>4)?a[4]:null;var f=(h>5)?a[5]:false;cookiestr=c+"="+escape(e)+((b==null)?"":("; expires="+b.toGMTString()))+((g==null)?"":("; path="+g))+((d==null)?"":("; domain="+d))+((f==true)?"; secure":"");document.cookie=cookiestr}var ep_pageView=GetCookie("cm-exit-pop-view");var ep_pop=GetCookie("cm-exit-pop-count");if(ep_pageView==null){ep_pageView=0}else{ep_pageView=parseInt(ep_pageView)}if(ep_pop==null){ep_pop=0}else{ep_pop=parseInt(ep_pop)}function ratingStars(a){var b={style:a.rating_style,curvalue:a.current_rating,maxvalue:a.max_rating,isStatic:a.rating_static,statid:$("#"+a.div_name+"res"),fbkid:$("#"+a.div_name+"fbk"),numvotes:a.numvotes};if(ratingStarsRunOn.indexOf(a.div_name)==-1){ratingStarsRunOn.push(a.div_name);$("div#"+a.div_name).sp3rater(a.rating_callback_url,b)}}var loadpieceInfo={lasturl:null};function loadPaginatedPiece(a,b){loadpieceInfo.lasturl=a;$(b).load(a,function(){var c=b+" a";c=b+" a.clickclass";$(c).click(function(){var d=$(this).attr("href");loadPaginatedPiece(d,b);return false})})}var THUMBS_HTTP_ROOT="";var thumb_t_ID=null;var thumb_t_selected=null;$(document).ready(function(){if(false){$("div#homenews").corner("2px");$("div#homepics").corner("bottom 2px");$("div#homevideonew").corner("bottom 2px");$("div#video_meta").corner("bottom 2px");$("div.roundedbottom").corner("bottom 2px");$("div.roundedtop").corner("top 2px");$("div.rounded").corner("2px");$("h1.header").corner("top 2px");$("h1.related").corner("3px");$("h1.comments_full").corner("3px");$(".row_full_width_pics").corner("2px");$(".row").corner("bottom 2px");$("#member").corner("2px");$("#recommendedlinks").corner("bottom 2px")}$("#related_video .videolist:nth-child(4n)").addClass("last");var b=[];$.preLoadImages=function(d){for(var e=0;e<d.length;e++){var c=document.createElement("img");c.src=d[e];b.push(c)}};$.cicleThumbsfrom=function(c){thumb_t_selected++;if(thumb_t_selected>=c.thumbs.length){thumb_t_selected=1}c.attr("src",c.thumbs[thumb_t_selected])};try{$("img.rotate-thumbs").livequery("mouseenter",function(){clearInterval(thumb_t_ID);var c=$(this);var d=c.metadata();c.thumbs=new Array();i=0;for(thumb in d.ethumbs){c.thumbs[i]=THUMBS_HTTP_ROOT+d.ethumbs[thumb];i++}$.preLoadImages(c.thumbs);$.cicleThumbsfrom(c);thumb_t_ID=setInterval(function(){$.cicleThumbsfrom(c)},500)})}catch(a){console.log(a.message)}try{$("img.rotate-thumbs").livequery("mouseleave",function(){var c=$(this);var d=c.metadata();c.attr("src",THUMBS_HTTP_ROOT+d.selected_thumb);clearInterval(thumb_t_ID);thumb_t_selected=null})}catch(a){console.log(a.message)}});
