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();}
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 set_clientwidth(){if(jQuery.browser.msie){if(document.body.clientWidth<1003){$('#header, #footer, div.container').css('width','1002px');}}
var clientwidth=document.body.clientWidth;if(clientwidth!=$.cookie("clientwidth")){$.cookie("clientwidth",escape(document.body.clientWidth),{path:"/",expires:365});}
var obj=$('#stocks').parent().width();if(obj){stock_cols=Math.floor(obj/161);var padding=(obj-158*stock_cols-15)/2;$('#stocks').css("padding-left",padding+"px");}}
jQuery(function(){set_clientwidth();$(window).resize(function(){set_clientwidth();});jQuery('li.submenu-folder > a').toggle(function(){jQuery('~ul',this).show();jQuery(this).css('background-image','url(/images/minus.gif)');return false;},function(){jQuery('~ul',this).hide();jQuery(this).css('background-image','url(/images/plus.gif)');return false;});jQuery('.butenter').hover(function(){jQuery(this).css({color:'#085d7e',background:'#fff'});},function(){jQuery(this).css({color:'#fff',background:'#085d7e'});});jQuery('#menu a').each(function(){if(jQuery(this).attr('id')==curr_cat){jQuery(this).addClass('current-menu');$ul=jQuery(this).parent().parent();$ul.show();$ul.prev().click();return true;}});$('form#register').submit(function(){$('form .required').each(function(){if($.trim($(this).val())==null){return false;}});if(!$('input[name=read]').attr('checked')){alert('You have not accepted "Copyright Notice"');return false;}});$('form #country').change(function(){if(($(this).val()!=1)&&($(this).val()!=40)){$('#state').val(0);}});$('form #state').change(function(){if(($('#country').val()!=1)&&($('#country').val()!=40)){$(this).val(0);}});$('form#newsletter').submit(function(){var is_news=$('#news_daily').attr('checked')||$('#news_weekly').attr('checked');var is_tuts=$('#report_notify').attr('checked')||$('#report_weekly').attr('checked');if(is_tuts&&!$('.chkCat:checked').size()){alert('Please Choose Your Topics of Interest');return false;}else if(!is_tuts&&!is_news){alert('Please Choose Your Type of Subscription');return false;}
return true;});$('a#forgot').click(function(e){e.preventDefault();$('form#forgot_form').find('.label').show();$('#dialog').modal();return false;});$('form#forgot_form').submit(function(){str={act:'forgot'};$(this).find('input').each(function(n,element){str[$(element).attr('name')]=$(element).val();});$.post('/forgot',str,function(data){if(data.status==1){$('form#forgot_form').find('.label').fadeOut();}
$('#dialog_message').fadeOut("slow",function(){$(this).text(data.message).fadeIn()});},"json");return false;});$('#logout').click(function(){$.post("/logout",{act:'logout'},function(data){href=window.location.href;document.location.href=href.substring(0,href.indexOf('#'));});return false;});$('.rate_form a').click(function(){$rate_form=$(this).parent().parent();var id=$rate_form.find('input[name=id]').val();var type=$rate_form.find('input[name=type]').val();var value=$(this).text();$.post('/voting',{id:id,type:type,value:value,action:'rate'},function(data){$rate_form.fadeOut('fast',function(){$rate_form.prev().fadeIn('slow')});});});$('#search-keyword').focus();$('#keywords').focus();$('#login').focus();$('.subsubmenu-item a[href=/photoshop/tutorials/page-1.html]').css('font-weight','bold');$('.subsubmenu-item a[href=/photoshop/tutorials/epick/page-1.html]').css('font-weight','bold');var target=location.hash;if(target)
$.scrollTo(target,1200);});