$(function(){$('ul.sc_menu').galleria({history:false,onImage:function(image,caption,thumb){image.css('display','none').fadeIn()}});$('ul.sc_menu li:first').addClass("active");$('#logo').css('cursor','pointer').click(function(){window.location=base_url});$('.gallery_cover h3').css('opacity',0);$('.gallery_cover').hover(function(){$(this).children('h3').stop().animate({opacity:1},'slow')},function(){$(this).children('h3').stop().animate({opacity:0},'slow')});$('.gallery_cover').click(function(){window.location=$(this).find('a').attr('href');return false});$('.gallery_overlay').css('background','#000').animate({opacity:0},'slow');$('.gallery_overlay').hover(function(){$(this).css({'cursor':'pointer','border':'0px solid #fff'}).stop().animate({opacity:.5},'slow')},function(){$(this).stop().animate({opacity:0},'slow')});function makeScrollable(wrapper,scrollable){var wrapper=$(wrapper),scrollable=$(scrollable);scrollable.hide();var loading=$('<div class="loading">Loading...</div>').appendTo(wrapper);var interval=setInterval(function(){var images=scrollable.find('img');var completed=0;images.each(function(){if(this.complete)completed++});if(completed==images.length){clearInterval(interval);setTimeout(function(){loading.hide();wrapper.css({overflow:'hidden'});scrollable.slideDown('slow',function(){enable()})},1000)}},100);function enable(){var inactiveMargin=99;var wrapperWidth=wrapper.width();var wrapperHeight=wrapper.height();var scrollableHeight=scrollable.outerHeight()+2*inactiveMargin;var tooltip=$('<div class="sc_menu_tooltip"></div>').css('opacity',0).appendTo(wrapper);scrollable.find('a').each(function(){$(this).data('tooltipText',this.title)});scrollable.find('a').removeAttr('title');scrollable.find('img').removeAttr('alt');var lastTarget;wrapper.mousemove(function(e){lastTarget=e.target;var wrapperOffset=wrapper.offset();var tooltipLeft=e.pageX-wrapperOffset.left;tooltipLeft=Math.min(tooltipLeft,wrapperWidth-75);var tooltipTop=e.pageY-wrapperOffset.top+wrapper.scrollTop()-40;if(e.pageY-wrapperOffset.top<wrapperHeight/2){tooltipTop+=80}tooltip.css({top:tooltipTop,left:tooltipLeft});var top=(e.pageY-wrapperOffset.top)*(scrollableHeight-wrapperHeight)/wrapperHeight-inactiveMargin;if(top<0){top=0}wrapper.scrollTop(top)});wrapper.mouseleave(function(){lastTarget=false;tooltip.stop(true).css('opacity',0).text('')})}}$(function(){makeScrollable("div.sc_menu_wrapper","ul.sc_menu")})});

function setCookie(c_name,value,expiredays)

{var exdate=new Date()

exdate.setTime(exdate.getTime()+(expiredays*24*3600*1000))

document.cookie=c_name+"="+escape(value)+

((expiredays==null)?"":"; expires="+exdate)}

function getCookie(c_name)

{if(document.cookie.length>0)

{c_start=document.cookie.indexOf(c_name+"=")

if(c_start!=-1)

{c_start=c_start+c_name.length+1

c_end=document.cookie.indexOf(";",c_start)

if(c_end==-1)c_end=document.cookie.length

return unescape(document.cookie.substring(c_start,c_end))}}

return null}

var jName,jPhone,jEmail,jMessage;function cc(){jName=getCookie("cName");if(jName!=null)

{document.getElementById("name").value=jName;}

jPhone=getCookie("cPhone");if(jPhone!=null)

{document.getElementById("phone").value=jPhone;}

jEmail=getCookie("cEmail");if(jEmail!=null)

{document.getElementById("email").value=jEmail;}

jMessage=getCookie("cMessage");if(jMessage!=null)

{document.getElementById("message").value=jMessage;}}

function sc(){jName=document.getElementById("name").value;setCookie("cName",jName);jPhone=document.getElementById("phone").value;setCookie("cPhone",jPhone);jEmail=document.getElementById("email").value;setCookie("cEmail",jEmail);jMessage=document.getElementById("message").value;setCookie("cMessage",jMessage);}
