$(function(){swfobject.registerObject("logoFlash","8.0.0","expressInstall.swf");swfobject.registerObject("backFlash","8.0.0","expressInstall.swf");var changeBgPicture=function(speed,easing,callback){var speed=speed||1500
var callback=callback||function(){}
var easing=easing||'linear'
do{var randImg=Site.bgImages[Site.bgImageFolder][Math.ceil(Math.random()*(Site.bgImages[Site.bgImageFolder].length-1))];}
while(randImg==Site.bgImage)
var tempImage=new Image();tempImage.src='img/backgr/'+Site.bgImageFolder+'/'+randImg;$(tempImage).load(function(){var newImage=($('#backImage2').css('display')=='block')?'#backImage':'#backImage2';$(newImage).css('backgroundImage','url('+tempImage.src+')');$('#backImage2').animate({opacity:'toggle'},speed,easing,callback);});Site.bgImage=randImg;}
var bgMap=[];bgMap['gallery.php']=bgMap['configurator.php']=bgMap['interior-glass.php']='misc';bgMap['technical-stone-technology.php']=bgMap['natural-stone-technology.php']='technology';bgMap['contact-us.php']='contact-us';bgMap['technical-stone-application.php']=bgMap['natural-stone-application.php']='applications';bgMap['technical-stone-edges.php']='stone-edges';$("a:not([rel='lightbox']|[rel='direct'])").live('click',function(){var new_page=$(this).attr('href');if(Site.page!=new_page){$('#loader').fadeIn();$('.scrollable').scrollTo(0);var container=$(this).attr('rel')||'#content';$(container).fadeOut('fast',function(){if(bgMap[new_page]){Site.bgImageFolder=bgMap[new_page];changeBgPicture();}
else{Site.bgImageFolder='misc';}
$(container).load(new_page,'',function(){$('#loader').fadeOut();$(this).fadeIn('fast');Site.page=new_page;if(container=='#content'){window.location.hash=new_page;}
$('#mainNavigation a[href='+new_page+']').click().parent().mouseover();});});}
return false;});$(document).oneTime(700,function(){$('#wrapper3').show(1000,function(){changeBgPicture(700,'swing',function(){$('#mainNavigation a').fadeTo('fast',.85).attr('selected',false);$('#mainNavigationWrapper').slideDown(1000,function(){var landing_page=Site.page||window.location.hash.replace('#','')||$('#mainNavigation a:first').attr('href');$('#mainNavigation a[href='+landing_page+']').parent().mouseover();$('#mainNavigation a[href='+landing_page+']').click();$('#backLogo').animate({marginLeft:'-775px'},1000);});$('#footerStripe').animate({opacity:'show',top:'560px'},1000,'swing');});});});$('#mainNavigation a').click(function(){$('#mainNavigation a').stop().fadeTo('fast',.85).attr('selected',false);$(this).stop().fadeTo('fast',.95).attr('selected',true);});$('#mainNavigation').lavaLamp({speed:1000});$('#mainNavigation a').hover(function(){if($(this).attr('selected')=='false'){$(this).stop().fadeTo('fast',.65)}},function(){if($(this).attr('selected')=='false'){$(this).stop().fadeTo('fast',.85)}});$('.scrollUp').live("click",function(){var el=$($(this).attr('rel'));var step=Math.round(el.innerHeight()*0.75);var to=Math.max(el.scrollTop()-step,0);el.stop().scrollTo(to,1000,{easing:'swing'});});$('.scrollDown').live("click",function(){var el=$($(this).attr('rel'));var step=Math.round(el.innerHeight()*0.75);var to=Math.min(el.scrollTop()+step,el.attr('scrollHeight'));el.stop().scrollTo(to,1000,{easing:'swing'});});$(document).everyTime(35000,function(){changeBgPicture()});$('#content-toggle').click(function(){$('#content').slideToggle();});});
