$.fn.getIndex=function(){var a=$(this).parent().children();return a.index(this)};$.fn.setNav=function(){jQuery("#main_menu li ul").css({display:"none"});jQuery("#main_menu li").each(function(){var a=jQuery(this).find("ul:first");jQuery(this).hover(function(){a.stop().css({overflow:"hidden",height:"auto",display:"none"}).slideDown(200,function(){jQuery(this).css({overflow:"visible",height:"auto"})})},function(){a.stop().slideUp(200,function(){jQuery(this).css({overflow:"hidden",display:"none"})})});jQuery(this).click(function(){$(this).children("a").click()})})};$.fn.pSlider=function(a){settings=jQuery.extend({nav:"#slider_nav",navWrapper:".slider_nav_btn",fadeSpeed:800,delay:5000},a);var d=$(this);var e=settings.nav+" "+settings.navWrapper;$(this).children("div").css({display:"none"});var b=0;$(this).children("div").each(function(){if($(this).attr("id")!="slider_nav"){var f=$(this).children("span.title").html();$(e).append('<a href="javascript:;" rel="'+b+'">'+f+"</a>");if($(this).children("span.title").children("img").length>0){$(e).children("a[rel="+b+"]").css({padding:"6px 15px 0px 15px"})}b++}});$(e).children("a").eq(0).addClass("active");$(this).children("div").eq(0).css({display:"block"});var c=setInterval(function(){if($(e+" a.active").next().length>0){var g=$(e+" a.active").next();var f=$(e+" a.active").next().attr("rel");d.children("div").css({display:"none"});if(BrowserDetect.browser!="Explorer"){d.children("div").eq(f).fadeIn(settings.fadeSpeed)}else{d.children("div").eq(f).css({display:"block"})}$(settings.nav+" a").removeClass("active");g.addClass("active")}else{d.children("div").css({display:"none"});if(BrowserDetect.browser!="Explorer"){d.children("div").eq(0).fadeIn(settings.fadeSpeed)}else{d.children("div").eq(0).css({display:"block"})}$(settings.nav+" a").removeClass("active");$(settings.nav+" a").eq(0).addClass("active")}},settings.delay);$(e+" a").click(function(){$(settings.nav+" a").removeClass("active");$(this).addClass("active");var f=$(this).attr("rel");d.children("div").css({display:"none"});if(BrowserDetect.browser!="Explorer"){d.children("div").eq(f).fadeIn(settings.fadeSpeed)}else{d.children("div").eq(f).css({display:"block"})}clearInterval(c);return false});$(e).children("a").eq(0).addClass("active");$(this).children("div").eq(0).css({display:"block"})};$(document).ready(function(){$(document).setNav();$('input[title!=""]').hint();$("#content_slider").coinslider({width:920,height:360,opacity:0.9,navigation:true,titleSpeed:800,delay:5000,sDelay:10});$("#content_slider_slide").pSlider({nav:"#slider_nav",navWrapper:".slider_nav_btn",fadeSpeed:800,delay:5000});$(".portfolio_vimeo").fancybox({padding:10,overlayColor:"#fff",overlayOpacity:0.7});$(".portfolio_youtube").fancybox({padding:10,overlayColor:"#fff",overlayOpacity:0.7});$(".portfolio_image").fancybox({padding:10,overlayColor:"#fff",overlayOpacity:0.7});$("#skins_nav").fancybox({padding:0,overlayColor:"#fff",overlayOpacity:0.7,onStart:function(){$("#fancybox-wrap").css({"z-index":999});$("#fancybox-overlay").css({"z-index":999})}});$(".two_third").hover(function(){$(this).find(".gallery1_hover").css({top:"-411px",visibility:"visible",opacity:0.8}).fadeIn(400);$(this).click(function(){$(this).find("a").click()})},function(){$(this).find(".gallery1_hover").fadeOut()});$(".one_half .gallery_image").hover(function(){$(this).find(".gallery2_hover").css({top:"-301px",visibility:"visible",opacity:0.8}).fadeIn(400);$(this).click(function(){$(this).find("a").click()})},function(){$(this).find(".gallery2_hover").fadeOut()});$(".one_third .gallery_image").hover(function(){$(this).find(".gallery3_hover").css({top:"-193px",visibility:"visible",opacity:0.8}).fadeIn(400);$(this).click(function(){$(this).find("a").click()})},function(){$(this).find(".gallery3_hover").fadeOut()});$(".one_fourth .gallery_image").hover(function(){$(this).find(".gallery4_hover").css({top:"-142px",visibility:"visible",opacity:0.8}).fadeIn(400);$(this).click(function(){$(this).find("a").click()})},function(){$(this).find(".gallery4_hover").fadeOut()});$.validator.setDefaults({submitHandler:function(){var b=$("#contact_form").attr("action");$.ajax({type:"POST",url:b,data:$("#contact_form").serialize(),success:function(c){$("#contact_form").hide();$("#reponse_msg").html(c)}});return false}});$("#contact_form").validate({rules:{your_name:"required",email:{required:true,email:true},message:"required"},messages:{your_name:"Please enter your name",email:"Please enter a valid email address",agree:"Please enter some message"}});if(BrowserDetect.browser=="Explorer"&&BrowserDetect.version<8){var a=1000;$("div").each(function(){$(this).css("zIndex",a);a-=10})}Cufon.replace("h1.cufon",{textShadow:"1px 1px rgba(255, 255, 255, 1)",fontSize:"32px"});Cufon.replace("h2.cufon",{textShadow:"1px 1px rgba(255, 255, 255, 1)",fontSize:"28px"});Cufon.replace("h3.cufon",{textShadow:"1px 1px rgba(255, 255, 255, 1)",fontSize:"22px"});Cufon.replace("h4.cufon",{textShadow:"1px 1px rgba(255, 255, 255, 1)",fontSize:"20px"});Cufon.replace("h5.cufon",{textShadow:"1px 1px rgba(255, 255, 255, 1)",fontSize:"18px"});Cufon.replace("a.big_button span",{textShadow:"0 -1px rgba(0, 0, 0, 0.6)",fontSize:"20px"});Cufon.replace("#footer h2.widgettitle",{fontSize:"16px"});Cufon.replace(".page_caption p",{textShadow:"1px 1px rgba(255, 255, 255, 1)",fontSize:"16px"});Cufon.replace(".cs-title strong.header",{textShadow:"1px 1px rgba(255, 255, 255, 1)",fontSize:"36px"});Cufon.replace("#content_slider_slide h3",{textShadow:"1px 1px rgba(255, 255, 255, 1)",fontSize:"36px"});Cufon.replace(".left_tagline h2",{textShadow:"1px 1px rgba(255, 255, 255, 1)",fontSize:"22px"});Cufon.replace(".dropcap1",{textShadow:"1px 1px rgba(255, 255, 255, 1)",fontSize:"40px"})});
