function emailafriend(emailurl) {
	window.open(emailurl, "EmailAFriend", "menubar=no,width=400,height=280,toolbar=no");
}

function viewvideocomment(url) {
	window.open(url, "VideoComment", "menubar=no,width=330,height=300,toolbar=no");
}

function popupwindow(url, height, width) {
	height = typeof (height) != 'undefined' ? height : 300;
	width = typeof (width) != 'undefined' ? width : 340;
	newwindow = window.open(url, 'name', 'height=' + height + ',width=' + width);
	if(window.focus) {
		newwindow.focus()
	}
	return false;
}

function getwebcamstatus(captureid, originalwidgetid, token) {
	var mytime = '&ms=' + new Date().getTime();
	var status = -1;
	var statusurl = '/ajax/api.php?q=webcamstatus&c=' + captureid + '&v=' + originalwidgetid + '&t=' + token + mytime;
	$.get(statusurl, function(text) {
		status = text;
	});
	return status;
}

function completeupload(captureid, originalwidgetid, token) {
	var mytime = '&ms=' + new Date().getTime();
	var status = -1;

	var statusurl = '/ajax/api.php?q=completeupload&c=' + captureid + '&v=' + originalwidgetid + '&t=' + token + mytime;
	$.get(statusurl, function(text) {
		status = text;
	});
	return status;
}

function additionalinfo(captureid, token, widgetid) {
	var mytime = '&ms=' + new Date().getTime();
	var m = encodeURI($("#message").val());
	var n = encodeURI($("#name").val());
	var f = encodeURI($("#email").val());

	var updateinfo = '/ajax/api.php?q=finishsubmission&c=' + captureid + '&v=' + widgetid + '&m=' + m + '&n=' + n + '&f=' + f + '&t=' + token + mytime;
	$.get(updateinfo, function(data) {
		$("#response").text(data);
	});
	return true;
}

function fireLikeCallback(href) {
	var url = "/liveclicker/facebook.php?aid=" + aid + "&widget_id=" + widgetid + "url=" + href;
	jQuery.get(url, function() {
		// response
	});
	return false;
}

/* rating.js */
function sndReq(vote, id_num, ip_num, units, media_type) {
	var URL = '/liveclicker/rating_rpc.php?j=' + vote + '&q=' + id_num + '&t=' + ip_num + '&c=' + units + '&m=' + media_type;
	$.getJSON(URL, function(data) {
		$.each(data.items, function(i, item) {
			var mydivID = item.divID;
			var mycontent = item.content;
			$("#" + mydivID).html(mycontent);
		});
	});
}

/*  jCarousel - Riding carousels with jQuery  */
eval( function(p, a, c, k, e, r) {
	e = function(c) {
		return (c < a ? '' : e(parseInt(c / a))) + (( c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36))
	};
	if(!''.replace(/^/, String)) {
		while(c--)
		r[e(c)] = k[c] || e(c);
		k = [
		function(e) {
			return r[e]
		}];

		e = function() {
			return '\\w+'
		};
		c = 1
	};
	while(c--)
	if(k[c])
		p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]);
	return p
}('(9($){$.1v.C=9(o){z 4.1b(9(){3p r(4,o)})};8 q={Z:F,25:1,21:1,u:7,1c:3,15:7,1K:\'2X\',2c:\'2Q\',1q:0,B:7,1j:7,1G:7,2F:7,2B:7,2z:7,2x:7,2v:7,2s:7,2p:7,1S:\'<P></P>\',1Q:\'<P></P>\',2m:\'2l\',2k:\'2l\',1O:7,1L:7};$.C=9(e,o){4.5=$.16({},q,o||{});4.Q=F;4.D=7;4.H=7;4.t=7;4.U=7;4.R=7;4.N=!4.5.Z?\'1H\':\'26\';4.E=!4.5.Z?\'24\':\'23\';8 a=\'\',1e=e.K.1e(\' \');1r(8 i=0;i<1e.I;i++){6(1e[i].2y(\'C-2w\')!=-1){$(e).1E(1e[i]);8 a=1e[i];1p}}6(e.2t==\'3o\'||e.2t==\'3n\'){4.t=$(e);4.D=4.t.19();6(4.D.1o(\'C-H\')){6(!4.D.19().1o(\'C-D\'))4.D=4.D.B(\'<P></P>\');4.D=4.D.19()}10 6(!4.D.1o(\'C-D\'))4.D=4.t.B(\'<P></P>\').19()}10{4.D=$(e);4.t=$(e).3h(\'>2o,>2n,P>2o,P>2n\')}6(a!=\'\'&&4.D.19()[0].K.2y(\'C-2w\')==-1)4.D.B(\'<P 3g=" \'+a+\'"></P>\');4.H=4.t.19();6(!4.H.I||!4.H.1o(\'C-H\'))4.H=4.t.B(\'<P></P>\').19();4.R=$(\'.C-11\',4.D);6(4.R.u()==0&&4.5.1Q!=7)4.R=4.H.1z(4.5.1Q).11();4.R.V(4.K(\'C-11\'));4.U=$(\'.C-17\',4.D);6(4.U.u()==0&&4.5.1S!=7)4.U=4.H.1z(4.5.1S).11();4.U.V(4.K(\'C-17\'));4.H.V(4.K(\'C-H\'));4.t.V(4.K(\'C-t\'));4.D.V(4.K(\'C-D\'));8 b=4.5.15!=7?1k.1P(4.1m()/4.5.15):7;8 c=4.t.32(\'1F\');8 d=4;6(c.u()>0){8 f=0,i=4.5.21;c.1b(9(){d.1I(4,i++);f+=d.S(4,b)});4.t.y(4.N,f+\'T\');6(!o||o.u===J)4.5.u=c.u()}4.D.y(\'1y\',\'1A\');4.U.y(\'1y\',\'1A\');4.R.y(\'1y\',\'1A\');4.2G=9(){d.17()};4.2b=9(){d.11()};4.1U=9(){d.2q()};6(4.5.1j!=7)4.5.1j(4,\'2a\');6($.2A.28){4.1f(F,F);$(27).1u(\'2I\',9(){d.1t()})}10 4.1t()};8 r=$.C;r.1v=r.2H={C:\'0.2.3\'};r.1v.16=r.16=$.16;r.1v.16({1t:9(){4.A=7;4.G=7;4.X=7;4.13=7;4.14=F;4.1d=7;4.O=7;4.W=F;6(4.Q)z;4.t.y(4.E,4.1s(4.5.21)+\'T\');8 p=4.1s(4.5.25);4.X=4.13=7;4.1i(p,F);$(27).22(\'2E\',4.1U).1u(\'2E\',4.1U)},2D:9(){4.t.2C();4.t.y(4.E,\'3u\');4.t.y(4.N,\'3t\');6(4.5.1j!=7)4.5.1j(4,\'2D\');4.1t()},2q:9(){6(4.O!=7&&4.W)4.t.y(4.E,r.M(4.t.y(4.E))+4.O);4.O=7;4.W=F;6(4.5.1G!=7)4.5.1G(4);6(4.5.15!=7){8 a=4;8 b=1k.1P(4.1m()/4.5.15),N=0,E=0;$(\'1F\',4.t).1b(9(i){N+=a.S(4,b);6(i+1<a.A)E=N});4.t.y(4.N,N+\'T\');4.t.y(4.E,-E+\'T\')}4.1c(4.A,F)},3s:9(){4.Q=1h;4.1f()},3r:9(){4.Q=F;4.1f()},u:9(s){6(s!=J){4.5.u=s;6(!4.Q)4.1f()}z 4.5.u},3q:9(i,a){6(a==J||!a)a=i;6(4.5.u!==7&&a>4.5.u)a=4.5.u;1r(8 j=i;j<=a;j++){8 e=4.L(j);6(!e.I||e.1o(\'C-1a-1D\'))z F}z 1h},L:9(i){z $(\'.C-1a-\'+i,4.t)},2u:9(i,s){8 e=4.L(i),20=0,2u=0;6(e.I==0){8 c,e=4.1B(i),j=r.M(i);1n(c=4.L(--j)){6(j<=0||c.I){j<=0?4.t.2r(e):c.1X(e);1p}}}10 20=4.S(e);e.1E(4.K(\'C-1a-1D\'));1R s==\'3l\'?e.3k(s):e.2C().3j(s);8 a=4.5.15!=7?1k.1P(4.1m()/4.5.15):7;8 b=4.S(e,a)-20;6(i>0&&i<4.A)4.t.y(4.E,r.M(4.t.y(4.E))-b+\'T\');4.t.y(4.N,r.M(4.t.y(4.N))+b+\'T\');z e},1V:9(i){8 e=4.L(i);6(!e.I||(i>=4.A&&i<=4.G))z;8 d=4.S(e);6(i<4.A)4.t.y(4.E,r.M(4.t.y(4.E))+d+\'T\');e.1V();4.t.y(4.N,r.M(4.t.y(4.N))-d+\'T\')},17:9(){4.1C();6(4.O!=7&&!4.W)4.1T(F);10 4.1c(((4.5.B==\'1Z\'||4.5.B==\'G\')&&4.5.u!=7&&4.G==4.5.u)?1:4.A+4.5.1c)},11:9(){4.1C();6(4.O!=7&&4.W)4.1T(1h);10 4.1c(((4.5.B==\'1Z\'||4.5.B==\'A\')&&4.5.u!=7&&4.A==1)?4.5.u:4.A-4.5.1c)},1T:9(b){6(4.Q||4.14||!4.O)z;8 a=r.M(4.t.y(4.E));!b?a-=4.O:a+=4.O;4.W=!b;4.X=4.A;4.13=4.G;4.1i(a)},1c:9(i,a){6(4.Q||4.14)z;4.1i(4.1s(i),a)},1s:9(i){6(4.Q||4.14)z;6(4.5.B!=\'18\')i=i<1?1:(4.5.u&&i>4.5.u?4.5.u:i);8 a=4.A>i;8 b=r.M(4.t.y(4.E));8 f=4.5.B!=\'18\'&&4.A<=1?1:4.A;8 c=a?4.L(f):4.L(4.G);8 j=a?f:f-1;8 e=7,l=0,p=F,d=0;1n(a?--j>=i:++j<i){e=4.L(j);p=!e.I;6(e.I==0){e=4.1B(j).V(4.K(\'C-1a-1D\'));c[a?\'1z\':\'1X\'](e)}c=e;d=4.S(e);6(p)l+=d;6(4.A!=7&&(4.5.B==\'18\'||(j>=1&&(4.5.u==7||j<=4.5.u))))b=a?b+d:b-d}8 g=4.1m();8 h=[];8 k=0,j=i,v=0;8 c=4.L(i-1);1n(++k){e=4.L(j);p=!e.I;6(e.I==0){e=4.1B(j).V(4.K(\'C-1a-1D\'));c.I==0?4.t.2r(e):c[a?\'1z\':\'1X\'](e)}c=e;8 d=4.S(e);6(d==0){3f(\'3e: 3d 1H/26 3c 1r 3b. 3a 39 38 37 36 35. 34...\');z 0}6(4.5.B!=\'18\'&&4.5.u!==7&&j>4.5.u)h.33(e);10 6(p)l+=d;v+=d;6(v>=g)1p;j++}1r(8 x=0;x<h.I;x++)h[x].1V();6(l>0){4.t.y(4.N,4.S(4.t)+l+\'T\');6(a){b-=l;4.t.y(4.E,r.M(4.t.y(4.E))-l+\'T\')}}8 n=i+k-1;6(4.5.B!=\'18\'&&4.5.u&&n>4.5.u)n=4.5.u;6(j>n){k=0,j=n,v=0;1n(++k){8 e=4.L(j--);6(!e.I)1p;v+=4.S(e);6(v>=g)1p}}8 o=n-k+1;6(4.5.B!=\'18\'&&o<1)o=1;6(4.W&&a){b+=4.O;4.W=F}4.O=7;6(4.5.B!=\'18\'&&n==4.5.u&&(n-k+1)>=1){8 m=r.Y(4.L(n),!4.5.Z?\'1l\':\'1N\');6((v-m)>g)4.O=v-g-m}1n(i-->o)b+=4.S(4.L(i));4.X=4.A;4.13=4.G;4.A=o;4.G=n;z b},1i:9(p,a){6(4.Q||4.14)z;4.14=1h;8 b=4;8 c=9(){b.14=F;6(p==0)b.t.y(b.E,0);6(b.5.B==\'1Z\'||b.5.B==\'G\'||b.5.u==7||b.G<b.5.u)b.2j();b.1f();b.1M(\'2i\')};4.1M(\'31\');6(!4.5.1K||a==F){4.t.y(4.E,p+\'T\');c()}10{8 o=!4.5.Z?{\'24\':p}:{\'23\':p};4.t.1i(o,4.5.1K,4.5.2c,c)}},2j:9(s){6(s!=J)4.5.1q=s;6(4.5.1q==0)z 4.1C();6(4.1d!=7)z;8 a=4;4.1d=30(9(){a.17()},4.5.1q*2Z)},1C:9(){6(4.1d==7)z;2Y(4.1d);4.1d=7},1f:9(n,p){6(n==J||n==7){8 n=!4.Q&&4.5.u!==0&&((4.5.B&&4.5.B!=\'A\')||4.5.u==7||4.G<4.5.u);6(!4.Q&&(!4.5.B||4.5.B==\'A\')&&4.5.u!=7&&4.G>=4.5.u)n=4.O!=7&&!4.W}6(p==J||p==7){8 p=!4.Q&&4.5.u!==0&&((4.5.B&&4.5.B!=\'G\')||4.A>1);6(!4.Q&&(!4.5.B||4.5.B==\'G\')&&4.5.u!=7&&4.A==1)p=4.O!=7&&4.W}8 a=4;4.U[n?\'1u\':\'22\'](4.5.2m,4.2G)[n?\'1E\':\'V\'](4.K(\'C-17-1w\')).1J(\'1w\',n?F:1h);4.R[p?\'1u\':\'22\'](4.5.2k,4.2b)[p?\'1E\':\'V\'](4.K(\'C-11-1w\')).1J(\'1w\',p?F:1h);6(4.U.I>0&&(4.U[0].1g==J||4.U[0].1g!=n)&&4.5.1O!=7){4.U.1b(9(){a.5.1O(a,4,n)});4.U[0].1g=n}6(4.R.I>0&&(4.R[0].1g==J||4.R[0].1g!=p)&&4.5.1L!=7){4.R.1b(9(){a.5.1L(a,4,p)});4.R[0].1g=p}},1M:9(a){8 b=4.X==7?\'2a\':(4.X<4.A?\'17\':\'11\');4.12(\'2F\',a,b);6(4.X!==4.A){4.12(\'2B\',a,b,4.A);4.12(\'2z\',a,b,4.X)}6(4.13!==4.G){4.12(\'2x\',a,b,4.G);4.12(\'2v\',a,b,4.13)}4.12(\'2s\',a,b,4.A,4.G,4.X,4.13);4.12(\'2p\',a,b,4.X,4.13,4.A,4.G)},12:9(a,b,c,d,e,f,g){6(4.5[a]==J||(1R 4.5[a]!=\'2h\'&&b!=\'2i\'))z;8 h=1R 4.5[a]==\'2h\'?4.5[a][b]:4.5[a];6(!$.2W(h))z;8 j=4;6(d===J)h(j,c,b);10 6(e===J)4.L(d).1b(9(){h(j,4,d,c,b)});10{1r(8 i=d;i<=e;i++)6(i!==7&&!(i>=f&&i<=g))4.L(i).1b(9(){h(j,4,i,c,b)})}},1B:9(i){z 4.1I(\'<1F></1F>\',i)},1I:9(e,i){8 a=$(e).V(4.K(\'C-1a\')).V(4.K(\'C-1a-\'+i));a.1J(\'2V\',i);z a},K:9(c){z c+\' \'+c+(!4.5.Z?\'-2U\':\'-Z\')},S:9(e,d){8 a=e.2g!=J?e[0]:e;8 b=!4.5.Z?a.1x+r.Y(a,\'2f\')+r.Y(a,\'1l\'):a.2e+r.Y(a,\'2d\')+r.Y(a,\'1N\');6(d==J||b==d)z b;8 w=!4.5.Z?d-r.Y(a,\'2f\')-r.Y(a,\'1l\'):d-r.Y(a,\'2d\')-r.Y(a,\'1N\');$(a).y(4.N,w+\'T\');z 4.S(a)},1m:9(){z!4.5.Z?4.H[0].1x-r.M(4.H.y(\'2T\'))-r.M(4.H.y(\'2S\')):4.H[0].2e-r.M(4.H.y(\'2R\'))-r.M(4.H.y(\'3i\'))},2P:9(i,s){6(s==J)s=4.5.u;z 1k.2O((((i-1)/s)-1k.2N((i-1)/s))*s)+1}});r.16({3m:9(d){z $.16(q,d||{})},Y:9(e,p){6(!e)z 0;8 a=e.2g!=J?e[0]:e;6(p==\'1l\'&&$.2A.28){8 b={\'1y\':\'1A\',\'2M\':\'2L\',\'1H\':\'1q\'},1Y,1W;$.29(a,b,9(){1Y=a.1x});b[\'1l\']=0;$.29(a,b,9(){1W=a.1x});z 1W-1Y}z r.M($.y(a,p))},M:9(v){v=2K(v);z 2J(v)?0:v}})})(3v);', 62, 218, '||||this|options|if|null|var|function||||||||||||||||||||list|size||||css|return|first|wrap|jcarousel|container|lt|false|last|clip|length|undefined|className|get|intval|wh|tail|div|locked|buttonPrev|dimension|px|buttonNext|addClass|inTail|prevFirst|margin|vertical|else|prev|callback|prevLast|animating|visible|extend|next|circular|parent|item|each|scroll|timer|split|buttons|jcarouselstate|true|animate|initCallback|Math|marginRight|clipping|while|hasClass|break|auto|for|pos|setup|bind|fn|disabled|offsetWidth|display|before|block|create|stopAuto|placeholder|removeClass|li|reloadCallback|width|format|attr|animation|buttonPrevCallback|notify|marginBottom|buttonNextCallback|ceil|buttonPrevHTML|typeof|buttonNextHTML|scrollTail|funcResize|remove|oWidth2|after|oWidth|both|old|offset|unbind|top|left|start|height|window|safari|swap|init|funcPrev|easing|marginTop|offsetHeight|marginLeft|jquery|object|onAfterAnimation|startAuto|buttonPrevEvent|click|buttonNextEvent|ol|ul|itemVisibleOutCallback|reload|prepend|itemVisibleInCallback|nodeName|add|itemLastOutCallback|skin|itemLastInCallback|indexOf|itemFirstOutCallback|browser|itemFirstInCallback|empty|reset|resize|itemLoadCallback|funcNext|prototype|load|isNaN|parseInt|none|float|floor|round|index|swing|borderTopWidth|borderRightWidth|borderLeftWidth|horizontal|jcarouselindex|isFunction|normal|clearTimeout|1000|setTimeout|onBeforeAnimation|children|push|Aborting|loop|infinite|an|cause|will|This|items|set|No|jCarousel|alert|class|find|borderBottomWidth|append|html|string|defaults|OL|UL|new|has|unlock|lock|10px|0px|jQuery'.split('|'), 0, {}))

function mycarousel_initCallback(carousel) {
	// Disable autoscrolling if the user clicks the prev or next button.
	carousel.buttonNext.bind('click', function() {
		carousel.startAuto(0);
	});

	carousel.buttonPrev.bind('click', function() {
		carousel.startAuto(0);
	});
	// Pause autoscrolling if the user moves with the cursor over the clip.
	carousel.clip.hover(function() {
		carousel.stopAuto();
	}, function() {
		carousel.startAuto();
	});

	jQuery("#page-1").bind('click', function() {
		carousel.scroll(1);
		carousel.startAuto(0);
		return false;
	});
	jQuery("#page-2").bind('click', function() {
		carousel.scroll(5);
		carousel.startAuto(0);
		return false;
	});
	jQuery("#page-3").bind('click', function() {
		carousel.scroll(9);
		carousel.startAuto(0);
		return false;
	});
};

function itemVisible(carousel, item, idx, state) {
	if(idx == 1) {
		jQuery(".page").css("background-position", "0 0");
	} else if(idx == 5) {
		jQuery(".page").css("background-position", "0 -10px");
	} else if(idx == 9) {
		jQuery(".page").css("background-position", "0 -20px");
	}
	;
};

/* ============================================================================================================ */
/* DIMENSIONS */
/* ============================================================================================================ */
eval( function(p, a, c, k, e, r) {
	e = function(c) {
		return (c < a ? '' : e(parseInt(c / a))) + (( c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36))
	};
	if(!''.replace(/^/, String)) {
		while(c--)
		r[e(c)] = k[c] || e(c);
		k = [
		function(e) {
			return r[e]
		}];

		e = function() {
			return '\\w+'
		};
		c = 1
	};
	while(c--)
	if(k[c])
		p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]);
	return p
}('(7($){p e=$.11.D,r=$.11.r;$.11.A({D:7(){4(1[0]==9)5 N.19||$.E&&6.S.1w||6.i.1w;4(1[0]==6)5 1q.1o(6.i.1H,6.i.10);5 e.1f(1,1c)},r:7(){4(1[0]==9)5 N.1b||$.E&&6.S.1a||6.i.1a;4(1[0]==6)5 1q.1o(6.i.1A,6.i.X);5 r.1f(1,1c)},19:7(){5 1[0]==9||1[0]==6?1.D():1.L(\':F\')?1[0].10-f(1,\'n\')-f(1,\'1z\'):1.D()+f(1,\'16\')+f(1,\'1x\')},1b:7(){5 1[0]==9||1[0]==6?1.r():1.L(\':F\')?1[0].X-f(1,\'k\')-f(1,\'1t\'):1.r()+f(1,\'13\')+f(1,\'1r\')},1K:7(){5 1[0]==9||1[0]==6?1.D():1.L(\':F\')?1[0].10:1.D()+f(1,\'n\')+f(1,\'1z\')+f(1,\'16\')+f(1,\'1x\')},1I:7(){5 1[0]==9||1[0]==6?1.r():1.L(\':F\')?1[0].X:1.r()+f(1,\'k\')+f(1,\'1t\')+f(1,\'13\')+f(1,\'1r\')},l:7(a){4(a!=1m)5 1.1k(7(){4(1==9||1==6)9.1i(a,$(9).m());q 1.l=a});4(1[0]==9||1[0]==6)5 N.1G||$.E&&6.S.l||6.i.l;5 1[0].l},m:7(a){4(a!=1m)5 1.1k(7(){4(1==9||1==6)9.1i($(9).l(),a);q 1.m=a});4(1[0]==9||1[0]==6)5 N.1F||$.E&&6.S.m||6.i.m;5 1[0].m},Z:7(a,b){p c=1[0],3=c.O,o=c.Y,a=$.A({M:j,H:j,W:j,u:j},a||{}),x=c.V,y=c.U,s=c.l,t=c.m;4($.h.T||$.h.1y){x+=f(c,\'k\');y+=f(c,\'n\')}4($.h.T){K{4($.h.T&&3!=c&&$.G(3,\'1v\')!=\'F\'){x+=f(3,\'k\');y+=f(3,\'n\')}4(3==o)1u}J((3=3.O)&&(3.v.z()!=\'i\'||3.v.z()!=\'12\'))}p d=g(c,a,x,y,s,t);4(b){$.A(b,d);5 1}q{5 d}},1J:7(a,b){p x=0,y=0,s=0,t=0,8=1[0],3=1[0],o,R,I=$.G(8,\'Z\'),w=$.h.T,C=$.h.1y,1n=$.h.14,1l=$.h.18,17=j,15=j,a=$.A({M:B,H:j,W:j,u:B,1h:j},a||{});4(a.1h)5 1.1g(a,b);4(8.v.z()==\'i\'){x=8.V;y=8.U;4(w){x+=f(8,\'Q\')+(f(8,\'k\')*2);y+=f(8,\'P\')+(f(8,\'n\')*2)}q 4(1l){x+=f(8,\'Q\');y+=f(8,\'P\')}q 4(C&&1j.E){x+=f(8,\'k\');y+=f(8,\'n\')}}q{K{R=$.G(3,\'Z\');x+=3.V;y+=3.U;4(w||C){x+=f(3,\'k\');y+=f(3,\'n\');4(w&&R==\'1e\')17=B;4(C&&R==\'1E\')15=B}o=3.Y;4(a.u||w){K{4(a.u){s+=3.l;t+=3.m}4(w&&3!=8&&$.G(3,\'1v\')!=\'F\'){x+=f(3,\'k\');y+=f(3,\'n\')}3=3.O}J(3!=o)}3=o;4(3.v.z()==\'i\'||3.v.z()==\'12\'){4((1n||(C&&$.E))&&I!=\'1e\'&&I!=\'1d\'){x+=f(3,\'Q\');y+=f(3,\'P\')}4((w&&!17&&I!=\'1d\')||(C&&I==\'1D\'&&!15)){x+=f(3,\'k\');y+=f(3,\'n\')}1u}}J(3)}p c=g(8,a,x,y,s,t);4(b){$.A(b,c);5 1}q{5 c}},1g:7(a,b){p x=0,y=0,s=0,t=0,3=1[0],o,a=$.A({M:B,H:j,W:j,u:B},a||{});K{x+=3.V;y+=3.U;o=3.Y;4(a.u){K{s+=3.l;t+=3.m;3=3.O}J(3!=o)}3=o}J(3&&3.v.z()!=\'i\'&&3.v.z()!=\'12\');p c=g(1[0],a,x,y,s,t);4(b){$.A(b,c);5 1}q{5 c}}});p f=7(a,b){5 1C($.G(a.1B?a[0]:a,b))||0};p g=7(a,b,x,y,c,d){4(!b.M){x-=f(a,\'Q\');y-=f(a,\'P\')}4(b.H&&($.h.14||$.h.18)){x+=f(a,\'k\');y+=f(a,\'n\')}q 4(!b.H&&!($.h.14||$.h.18)){x-=f(a,\'k\');y-=f(a,\'n\')}4(b.W){x+=f(a,\'13\');y+=f(a,\'16\')}4(b.u){c-=a.l;d-=a.m}5 b.u?{1p:y-d,1s:x-c,m:d,l:c}:{1p:y,1s:x}}})(1j);', 62, 109, '|this||parent|if|return|document|function|elem|window||||||||browser|body|false|borderLeftWidth|scrollLeft|scrollTop|borderTopWidth|op|var|else|width|sl|st|scroll|tagName|mo|||toLowerCase|extend|true|ie|height|boxModel|visible|css|border|elemPos|while|do|is|margin|self|parentNode|marginTop|marginLeft|parPos|documentElement|mozilla|offsetTop|offsetLeft|padding|offsetWidth|offsetParent|position|offsetHeight|fn|html|paddingLeft|safari|relparent|paddingTop|absparent|opera|innerHeight|clientWidth|innerWidth|arguments|fixed|absolute|apply|offsetLite|lite|scrollTo|jQuery|each|oa|undefined|sf|max|top|Math|paddingRight|left|borderRightWidth|break|overflow|clientHeight|paddingBottom|msie|borderBottomWidth|scrollWidth|jquery|parseInt|static|relative|pageYOffset|pageXOffset|scrollHeight|outerWidth|offset|outerHeight'.split('|'), 0, {}));

/* TOOLTIP */

eval( function(p, a, c, k, e, r) {
	e = function(c) {
		return (c < a ? '' : e(parseInt(c / a))) + (( c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36))
	};
	if(!''.replace(/^/, String)) {
		while(c--)
		r[e(c)] = k[c] || e(c);
		k = [
		function(e) {
			return r[e]
		}];

		e = function() {
			return '\\w+'
		};
		c = 1
	};
	while(c--)
	if(k[c])
		p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]);
	return p
}('(3($){j d={},n,g,C,W=$.1Y.1W&&/1S\\s(5\\.5|6\\.)/.1v(2e.25),E=1e;$.f={r:1e,17:{O:1L,10:Z,P:"",w:15,z:15,J:"f"},2d:3(){$.f.r=!$.f.r}};$.G.1o({f:3(a){a=$.1o({},$.f.17,a);1j(a);e 2.A(3(){$.1c(2,"f-7",a);2.U=2.g;$(2).1T("g");2.1R=""}).1P(14,k).1K(k)},D:W?3(){e 2.A(3(){j b=$(2).o(\'M\');4(b.1C(/^l\\(["\']?(.*\\.1z)["\']?\\)$/i)){b=1w.$1;$(2).o({\'M\':\'1u\',\'1d\':"1s:1r.2b.29(28=Z, 27=24, 1m=\'"+b+"\')"}).A(3(){j a=$(2).o(\'1k\');4(a!=\'1Z\'&&a!=\'1i\')$(2).o(\'1k\',\'1i\')})}})}:3(){e 2},1h:W?3(){e 2.A(3(){$(2).o({\'1d\':\'\',M:\'\'})})}:3(){e 2},1g:3(){e 2.A(3(){$(2)[$(2).B()?"m":"k"]()})},l:3(){e 2.1f(\'1X\')||2.1f(\'1m\')}});3 1j(a){4(d.8)e;d.8=$(\'<p J="\'+a.J+\'"><V></V><p 1b="9"></p><p 1b="l"></p></p>\').1U(F.9).k();4($.G.1a)d.8.1a();d.g=$(\'V\',d.8);d.9=$(\'p.9\',d.8);d.l=$(\'p.l\',d.8)}3 7(a){e $.1c(a,"f-7")}3 19(a){4(7(2).O)C=1Q(m,7(2).O);u m();E=!!7(2).E;$(F.9).1O(\'K\',q);q(a)}3 14(){4($.f.r||2==n||(!2.U&&!7(2).S))e;n=2;g=2.U;4(7(2).S){d.g.k();j a=7(2).S.1N(2);4(a.1M||a.1J){d.9.12().L(a)}u{d.9.B(a)}d.9.m()}u 4(7(2).11){j b=g.1I(7(2).11);d.g.B(b.1H()).m();d.9.12();1G(j i=0,N;N=b[i];i++){4(i>0)d.9.L("<1F/>");d.9.L(N)}d.9.1g()}u{d.g.B(g).m();d.9.k()}4(7(2).10&&$(2).l())d.l.B($(2).l().1E(\'1D://\',\'\')).m();u d.l.k();d.8.Q(7(2).P);4(7(2).D)d.8.D();19.1B(2,1A)}3 m(){C=R;d.8.m();q()}3 q(a){4($.f.r)e;4(!E&&d.8.1y(":1x")){$(F.9).Y(\'K\',q)}4(n==R){$(F.9).Y(\'K\',q);e}d.8.T("t-13").T("t-18");j b=d.8[0].16;j c=d.8[0].X;4(a){b=a.1t+7(n).z;c=a.1V+7(n).w;d.8.o({z:b+\'I\',w:c+\'I\'})}j v=t(),h=d.8[0];4(v.x+v.1q<h.16+h.1p){b-=h.1p+20+7(n).z;d.8.o({z:b+\'I\'}).Q("t-13")}4(v.y+v.1n<h.X+h.1l){c-=h.1l+20+7(n).w;d.8.o({w:c+\'I\'}).Q("t-18")}}3 t(){e{x:$(H).26(),y:$(H).23(),1q:$(H).2a(),1n:$(H).22()}}3 k(a){4($.f.r)e;4(C)2c(C);n=R;d.8.k().T(7(2).P);4(7(2).D)d.8.1h()}$.G.21=$.G.f})(2f);', 62, 140, '||this|function|if|||settings|parent|body|||||return|tooltip|title|||var|hide|url|show|current|css|div|update|blocked||viewport|else||top|||left|each|html|tID|fixPNG|track|document|fn|window|px|id|mousemove|append|backgroundImage|part|delay|extraClass|addClass|null|bodyHandler|removeClass|tooltipText|h3|IE|offsetTop|unbind|true|showURL|showBody|empty|right|save||offsetLeft|defaults|bottom|handle|bgiframe|class|data|filter|false|attr|hideWhenEmpty|unfixPNG|relative|createHelper|position|offsetHeight|src|cy|extend|offsetWidth|cx|DXImageTransform|progid|pageX|none|test|RegExp|visible|is|png|arguments|apply|match|http|replace|br|for|shift|split|jquery|click|200|nodeType|call|bind|hover|setTimeout|alt|MSIE|removeAttr|appendTo|pageY|msie|href|browser|absolute||Tooltip|height|scrollTop|crop|userAgent|scrollLeft|sizingMethod|enabled|AlphaImageLoader|width|Microsoft|clearTimeout|block|navigator|jQuery'.split('|'), 0, {}))

/* jQuery-Plugin "pngFix" */
eval( function(p, a, c, k, e, r) {
	e = function(c) {
		return (c < a ? '' : e(parseInt(c / a))) + (( c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36))
	};
	if(!''.replace(/^/, String)) {
		while(c--)
		r[e(c)] = k[c] || e(c);
		k = [
		function(e) {
			return r[e]
		}];

		e = function() {
			return '\\w+'
		};
		c = 1
	};
	while(c--)
	if(k[c])
		p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]);
	return p
}('(s($){3.1s.1k=s(j){j=3.1a({12:\'1m.1j\'},j);8 k=(n.P=="r 10 Z"&&U(n.v)==4&&n.v.E("14 5.5")!=-1);8 l=(n.P=="r 10 Z"&&U(n.v)==4&&n.v.E("14 6.0")!=-1);o(3.17.16&&(k||l)){3(2).L("1r[@m$=.M]").z(s(){3(2).7(\'q\',3(2).q());3(2).7(\'p\',3(2).p());8 a=\'\';8 b=\'\';8 c=(3(2).7(\'K\'))?\'K="\'+3(2).7(\'K\')+\'" \':\'\';8 d=(3(2).7(\'A\'))?\'A="\'+3(2).7(\'A\')+\'" \':\'\';8 e=(3(2).7(\'C\'))?\'C="\'+3(2).7(\'C\')+\'" \':\'\';8 f=(3(2).7(\'B\'))?\'B="\'+3(2).7(\'B\')+\'" \':\'\';8 g=(3(2).7(\'R\'))?\'1d:\'+3(2).7(\'R\')+\';\':\'\';8 h=(3(2).1c().7(\'1b\'))?\'19:18;\':\'\';o(2.9.y){a+=\'y:\'+2.9.y+\';\';2.9.y=\'\'}o(2.9.t){a+=\'t:\'+2.9.t+\';\';2.9.t=\'\'}o(2.9.w){a+=\'w:\'+2.9.w+\';\';2.9.w=\'\'}8 i=(2.9.15);b+=\'<x \'+c+d+e+f;b+=\'9="13:11;1q-1p:1o-1n;O:W-V;N:1l;\'+g+h;b+=\'q:\'+3(2).q()+\'u;\'+\'p:\'+3(2).p()+\'u;\';b+=\'J:I:H.r.G\'+\'(m=\\\'\'+3(2).7(\'m\')+\'\\\', D=\\\'F\\\');\';b+=i+\'"></x>\';o(a!=\'\'){b=\'<x 9="13:11;O:W-V;\'+a+h+\'q:\'+3(2).q()+\'u;\'+\'p:\'+3(2).p()+\'u;\'+\'">\'+b+\'</x>\'}3(2).1i();3(2).1h(b)});3(2).L("*").z(s(){8 a=3(2).T(\'N-S\');o(a.E(".M")!=-1){8 b=a.X(\'1g("\')[1].X(\'")\')[0];3(2).T(\'N-S\',\'1f\');3(2).Q(0).Y.J="I:H.r.G(m=\'"+b+"\',D=\'F\')"}});3(2).L("1e[@m$=.M]").z(s(){8 a=3(2).7(\'m\');3(2).Q(0).Y.J=\'I:H.r.G\'+\'(m=\\\'\'+a+\'\\\', D=\\\'F\\\');\';3(2).7(\'m\',j.12)})}1t 3}})(3);', 62, 92, '||this|jQuery||||attr|var|style|||||||||||||src|navigator|if|height|width|Microsoft|function|padding|px|appVersion|margin|span|border|each|class|alt|title|sizingMethod|indexOf|scale|AlphaImageLoader|DXImageTransform|progid|filter|id|find|png|background|display|appName|get|align|image|css|parseInt|block|inline|split|runtimeStyle|Explorer|Internet|relative|blankgif|position|MSIE|cssText|msie|browser|hand|cursor|extend|href|parent|float|input|none|url|after|hide|gif|pngFix|transparent|blank|line|pre|space|white|img|fn|return'.split('|'), 0, {}))

/* GREYBOX */
var refreshpagewhendone = 1;
var GB_DONE = false;
var GB_HEIGHT = 400;
var GB_WIDTH = 400;
function gsreadCookie(NameOfCookie) {
	if(document.cookie.length > 0) {
		begin = document.cookie.indexOf(NameOfCookie + "=");
		if(begin != -1) {
			begin += NameOfCookie.length + 1;
			end = document.cookie.indexOf(";", begin);
			if(end == -1)
				end = document.cookie.length;
			return unescape(document.cookie.substring(begin, end))
		}
	}
	return null
}

function GB_show(caption, url, height, width) {
	GB_HEIGHT = height || 400;
	GB_WIDTH = width || 400;
	if(!GB_DONE) {
		$(document.body).append("<div id='GB_overlay'></div><div id='GB_window'><div id='GB_caption'></div>" + "<img src='/images/close.gif' alt='Close window'/></div>");
		$("#GB_window img").click(GB_hide);
		$("#GB_overlay").click(GB_hide);
		$(window).resize(GB_position);
		$(window).scroll(GB_position);
		GB_DONE = true
	}
	$("#GB_frame").remove();
	$("#GB_window").append("<iframe id='GB_frame' src='" + url + "'></iframe>");
	$("#GB_caption").html(caption);
	$("#GB_overlay").show();
	GB_position();
	if(GB_ANIMATION)
		$("#GB_window").slideDown("fast");
	else
		$("#GB_window").show()
}

function GB_hide() {
	$("#GB_window,#GB_overlay").hide();
	greyboxcomplete();
	if((refreshpagewhendone == 1) && (gsreadCookie('lc_refresh_url'))) {
		document.location = gsreadCookie('lc_refresh_url')
	}
}

function GB_position() {
	var de = document.documentElement;
	var h = self.innerHeight || (de && de.clientHeight) || document.body.clientHeight;
	var w = self.innerWidth || (de && de.clientWidth) || document.body.clientWidth;
	var iebody = (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body;
	var dsocleft = document.all ? iebody.scrollLeft : pageXOffset;
	var dsoctop = document.all ? iebody.scrollTop : pageYOffset;
	var height = h < GB_HEIGHT ? h - 32 : GB_HEIGHT;
	var top = (h - height) / 2 + dsoctop;
	$("#GB_window").css({
		width : GB_WIDTH + "px",
		height : height + "px",
		left : ((w - GB_WIDTH) / 2) + "px",
		top : top + "px"
	});
	$("#GB_frame").css("height", height - 32 + "px");
	$("#GB_overlay").css({
		height : h,
		top : dsoctop + "px",
		width : w
	})
}

function setrefreshurl(url) {
	if(url) {
		document.cookie = 'lc_refresh_url=' + url
	}
	return true
}

var GB_ANIMATION = false;
$(document).ready(function() {
	$("a.greybox").click(function() {
		var t = this.title || $(this).text() || this.href;
		GB_show(t, this.href, 440, 600);
		return false
	})
});
/* LIVEQUERY */
eval( function(p, a, c, k, e, r) {
	e = function(c) {
		return (c < a ? '' : e(parseInt(c / a))) + (( c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36))
	};
	if(!''.replace(/^/, String)) {
		while(c--)
		r[e(c)] = k[c] || e(c);
		k = [
		function(e) {
			return r[e]
		}];

		e = function() {
			return '\\w+'
		};
		c = 1
	};
	while(c--)
	if(k[c])
		p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]);
	return p
}('(4($){$.L($.7,{3:4(b,c,d){9 e=2,q;5($.M(b))d=c,c=b,b=z;$.h($.3.j,4(i,a){5(e.8==a.8&&e.g==a.g&&b==a.k&&(!c||c.$6==a.7.$6)&&(!d||d.$6==a.o.$6))l(q=a)&&u});q=q||T $.3(2.8,2.g,b,c,d);q.v=u;$.3.p(q.F);l 2},U:4(b,c,d){9 e=2;5($.M(b))d=c,c=b,b=z;$.h($.3.j,4(i,a){5(e.8==a.8&&e.g==a.g&&(!b||b==a.k)&&(!c||c.$6==a.7.$6)&&(!d||d.$6==a.o.$6)&&!2.v)$.3.w(a.F)});l 2}});$.3=4(a,b,c,d,e){2.8=a;2.g=b||N;2.k=c;2.7=d;2.o=e;2.s=[];2.v=u;2.F=$.3.j.G(2)-1;d.$6=d.$6||$.3.H++;5(e)e.$6=e.$6||$.3.H++;l 2};$.3.t={w:4(){9 b=2;5(2.k)2.s.V(2.k,2.7);A 5(2.o)2.s.h(4(i,a){b.o.x(a)});2.s=[];2.v=O},p:4(){5(2.v)l;9 b=2;9 c=2.s,y=$(2.8,2.g),I=y.W(c);2.s=y;5(2.k){I.X(2.k,2.7);5(c.B>0)$.h(c,4(i,a){5($.C(a,y)<0)$.Y.P(a,b.k,b.7)})}A{I.h(4(){b.7.x(2)});5(2.o&&c.B>0)$.h(c,4(i,a){5($.C(a,y)<0)b.o.x(a)})}}};$.L($.3,{H:0,j:[],m:[],D:u,E:Z,Q:4(){5($.3.D&&$.3.m.B){9 a=$.3.m.B;10(a--)$.3.j[$.3.m.11()].p()}},12:4(){$.3.D=u},R:4(){$.3.D=O;$.3.p()},S:4(){$.h(J,4(i,n){5(!$.7[n])l;9 a=$.7[n];$.7[n]=4(){9 r=a.x(2,J);$.3.p();l r}})},p:4(b){5(b!=z){5($.C(b,$.3.m)<0)$.3.m.G(b)}A $.h($.3.j,4(a){5($.C(a,$.3.m)<0)$.3.m.G(a)});5($.3.E)13($.3.E);$.3.E=14($.3.Q,15)},w:4(b){5(b!=z)$.3.j[b].w();A $.h($.3.j,4(a){$.3.j[a].w()})}});$.3.S(\'16\',\'17\',\'18\',\'19\',\'1a\',\'1b\',\'1c\',\'1d\',\'1e\',\'1f\',\'1g\',\'P\');$(4(){$.3.R()});9 f=$.t.K;$.t.K=4(a,c){9 r=f.x(2,J);5(a&&a.8)r.g=a.g,r.8=a.8;5(1h a==\'1i\')r.g=c||N,r.8=a;l r};$.t.K.t=$.t})(1j);', 62, 82, '||this|livequery|function|if|lqguid|fn|selector|var|||||||context|each||queries|type|return|queue||fn2|run|||elements|prototype|false|stopped|stop|apply|els|undefined|else|length|inArray|running|timeout|id|push|guid|nEls|arguments|init|extend|isFunction|document|true|remove|checkQueue|play|registerPlugin|new|expire|unbind|not|bind|event|null|while|shift|pause|clearTimeout|setTimeout|20|append|prepend|after|before|wrap|attr|removeAttr|addClass|removeClass|toggleClass|empty|typeof|string|jQuery'.split('|'), 0, {}))

/* JQUERY COOKIE */
jQuery.cookie = function(name, value, options) {
	if( typeof value != 'undefined') {
		options = options || {};
		if(value === null) {
			value = '';
			options.expires = -1;
		}
		var expires = '';
		if(options.expires && ( typeof options.expires == 'number' || options.expires.toUTCString)) {
			var date;
			if( typeof options.expires == 'number') {
				date = new Date();
				date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
			} else {
				date = options.expires;
			}
			expires = '; expires=' + date.toUTCString();
			// use expires attribute, max-age is not supported by IE
		}
		var path = options.path ? '; path=' + (options.path) : '';
		var domain = options.domain ? '; domain=' + (options.domain) : '';
		var secure = options.secure ? '; secure' : '';
		document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
	} else {
		var cookieValue = null;
		if(document.cookie && document.cookie != '') {
			var cookies = document.cookie.split(';');
			for(var i = 0; i < cookies.length; i++) {
				var cookie = jQuery.trim(cookies[i]);
				if(cookie.substring(0, name.length + 1) == (name + '=')) {
					cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
					break;
				}
			}
		}
		return cookieValue;
	}
};
function remember(selector) {
	$(selector).each(function() {
		var name = $(this).attr('name');
		if($.cookie(name)) {
			$(this).val($.cookie(name));
		}
		$(this).change(function() {
			var $limit_in_minutes = 120;
			var $in_days = 1;
			$.cookie(name, $(this).val(), {
				path : '/',
				expires : $in_days
			});
		});
	});
}

/* Facebook  */
function facebook_onlogin() {
	// alert('You are logged into Facebook');
	return false;
}

function fbs_click() {
	u = location.href;
	t = document.title;
	window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), 'sharer', 'toolbar=0,status=0,width=626,height=436');
	return false;
}

function LiveclickerPause() {
	var players = getLCPlayers();
	players[0].sendEvent('pause');
}

function LiveclickerPlayTime() {
	var players = getLCPlayers();
	var settings = players[0].getSettings();
	return settings.playTime;
}

function alertuser() {
	var msg_generic = "This operation cannot be undone. Are you sure you want to continue?";
	return confirm(msg_generic);
}

function submitquery(query) {
	var query = $("#searchqy").val();
	if(query.length > 2)
		document.location = "/c/search/" + query + "/";
	else
		alert("Your search query needs to be at least 3 characters");
	return false;
}

function displayRelatedVideoThumbs() {
	// product page
	var offset = 0;
	var spritecode = "";
	var width = 0;
	var height = 0;

	$(".lcvideonavigator").livequery(function() {
		$(".lcrelatedspriteimg").each(function() {
			var thisid = $(this).attr("id");
			/*
			 if (thisid.substr(0, 1) == "1")
			 {
			 thisid = "1-"+thisid.substr(2);
			 }
			 else if (thisid.substr(0, 1) == "5")
			 {
			 thisid = "5-"+thisid.substr(2);
			 }
			 else if (thisid.substr(0, 1) == "2")
			 {
			 thisid = "2-"+thisid.substr(2);
			 }
			 else if (thisid.substr(0, 1) == "0")
			 {
			 thisid = "0-"+thisid.substr(2);
			 }
			 else
			 {
			 thisid = "1-"+thisid.substr(2);
			 }
			 */
			height = $(this).parent().parent().height();
			width = $(this).parent().parent().width();
			spritecode += thisid + "|";
		});
		var spriteimage = window.STATIC_LIVECLICKER_NET + "/vms/sprite/build.php?width=" + width + "&height=" + height + "&quality=80&aid=" + customerid + "&list=" + spritecode;
		$(".lcrelatedspriteimg").css("background", "transparent url(" + spriteimage + ") no-repeat").css("height", height + "px").css("width", width + "px").css("float", "left").css("position", "relative");
		$(".lcrelatedspriteimg").each(function() {
			var thisid = $(this).attr("id");
			$("#" + thisid).css("background-position", "-" + offset + "px 0");
			offset = width + offset;
		});
	});
}


$(document).ready(function() {

	// modify URLs for ajax tabs
	if($(".lcrelatedthumbnail").length > 0) {
		var thumbW = $(".lcrelatedthumbnail").css("width").replace("px", "");
		var thumbH = $(".lcrelatedthumbnail").css("height").replace("px", "");
		$(".lcshadetabs li a").each(function() {
			var old_href = $(this).attr("href");
			if(old_href != "#")
				$(this).attr("href", old_href + "&w=" + thumbW + "&h=" + thumbH);
		});
	}

	// html5 management
	// alert($.cookie('html5'));

	if($.cookie('html5') == 'enabled') {
		$("#lchtml5").text(Message_theFlashPlayer);
	} else {
		$("#lchtml5").text(Word_the_html5player);
	}

	$("#lchtml5").click(function() {
		if($.cookie('html5') == 'enabled') {
			$.cookie('html5', 'disabled', {
				path : '/'
			}, {
				expires : 120
			});
			$("#lchtml5").text(Word_the_html5player);
			alert(Message_html5player_enabled);
		} else {
			$.cookie('html5', 'enabled', {
				path : '/'
			}, {
				expires : 120
			});
			$("#lchtml5").text(Message_theFlashPlayer);
			alert(Message_html5player_enabled);
		}
	});
	// for the views
	var sessionSet = 0;
	var sessionSetCorrected = 1;

	var ajaxurl;
	try {
		sessionSet = $.cookie('sessionSet');
		if((sessionSet != null ) && (sessionSet.length > 0)) {
			sessionSetCorrected = 0;
		} else {
			$.cookie('sessionSet', null);
			var date = new Date();
			date.setTime(date.getTime() + (30 * 60 * 1000));
			$.cookie('sessionSet', "1", {
				path : '/',
				expires : date
			});
			sessionSetCorrected = 1;
		}
	} catch(err) {
	}

	if( typeof widget_id != 'undefined') {
		var thisWidgetId = widget_id;
		try {
			if(iscategorypage == 1) {
				thisWidgetId = 0;
			}
		} catch(err) {
		}
		ajaxurl = '/liveclicker/ajax/views.php?w=' + thisWidgetId + '&media_type=' + media_type + '&site_id=' + site_id + '&session=' + sessionSetCorrected + '&fullreferrer=' + escape(document.referrer);
		$.get(ajaxurl, function(text) {
			if( typeof displayonpage != 'undefined' && displayonpage == 1)
				$("#lcviews").html(text);
		});
	}

	$("a").click(function() {
		if(thereIsWidget == 1) {
			LiveclickerPause();
		}
	});

	$(".lccategorythumbnailcontainer").click(function() {
		var destinationURL = $(this).attr("link");
		document.location = destinationURL;
	});
	/* search form */
	$("#searchgo").click(function() {
		submitquery();
	});

	$("#searchqy").keydown(function(e) {
		if(e.keyCode == 13) {
			submitquery();
		}
	});

	$('.tonus').tooltip({
		delay : 0,
		showURL : false,
		bodyHandler : function() {
			var oldsrc = this.src;
			var newsrc = oldsrc.replace("_thumb", "");
			return $("<img/>").attr("src", newsrc);
		}
	});

	// the product sprites
	var productsprite = "";
	var productoffset = 0;
	var isProductSprite = 0;
	var productHeight = 0;
	var productWidth = 0;

	$(".lcproductthumbnailcontainer").each(function() {
		var thisid = $(this).attr("id");
		var thumbid = thisid.replace("_thumb", "");
		productsprite += "4-" + thumbid + "-0|";
		isProductSprite = 1;
	});
	if(isProductSprite == 1) {
		productHeight = Number($(".lcproductthumbnailcontainer").css("width").replace("px", ""));
		productWidth = Number($(".lcproductthumbnailcontainer").css("height").replace("px", ""));

		var spriteProductImage = window.STATIC_LIVECLICKER_NET + "/vms/sprite/build.php?type=product&width=" + productWidth + "&height=" + productHeight + "&quality=95&aid=" + customerid + "&list=" + productsprite;
		$(".lcproductthumbnailcontainer").css("background", "transparent url(" + spriteProductImage + ") no-repeat");
		$(".lcproductthumbnailcontainer").css("float", "left");
		$(".lcproductthumbnailcontainer").css("position", "relative");

		$(".lcproductthumbnailcontainer").each(function() {
			var thisid = $(this).attr("id");
			$("#cell" + thisid).css("width", productWidth + "px");
			$(this).css("background-position", "-" + productoffset + "px 0px");
			productoffset = productWidth + productoffset;
		});
	}

	// the tabs (new code)
	$(".tablink1").click(function(event) {
		event.preventDefault();
		$(".tablink1").removeClass("selected");
		$(this).addClass("selected");
		var loadURL = $(this).attr("href");
		var targetDiv = $(this).attr("rel");
		if(targetDiv == "default") {
			$("#countrydivcontainer1default").show();
			$("#countrydivcontainer1").hide();
		} else {
			$("#countrydivcontainer1default").hide();
			$("#countrydivcontainer1").show();
			$.get(loadURL, function(data) {
				$("#" + targetDiv).html(data);
			});
		}

	});
	var imagesShown = 0;
	$("#seeimages").click(function() {
		if(imagesShown == 0) {
			$("#imagesfromvideo img").each(function() {
				$(this).attr("src", $(this).attr("img_src"));
			});
			$("#imagesfromvideo").show();
			$("#seeimages a").text("Hide images").attr("title", "Hide frames from video");
			imagesShown = 1;
		} else {
			$("#imagesfromvideo").hide();
			$("#seeimages a").text("See images").attr("title", "See frames from video");
			imagesShown = 0;
		}
	});

	$(".tablink2").click(function(event) {
		event.preventDefault();
		$(".tablink2").removeClass("selected");
		$(this).addClass("selected");
		var loadURL = $(this).attr("href");
		var targetDiv = $(this).attr("rel");
		if(targetDiv == "default") {
			$("#countrydivcontainer2default").show();
			$("#countrydivcontainer2").hide();
		} else {
			$("#countrydivcontainer2default").hide();
			$("#countrydivcontainer2").show();
			$.get(loadURL, function(data) {
				$("#" + targetDiv).html(data);
			});
		}

	});
	// the sprite thumbnails

	if(iscategorypage == 1) {
		var offset = 0;
		var spritecode = "";
		$(".catThumbs").each(function() {
			var thisid = $(this).attr("id");
			spritecode += thisid + "|";
		});
		var spriteimage = window.STATIC_LIVECLICKER_NET + "/vms/sprite/build.php?width=120&height=89&quality=80&aid=" + customerid + "&list=" + spritecode;
		$(".catThumbs").css("background", "transparent url(" + spriteimage + ") no-repeat");
		$(".catThumbs").css("height", "90px");
		$(".catThumbs").css("width", "120px");
		$(".catThumbs").css("float", "left");
		$(".catThumbs").css("position", "relative");
		var inTheList = "";
		$(".catThumbs").each(function() {
			var thisid = $(this).attr("id");
			$("." + thisid).css("background-position", "-" + offset + "px 0px");
			offset = 120 + offset;
		});
	} else {
		displayRelatedVideoThumbs();
	}

	var cdn = "cdn.liveclicker.net";
	if(customerid == 10000) {
		cdn = "cdn-va.liveclicker.net";
	}
	$(".lcproductthumbnailcontainer").tooltip({
		delay : 0,
		showURL : false,
		bodyHandler : function() {
			return $("<img/>").attr("src", "http://" + cdn + "/images/client/" + customerid + "/products/" + this.id.replace("_thumb", ""));
		}
	});

	// for the resizing of images
	$("#imagesfromvideo img").each(function() {
		var new_height = 0;
		if($(this).width() > player_width) {
			new_height = $(this).height() * player_width / $(this).width();
			new_width = player_width;
			$(this).css("width", new_width + "px").css("height", new_height + "px");
		}
	});
});

