// JavaScript Document $(document).ready(function(){ //adding arrow and spaces $("ul#menu li").each(function(){ child = $("ul", this); if(child.exists()) { $(this).addClass('dropdown').append("   "); } }); //Drop Down Menu $("ul#menu li:last").css({border: "none"}); $("ul#menu ul").css({display: "none"}); // Opera Fix $("ul#menu li.dropdown").hover(function(){ $(this).find('ul:first').css({ visibility: "visible",display: "none" }).show(268); $(this).children().addClass('menu_active'); },function(){ $(this).find('ul:first').css({visibility: "hidden"}); $(this).children().removeClass('menu_active'); }); //removes last border $("#menu ul li:last").css("border-right", "none"); //Specs Table $("table.specs tr:first-child, table.specs_small tr:first-child").addClass("firstrow"); $("table.specs tr:nth-child(2)").addClass("strongfy"); $("table.specs tr:even td:first-child").addClass("strongfy"); $("table.specs2 tr td:first-child").addClass("strongfy"); //Gallery pictuores hover $("#gallery img").mouseover(function() { $(this).addClass("hover"); }).mouseout(function(){ $(this).removeClass("hover"); }); //Color form fields ColorFields(); }); //Creates exists() function: jQuery.fn.exists = function(){ return this.length>0; } function ColorFields() { //Adding classes to inputs $('input[type="text"], textarea, select').addClass("inactive"); $('input[type="text"], textarea, select').focus(function() { $(this).removeClass("inactive").addClass("active"); if ($(this).val() == $(this).defaultValue){ $(this).val() = ''; } if(($(this).val() != $(this).defaultValue) || $(this).val()!='') { $(this).select(); } }); $('input[type="text"], textarea, select').blur(function() { $(this).removeClass("input_error"); $(this).removeClass("active").addClass("inactive"); if ($.trim(this.value == '')){ $(this).val() = ($(this).defaultValue ? $(this).defaultValue : ''); } }); } //functino ColorFields()