/*
	
	Project Name Global Javascript Functions
	By Petra Gregorova - ISITE Design

*/

// jquery no conflict. use $j or jQuery outside of ready function
var $j = jQuery.noConflict(); 


// jQuery document ready
jQuery(function($) {

	// JS enabled
	$j('html').addClass('js');
	$j("ul").find("li:last").addClass('last');
	
	//clear required input field when clicked
	$j(".required").click(function(){ $(this).attr({ value: '' }); });
	
	//add default value and clear it when clicked, but only clear if the default value is in the field.
     $(".required").attr({ value: 'required' }).focus(function(){
            if($j(this).val()=="required"){
               $j(this).val("");
            }
       });
	 
	 $(".required").attr({ value: 'required' }).focus(function(){
            if($j(this).val()=="required"){
               $j(this).val("");
            }
       }).blur(function(){
            if($j(this).val()==""){
               $j(this).val("");
            }
       });
	 
	 $('.contact-form button').wrapInner('<span></span>');
	 
	// Few setups for IE6
	if(document.all){
		//add class to drop downs and buttons 
	    $j('#nav li, button').hover(
			function() { $j(this).addClass('over'); },
			function() { $j(this).removeClass('over'); }
	    );
	}// if document.all

});// document ready


// application logic


// jQuery plugins


// etc

// clean console.log
function cl(){ if(window.console&&window.console.firebug) { var args = [].splice.call(arguments,0); console.log(args.join(" ")); } }//cl()
// example: cl("If you use cl() instead of console.log(), it won't break IE when you forget to take it out.");


// IE6 fixes
// make sure IE has the abbr and acronym tag
if(document.all){
	document.createElement("abbr");
	document.createElement("acronym");
}
// prevent IE6 flicker
try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
