function main_nav(){$(" #main_nav ul ").css({display:"none"});$(" #main_nav li").hover(function(){$(this).find("ul:first").css({visibility:"visible",display:"none",width:"700px"}).show()},function(){$(this).find("ul:first").css({visibility:"hidden"})})}$(document).ready(function(){main_nav()});function serviceSlider(){var d=0;var b=new Array();$("#slide_wrapper .service_slide").each(function(h){b[h]=d;d+=$(this).height();if(!$(this).height()){alert("Please, fill in width & height for all your images!");return false}});var a=0;var g=new Array();$("#caption_wrapper .service_caption").each(function(h){g[h]=a;a+=$(this).width();if(!$(this).width()){alert("Please, fill in width & height for all your divs!");return false}});$("#slide_wrapper").height(d);$("#caption_wrapper").width(a);$(".service_light").click(function(h,i){$(".service_light a").removeClass("active").addClass("inactive");$(this).children().addClass("active");var j=$(this).prevAll(".service_light").length;$("#slide_wrapper").stop().animate({top:-b[j]+"px"},{duration:800,easing:"easeInOutBack"});$("#caption_wrapper").stop().animate({left:-g[j]+"px"},{duration:800,easing:"easeInOutCirc"});h.preventDefault();if(!i){clearInterval(e)}});$("#lights_box a#button_up").click(function(h,i){$("a.bulb.active").parent().prev().trigger("click",[true]);h.preventDefault();if(!i){clearInterval(e)}});$("#lights_box a#button_down").click(function(h,i){$("a.bulb.active").parent().next().trigger("click",[true]);h.preventDefault();if(!i){clearInterval(e)}});$("#lights_box ul li.service_light a:first").addClass("active").siblings().addClass("inactive");var f=1;function c(){if(f==-1){return false}$("#lights_box ul li.service_light").eq(f%$("#lights_box ul li.service_light").length).trigger("click",[true]);f++}var e=setInterval(function(){c()},4400)}function l_first(d,c){return $(d).find("span[data-type=price]").text()-$(c).find("span[data-type=price]").text()}function h_first(d,c){return $(c).find("span[data-type=price]").text()-$(d).find("span[data-type=price]").text()}function sorting(){$("#h_first").click(function(){var c=$("#product_list");var a=c.clone();var b=a.find("li").sort(h_first);c.quicksand(b,{duration:800,easing:"easeInOutQuad",},function(){$(".moreDetails").colorbox()})});$("#l_first").click(function(){var c=$("#product_list");var a=c.clone();var b=a.find("li").sort(l_first);c.quicksand(b,{duration:800,easing:"easeInOutQuad",},function(){$(".moreDetails").colorbox()})})}function validate(){$("#billing_form").submit(function(e){e.preventDefault();var a=true;$("input.required, selct.required",this).each(function(){if(d.isValid(this)==false){a=false}});var d={stripWhitespace:function(i){return i.replace(/|s/g,"")},isValid:function(k){var n=true;var i=$(k);var p=i.attr("id");var j=i.attr("name");var m=i.val();var l=i[0].type.toLowercase();switch(l){case"text":if(m.length==0||m.replace(/\s/g,"").lenght==0){n=false}break;case"select_one":if(!m){n=false}break}var o=n?"removeClass":"addClass";$("#errorMessage_"+j)[o]("showErrorMessage");$('label[for="'+p+'"}')[o]("error");return n}};$('input[name="usingAjax"]',this).val("true");var f=$(this);var c="confirm.php";var g=f.serialize();var h=function(j){var i=$(j);var k=i.find("form");f.hide();$("#form_wrapper").hide().append(k).fadeIn()};var b="html";if(a){$.get(c,g,h,b)}})};
