$(document).ready(function(){var sitetitle=document.title.split(" |")[0];var overlay=$("#lightbox");var popup_ajax=$("#popup-ajax");var popup_login=$("#popup-login");var timeID;var time=8000;$.get_node=function(){var node=location.hash.substring(1);return node;};var current_slide=0;$.index_slideshow=function(type){if(type=="next"){if((current_slide+1)>($("#main-img li").length-1)){next_slide=0;}else{next_slide=current_slide+1;}$("#frame"+current_slide).fadeOut(700,function(){$("#frame"+next_slide).fadeIn(700,function(){current_slide=next_slide;});});}else{if((current_slide-1)<0){prev_slide=$("#main-img li").length-1;}else{prev_slide=current_slide-1;}$("#frame"+current_slide).fadeOut(700,function(){$("#frame"+prev_slide).fadeIn(700,function(){current_slide=prev_slide;});});}};$.detect_page=function(){var type=$.get_node();var new_title="";$("#main-img, #main-slider, #tab1, #tab1 .home-columns, #tab1 .home-content").hide();$("#slide1, #slide2, #slide3").hide();$("#tab2, #tab2 .content").hide();$("#tab3, #tab3 .content, #tab3 .client_block").hide();$("#tab4, #tab4 .content").hide();$("#tab5, #tab5 .content").hide();$("#tab6, #tab6 .content").hide();$("#tab7, #tab7 .content").hide();$("#tab8, #tab8 .content").hide();$("#tab9, #tab9 .content").hide();$("#headers, .heading-list, .heading-list li").hide();$("#footer").hide();switch(type){case"about":new_title=sitetitle+" | "+$("#tab_5 a").attr("title");$("#tab_5 a").removeClass("tab").addClass("tab active");$("#headers, .heading-list, .heading-list #title_5, #slide1, #tab2, #tab2 .content, #footer").show();break;case"portfolio":new_title=sitetitle+" | "+$("#tab_6 a").attr("title");$("#tab_6 a").removeClass("tab").addClass("tab active");$("#headers, .heading-list, .heading-list #title_6, #slide2, #tab3, #tab3 .content, #tab3 .client-block, #footer").show();break;case"services":new_title=sitetitle+" | "+$("#tab_7 a").attr("title");$("#tab_7 a").removeClass("tab").addClass("tab active");$("#headers, .heading-list, .heading-list #title_7, #slide1, #tab4, #tab4 .content, #footer").show();break;case"partners":new_title=sitetitle+" | "+$("#tab_8 a").attr("title");$("#tab_8 a").removeClass("tab").addClass("tab active");$("#headers, .heading-list, .heading-list #title_8, #slide1, #tab5, #tab5 .content, #footer").show();break;case"projects":new_title=sitetitle+" | "+$("#tab_9 a").attr("title");$("#tab_9 a").removeClass("tab").addClass("tab active");$("#headers, .heading-list, .heading-list #title_9, #slide3, #tab6, #tab6 .content, #footer").show();break;case"reviews":new_title=sitetitle+" | "+$("#tab_10 a").attr("title");$("#tab_10 a").removeClass("tab").addClass("tab active");$("#headers, .heading-list, .heading-list #title_10, #slide1, #tab7, #tab7 .content, #footer").show();break;case"contacts":new_title=sitetitle+" | "+$("#tab_11 a").attr("title");$("#tab_11 a").removeClass("tab").addClass("tab active");$("#headers, .heading-list, .heading-list #title_11, #slide1, #tab8, #tab8 .content, #footer").show();break;case"privacy":new_title=sitetitle+" | "+$("#tab_16 a").attr("title");$("#headers, .heading-list, .heading-list #title_16, #slide1, #tab9, #tab9 .content, #footer").show();break;default:new_title=document.title;$("body").addClass("home-page");$("#main-img, #main-slider, #tab1, #tab1 .home-columns, #tab1 .home-content").show();}document.title=new_title;};var start_node=document.location.toString().replace("http://"+document.domain,"").replace("#","").replace(/\//g,"");if($.get_node()==""){location.hash=location.hash+start_node;if(start_node==""){$("body").addClass("home-page");}timeID=setInterval(function(){$.index_slideshow("next");},time);}else{$.detect_page();}$.getSlider=function(type,autostart,spd,pse,prev_id,controls_id,next_id,width,height){$("#slider_"+type).easySlider({auto:autostart,prevNext:true,continuous:true,numeric:true,speed:spd,pause:pse,prevId:prev_id,numericId:controls_id,nextId:next_id,box_width:width,box_height:height});};$.getSlider("basic",true,800,5000,"b_prev","b_con","b_next",1051,203);$.getSlider("portfolio",true,800,5000,"port_prev","port_con","port_next",1051,556);$.getSlider("projects",true,800,5000,"proj_prev","proj_con","proj_next",1051,556);$.findHeight=function(){var height=0;if(window.innerWidth){height=window.innerHeight;}else{if(document.body&&document.body.clientWidth){height=document.body.clientHeight;}}if(document.documentElement&&document.documentElement.clientWidth){height=document.documentElement.clientHeight;}return height;};$.getDocHeight=function(){var D=document;return Math.max(Math.max(D.body.scrollHeight,D.documentElement.scrollHeight),Math.max(D.body.offsetHeight,D.documentElement.offsetHeight),Math.max(D.body.clientHeight,D.documentElement.clientHeight));};$.hide_page=function(targetObj){var type=$.get_node();var newURI=targetObj.attr("href").toString().replace(/\//g,"");location.hash=newURI;if(type!=newURI){switch(type){case"about":$("#footer").fadeOut(100,function(){$("#tab2 .content").fadeOut(150,function(){if(newURI=="portfolio"||newURI=="projects"||newURI==""){$("#slide1").fadeOut(200,function(){$("#headers .heading-list #title_5").fadeOut(150,function(){if(newURI==""){$("#headers .heading-list, #headers").hide();}$("#tab2").hide();$("#tab_5 a").removeClass("tab active").addClass("tab");$.show_page(targetObj,type);});});}else{$("#headers .heading-list #title_5").fadeOut(150,function(){$("#tab2").hide();$("#tab_5 a").removeClass("tab active").addClass("tab");$.show_page(targetObj,type);});}});});break;case"portfolio":$("#footer").fadeOut(100,function(){$("#tab3 .client-block").fadeOut(150,function(){$("#tab3 .content").fadeOut(100,function(){$("#slide2").fadeOut(250,function(){$("#headers .heading-list #title_6").fadeOut(150,function(){if(newURI==""){$("#headers .heading-list, #headers").hide();}$("#tab3").hide();$("#tab_6 a").removeClass("tab active").addClass("tab");$.show_page(targetObj,type);});});});});});break;case"services":$("#footer").fadeOut(100,function(){$("#tab4 .content").fadeOut(150,function(){if(newURI=="portfolio"||newURI=="projects"||newURI==""){$("#slide1").fadeOut(200,function(){$("#headers .heading-list #title_7").fadeOut(150,function(){if(newURI==""){$("#headers .heading-list, #headers").hide();}$("#tab4").hide();$("#tab_7 a").removeClass("tab active").addClass("tab");$.show_page(targetObj,type);});});}else{$("#headers .heading-list #title_7").fadeOut(150,function(){$("#tab4").hide();$("#tab_7 a").removeClass("tab active").addClass("tab");$.show_page(targetObj,type);});}});});break;case"partners":$("#footer").fadeOut(100,function(){$("#tab5 .content").fadeOut(150,function(){if(newURI=="portfolio"||newURI=="projects"||newURI==""){$("#slide1").fadeOut(200,function(){$("#headers .heading-list #title_8").fadeOut(150,function(){if(newURI==""){$("#headers .heading-list, #headers").hide();}$("#tab5").hide();$("#tab_8 a").removeClass("tab active").addClass("tab");$.show_page(targetObj,type);});});}else{$("#headers .heading-list #title_8").fadeOut(150,function(){$("#tab5").hide();$("#tab_8 a").removeClass("tab active").addClass("tab");$.show_page(targetObj,type);});}});});break;case"projects":$("#footer").fadeOut(100,function(){$("#tab6 .content").fadeOut(100,function(){$("#slide3").fadeOut(250,function(){$("#headers .heading-list #title_9").fadeOut(150,function(){if(newURI==""){$("#headers .heading-list, #headers").hide();}$("#tab6").hide();$("#tab_9 a").removeClass("tab active").addClass("tab");$.show_page(targetObj,type);});});});});break;case"reviews":$("#footer").fadeOut(100,function(){$("#tab7 .content").fadeOut(150,function(){if(newURI=="portfolio"||newURI=="projects"||newURI==""){$("#slide1").fadeOut(200,function(){$("#headers .heading-list #title_10").fadeOut(150,function(){if(newURI==""){$("#headers .heading-list, #headers").hide();}$("#tab7").hide();$("#tab_10 a").removeClass("tab active").addClass("tab");$.show_page(targetObj,type);});});}else{$("#headers .heading-list #title_10").fadeOut(150,function(){$("#tab7").hide();$("#tab_10 a").removeClass("tab active").addClass("tab");$.show_page(targetObj,type);});}});});break;case"contacts":$("#footer").fadeOut(100,function(){$("#tab8 .content").fadeOut(150,function(){if(newURI=="portfolio"||newURI=="projects"||newURI==""){$("#slide1").fadeOut(200,function(){$("#headers .heading-list #title_11").fadeOut(150,function(){if(newURI==""){$("#headers .heading-list, #headers").hide();}$("#tab8").hide();$("#tab_11 a").removeClass("tab active").addClass("tab");$.show_page(targetObj,type);});});}else{$("#headers .heading-list #title_11").fadeOut(150,function(){$("#tab8").hide();$("#tab_11 a").removeClass("tab active").addClass("tab");$.show_page(targetObj,type);});}});});break;case"privacy":$("#footer").fadeOut(100,function(){$("#tab9 .content").fadeOut(150,function(){if(newURI=="portfolio"||newURI=="projects"||newURI==""){$("#slide1").fadeOut(200,function(){$("#headers .heading-list #title_16").fadeOut(150,function(){if(newURI==""){$("#headers .heading-list, #headers").hide();}$("#tab9").hide();$("#tab_16 a").removeClass("tab active").addClass("tab");$.show_page(targetObj,type);});});}else{$("#headers .heading-list #title_16").fadeOut(150,function(){$("#tab9").hide();$("#tab_16 a").removeClass("tab active").addClass("tab");$.show_page(targetObj,type);});}});});break;default:$("#footer").fadeOut(150,function(){$("#tab1 .home-columns").fadeOut(250,function(){$("#tab1 .home-content").fadeOut(150,function(){$("#main-img").fadeOut(250,function(){$("#main-slider").fadeOut(50,function(){$("#tab1").hide();$("body").removeClass("home-page");$.show_page(targetObj,type);});});});});});}}};$.show_page=function(targetObj,prev){var new_title=sitetitle+" | "+targetObj.attr("title");var target=targetObj.attr("href").toString().replace(/\//g,"");document.title=new_title;$(targetObj).removeClass("tab").addClass("tab active");switch(target){case"about":$("#tab2").show();if(prev==""){$("#headers, #headers .heading-list").show();}if(prev=="portfolio"||prev=="projects"||prev==""){$("#headers .heading-list #title_5").fadeIn(150,function(){$("#slide1").fadeIn(100,function(){$("#tab2 .content").fadeIn(200,function(){$("#footer").fadeIn(250);});});});}else{$("#headers .heading-list #title_5").fadeIn(150,function(){$("#tab2 .content").fadeIn(200,function(){$("#footer").fadeIn(250,function(){});});});}break;case"portfolio":$("#tab3").show();if(prev==""){$("#headers, #headers .heading-list").show();}$("#headers .heading-list #title_6").fadeIn(150,function(){$("#slide2").fadeIn(100,function(){$("#tab3 .content").fadeIn(200,function(){$("#tab3 .client-block").fadeIn(100,function(){$("#footer").fadeIn(250,function(){});});});});});break;case"services":$("#tab4").show();if(prev==""){$("#headers, #headers .heading-list").show();}if(prev=="portfolio"||prev=="projects"||prev==""){$("#headers .heading-list #title_7").fadeIn(150,function(){$("#slide1").fadeIn(100,function(){$("#tab4 .content").fadeIn(200,function(){$("#footer").fadeIn(250,function(){});});});});}else{$("#headers .heading-list #title_7").fadeIn(150,function(){$("#tab4 .content").fadeIn(200,function(){$("#footer").fadeIn(250,function(){});});});}break;case"partners":$("#tab5").show();if(prev==""){$("#headers, #headers .heading-list").show();}if(prev=="portfolio"||prev=="projects"||prev==""){$("#headers .heading-list #title_8").fadeIn(150,function(){$("#slide1").fadeIn(100,function(){$("#tab5 .content").fadeIn(200,function(){$("#footer").fadeIn(250,function(){});});});});}else{$("#headers .heading-list #title_8").fadeIn(150,function(){$("#tab5 .content").fadeIn(200,function(){$("#footer").fadeIn(250,function(){});});});}break;case"projects":$("#tab6").show();if(prev==""){$("#headers, #headers .heading-list").show();}$("#headers .heading-list #title_9").fadeIn(150,function(){$("#slide3").fadeIn(100,function(){$("#tab6 .content").fadeIn(200,function(){$("#footer").fadeIn(250,function(){});});});});break;case"reviews":$("#tab7").show();if(prev==""){$("#headers, #headers .heading-list").show();}if(prev=="portfolio"||prev=="projects"||prev==""){$("#headers .heading-list #title_10").fadeIn(150,function(){$("#slide1").fadeIn(100,function(){$("#tab7 .content").fadeIn(200,function(){$("#footer").fadeIn(250,function(){});});});});}else{$("#headers .heading-list #title_10").fadeIn(150,function(){$("#tab7 .content").fadeIn(200,function(){$("#footer").fadeIn(250,function(){});});});}break;case"contacts":$("#tab8").show();if(prev==""){$("#headers, #headers .heading-list").show();}if(prev=="portfolio"||prev=="projects"||prev==""){$("#headers .heading-list #title_11").fadeIn(150,function(){$("#slide1").fadeIn(100,function(){$("#tab8 .content").fadeIn(200,function(){$("#footer").fadeIn(250,function(){});});});});}else{$("#headers .heading-list #title_11").fadeIn(150,function(){$("#tab8 .content").fadeIn(200,function(){$("#footer").fadeIn(250,function(){});});});}break;case"privacy":$("#tab9").show();if(prev==""){$("#headers, #headers .heading-list").show();}if(prev=="portfolio"||prev=="projects"||prev==""){$("#headers .heading-list #title_16").fadeIn(150,function(){$("#slide1").fadeIn(100,function(){$("#tab9 .content").fadeIn(200,function(){$("#footer").fadeIn(250,function(){});});});});}else{$("#headers .heading-list #title_16").fadeIn(150,function(){$("#tab9 .content").fadeIn(200,function(){$("#footer").fadeIn(250,function(){});});});}break;default:$("#tab1").show();$("body").addClass("home-page");$(".swicher").fadeIn(50,function(){$("#main-img").fadeIn(250,function(){$("#tab1 .home-content").fadeIn(150,function(){$("#tab1 .home-columns").fadeIn(250,function(){$("#footer").fadeIn(100,function(){});});});});});}};$("#nav a").live("click",function(){clearInterval(timeID);if($(this).attr("href")=="/"){timeout=setTimeout(function(){timeID=setInterval(function(){$.index_slideshow("next");},time);},5000);}$.hide_page($(this));return false;});$("#tab1 .home-columns a").live("click",function(){$.hide_page($(this));return false;});$("#footer .copyright a").live("click",function(){$.hide_page($(this));return false;});$("#tab3 .portfolio-list a").live("click",function(){if($(this).attr("rel")=="fancy_obj"){$("#popup-content").empty().load($(this).attr("href"),function(){overlay.css({"height":$.getDocHeight()});overlay.fadeTo(1,0.5);Cufon.replace(".feedback-popup .title",{fontFamily:"PF Din Text Comp Pro"});popup_ajax.fadeIn(300);});overlay.fadeIn(200);return false;}});$("#next_item").live("click",function(){$("#popup-content").empty().load($(this).attr("href"),function(){Cufon.replace(".feedback-popup .title",{fontFamily:"PF Din Text Comp Pro"});});return false;});var port_line=5;var port_cur=5;$("#tab3 .more a").live("click",function(){$.post("/loadport/",{current:port_cur,row:port_line},function(data){if((port_cur+port_line)>=$("#tab3 .more a").attr("rel")){$("#tab3 .more a").hide();}else{port_cur=port_cur+port_line;}$(data).appendTo("#tab3 .portfolio-list").css("display","none").fadeIn(300);});return false;});$("#tab6 .portfolio-list a").live("click",function(){if($(this).attr("rel")=="fancy_obj"){$("#popup-content").empty().load($(this).attr("href"),function(){overlay.css({"height":$.getDocHeight()});overlay.fadeTo(1,0.5);Cufon.replace(".feedback-popup .title",{fontFamily:"PF Din Text Comp Pro"});popup_ajax.fadeIn(300);});overlay.fadeIn(200);return false;}});var proj_line=5;var proj_cur=5;$("#tab6 .more a").live("click",function(){$.post("/loadproj/",{current:proj_cur,row:proj_line},function(data){if((proj_cur+proj_line)>=$("#tab6 .more a").attr("rel")){$("#tab6 .more a").hide();}else{proj_cur=proj_cur+proj_line;}$(data).appendTo("#tab6 .portfolio-list").css("display","none").fadeIn(300);});return false;});$("#tab7 .portfolio-list a").live("click",function(){overlay.css({"height":$.getDocHeight()});overlay.fadeTo(1,0.5);popup_ajax.css({"padding-top":($.findHeight()-236)/2+window.pageYOffset});$("#popup-content").empty().load($(this).attr("href"),function(){overlay.fadeIn(200);popup_ajax.fadeIn(300);});return false;});var rev_line=5;var rev_cur=5;$("#tab7 .more a").live("click",function(){$.post("/loadreviews/",{current:rev_cur,row:rev_line},function(data){if((rev_cur+rev_line)>=$("#tab7 .more a").attr("rel")){$("#tab7 .more a").hide();}else{rev_cur=rev_cur+rev_line;}$(data).appendTo("#tab7 .portfolio-list").css("display","none").fadeIn(300);});return false;});$("#popup-ajax .btn-close").live("click",function(){popup_ajax.fadeOut(200,function(){});overlay.fadeOut(250,0);return false;});$("#tab4 #wp-login").live("click",function(){overlay.css({"height":$.getDocHeight()});overlay.fadeTo(1,0.5);popup_login.css({"padding-top":($.findHeight()-327)/2+window.pageYOffset});overlay.fadeIn(200);popup_login.fadeIn(300);return false;});$("#popup-login .btn-close").live("click",function(){popup_login.fadeOut(200);overlay.fadeOut(250,0);return false;});$("#popup-login .btn-login").live("click",function(){popup_login.fadeOut(200);overlay.fadeOut(250,0);});$("#main-slider .prev").live("click",function(){$.index_slideshow("prev");clearInterval(timeID);return false;});$("#main-slider .next").live("click",function(){$.index_slideshow("next");clearInterval(timeID);return false;});var error=0;if($("#row-name input").attr("class")=="text error"){error=1;$("#row-name").addClass("row error");}if($("#row-email input").attr("class")=="text error"){error=1;$("#row-email").addClass("row error");}if($("#row-phone input").attr("class")=="text error"){error=1;$("#row-phone").addClass("row error");}if($("#row-message textarea").attr("class")=="text error"){error=1;$("#row-message").addClass("row error");}if($("#row-captcha input").attr("class")=="text error"){error=1;$("#row-captcha").addClass("row error");}if(error==1){$("#valid_message").hide();}$("#submit").click(function(){$(this).fadeTo(0.5,0.5);$(this).css({"cursor":"default"});});});
