1 | jQuery("document").ready(function(jQuery){ |
---|
2 | |
---|
3 | // scripts Category Page ------------------------------------------------------------------------------------------------------------ |
---|
4 | |
---|
5 | // resize thumbnail block |
---|
6 | jQuery(window).resize(function() { tnb_resize(); }); |
---|
7 | tnb_resize(); |
---|
8 | |
---|
9 | // display alt from PWG stuffs actions. |
---|
10 | |
---|
11 | var stuffs_actions=jQuery(".categoryActions",".stuffs_block .stuffs"); |
---|
12 | |
---|
13 | if (stuffs_actions.length != 0) { |
---|
14 | stuffs_actions.each(function(index) { |
---|
15 | var images=jQuery(this).find("img"); |
---|
16 | if (images.length !=0) { |
---|
17 | images.each(function(index) { |
---|
18 | var alt_text = (jQuery(this).attr("alt")); |
---|
19 | jQuery(this).before(alt_text); |
---|
20 | jQuery(this).parents("li").css("width","auto"); |
---|
21 | jQuery(this).remove(); |
---|
22 | }); |
---|
23 | } |
---|
24 | }); |
---|
25 | } |
---|
26 | |
---|
27 | // gmaps icon |
---|
28 | |
---|
29 | var icon_gmaps=jQuery("#icon_gmaps"); |
---|
30 | var text_gmaps=jQuery("#text_gmaps"); |
---|
31 | if ((icon_gmaps.length == 1) && (text_gmaps.length ==1)) { |
---|
32 | icon_gmaps.text(text_gmaps.text()); |
---|
33 | icon_gmaps.css("text-align","right"); |
---|
34 | } |
---|
35 | |
---|
36 | // bug with MSIE6 & language switch |
---|
37 | /* |
---|
38 | if ((jQuery.browser.msie) && (jQuery.browser.version.substr(0,1) == "6")) { |
---|
39 | var lswitch = jQuery(".menuf > div > ul"); |
---|
40 | if (lswitch.length==1) { |
---|
41 | var flags = lswitch.children("li").children("a"); |
---|
42 | if (flags.length==2) { |
---|
43 | flags.first().remove(); |
---|
44 | } |
---|
45 | } |
---|
46 | }*/ |
---|
47 | |
---|
48 | }); |
---|
49 | |
---|
50 | |
---|
51 | |
---|
52 | // Thumbnails Block Resize function |
---|
53 | |
---|
54 | function tnb_resize() { |
---|
55 | if (jQuery("#thumbnails_block2").length != 0) { |
---|
56 | var tnb_width = 40+180*parseInt((jQuery("#thumbnails_block1").width()-40)/180); |
---|
57 | jQuery("#thumbnails_block2").css("max-width",tnb_width+"px"); |
---|
58 | }; |
---|
59 | } |
---|
60 | |
---|
61 | /** |
---|
62 | * Cookie plugin |
---|
63 | * Copyright (c) 2006 Klaus Hartl (stilbuero.de) |
---|
64 | * Dual licensed under the MIT and GPL licenses: |
---|
65 | */ |
---|
66 | jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options=jQuery.extend({},options);options.expires=-1;} |
---|
67 | 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;} |
---|
68 | expires='; expires='+date.toUTCString();} |
---|
69 | 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;}}} |
---|
70 | return cookieValue;}}; |
---|