function setupPrettyPhoto(){$(".tmbItemBox a[rel^='prettyPhoto']").prettyPhoto({theme:'light_rounded',allowresize: true,counter_separator_label:'-',showTitle:true});};(function($){$.fn.jquote=function(options){var defaults={bquoteclass:"jquote",srcclass: "source"};var options=$.extend(defaults, options);return this.each(function(){var opentag="<blockquote class=\"" + options.bquoteclass + "\">";var thequote=$("span.quote").text();var end="</blockquote>";var source1="<span class=\"" + options.srcclass + "\">";var source2 = "</span>";var person = $("span.quote").attr("title");$("span.quote").after(opentag+thequote+source1+person+source2+end);});};})(jQuery);$("p").jquote({bquoteclass:"jquote",srcclass:"source"});function setupAllImgLoad(){$(".imgLoad").each(function(){var loader=$(this);var imageFilePath=loader.attr('title');var img=new Image();$(img).css("opacity","0.0").load(          function(){loader.append(this);$(this).css("margin", "0px").css("opacity", "0.0").animate({opacity:1.0},800,function(){loader.removeAttr('title').css("background-image", "none");});}).attr('src',imageFilePath);});}function setupGalleryLoad(){$(".tmbItem").each(function(){var loader=$(this);var imageFilePath=loader.attr('title');var img=new Image();$(img).css("opacity","0.0").load(function(){loader.append(this);$(this).css("margin","0px").css("opacity", "0.0").animate({opacity:1.0},800,function(){loader.removeAttr('title').css("background-image", "none");});}).attr('src',imageFilePath);});}
function setupCufonFont(){Cufon.replace('h1',{fontFamily:'Advent'});Cufon.replace('h2',{fontFamily:'Rockwell',textShadow:'#333 1px 1px'});Cufon.replace('h3',{fontFamily:'Advent'});Cufon.replace('h4',{fontFamily:'Advent'});Cufon.replace('h5',{fontFamily:'Advent'});Cufon.replace('h6',{fontFamily:'Advent'});	Cufon.replace('.static-desc h1',{fontFamily:'Myriad Pro',color:'-linear-gradient(#EEEEEE, #CCCCCC)',textShadow:'#000 2px 2px'});}  
function visibleScript(){jQuery(".jview").css({visibility:"visible"});if(jQuery(".next").length > 1){jQuery(".next").css({visibility:"visible"});}}
function hrz_slide(){windowIE=1;var animation_stopped=true;var viewport=($(window).width() * 2);$(".hrz-container:not(.hrz1)").each(function(i){				var currentPos_container = $(this).position();var newpos_container=(currentPos_container.left + viewport) * windowIE;$(this).css({left:newpos_container}).removeClass("notactive");});$(".btn .next").each(function(i){$(this).bind("click",function(){if(animation_stopped){animation_stopped=false;				viewport=($(window).width() * 2);var number=i +1;var next=i + 2;if($(".hrz-container").length < next){next=1;}$('.hrz'+ number).animate({left:-viewport},600,"easeInBack",function(){var css_set=viewport * windowIE;$('.hrz'+ number).css({left:css_set});$('.hrz'+ next).animate({left:0},600,"easeOutCirc");													animation_stopped = true;});$('.hrz'+ number+ '.partSlide').each(function(i){var speed=450;var this_css_left=$(this).css("left");var pos_left=parseInt(this_css_left.replace(/px/g, ""));var adjust_left = pos_left + ((i+1) * 35);$(this).animate({left:adjust_left},speed,"linear").animate({left:pos_left},300);;});}return false;});});}function ajaxContact(){var options={target:'#alert'};$('#cm_form').ajaxForm(options);$.fn.clearForm=function(){return this.each(function(){var type=this.type,tag=this.tagName.toLowerCase();if(tag=='form')return $(':input',this).clearForm();if (type=='text'||type=='password'||tag=='textarea')this.value='';else if (type=='checkbox'||type=='radio')this.checked=false;else if (tag=='select')this.selectedIndex=-1;});};}
$(document).ready(function(){setupPrettyPhoto();setupCufonFont();setupGalleryLoad();setupAllImgLoad();visibleScript();hrz_slide();ajaxContact();});
