
var pThumbsScroller='';var nThumbsScroller='';var previewScroller='';var $scriptLoaded=0;var thumbnailsHeight=$('#thumbnails').height();$(document).ready(function(){$('#posterSubmit').click(function(){$('form#sendEmail').submit();});$('[class^=validate]').validationEngine({success:function(){var emailFromVal=$("#emailFrom").val();var emailNameVal=$("#emailName").val();var emailMessageVal=$("#emailMessage").val();var emailLocale='/wp-content/themes/vintage_2/sendEmail.php';$("#posterSubmit").hide();$("#sendEmail li.buttons #posterLoading").show();$.post(emailLocale,{emailFrom:emailFromVal,emailName:emailNameVal,emailMessage:emailMessageVal},function(data){$("#sendEmail li.buttons #posterLoading").fadeOut('fast',function(){$("#sendEmail li.buttons").append('<div class="message"><p>Your email was sent.</p></div>');$("#sendEmail li.buttons div.message").fadeIn('slow');});});},failure:function(){}});jQuery.fn.resetPosterForm=function(){$("#sendEmail li.buttons div.message").remove();$("#posterSubmit").show();};$('.thumbnails a').live("click",function(e){var contentID=$(this).attr('rel');contentID=contentID.replace(/overlay:\//,'');$('#content div.overlayloading').fadeIn(100);$('#overlay').load("/",{p:contentID,view:'overlay'},function(){$scriptURL=$tLocale+"/js/vintage.overlay.js";$.getScript($scriptURL,function(){$("div.preview").scrollable({size:1,clickable:false,});$("div.prevThumbs").scrollable({size:1,clickable:true,});$("div.nextThumbs").scrollable({size:1,clickable:false,});});$('#overlay').append('<div id="upper" class="closeoverlay"></div><div id="lower" class="closeoverlay"></div>');$('#content div.overlayloading').fadeOut(100);$('#overlay').fadeIn(200);$('#thumbnails').animate({height:"634px"},200);});return false;});});var current_page=0;var current_cat='all';var initialtitle=$.address.title();$(function(){$('#catSelect').change(function(){window.current_page=$(this).val();window.current_cat=$('#catSelect :selected').attr('id');window.current_cat=window.current_cat.replace(/category-/,"");$.address.value(window.current_cat);});$.address.init(function(event){currentcategory=$.address.value();currentcategory='#category-'+currentcategory.replace("/","");selectcurrent=$('#catSelect :selected').attr('id');if(currentcategory!=selectcurrent){if($.address.value()=='/'){$('#catSelect').selectOnlyOptions(1);}else{currentpage=$('#catSelect').children(currentcategory).text();$('#catSelect').selectOnlyOptions(currentpage);}}}).change(function(event){currentcategory=$.address.value();if(currentcategory!='/'){if($('#content').attr('class')!='grid'){var destination=$baseLocale+'/#'+$.address.value();window.location=destination;}else{thumbnailsHeight=$('#thumbnails').height();$('#content div.overlayloading').height(thumbnailsHeight).fadeIn(50);checkcategory='#category-'+currentcategory.replace("/","");window.current_page=$('#catSelect').children(checkcategory).val();$('#content').load("./ #content > *",{cat:window.current_page},function(){$.address.title(initialtitle+" > "+$('#catSelect :selected').text());$('div.thumbnails').css('visibility','visible');$('#content div.overlayloading').fadeOut(100);thumbnailsHeight=$('#thumbnails').height();if($('#catSelect').val()!=window.current_page){currentpage=$('#catSelect').children(checkcategory).text();$('#catSelect').selectOnlyOptions(currentpage);}});}}});});