		$(document).ready(function(){ 
		  
	    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	    $.getScript(gaJsHost + "google-analytics.com/ga.js", function(){

	    try {
	        var pageTracker = _gat._getTracker("UA-6453743-1");
	        pageTracker._trackPageview();
	    } catch(err) {}
					 	
			 $("div.jquery a:contains('Download')").click(function() {
				  pageTracker._trackEvent('Download', 'Clicked', 'jQuery Plugin');
			 });
			
	   	}); // end ga function

    // new window
    ////////////////////////////////////////////////////////////////////////////////////
    $('ol li a[href^="http://"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
		
    // control focus on input and textarea
    ////////////////////////////////////////////////////////////////////////////////////
    $(':input').not(':submit').focus(function() {
    $(this).css({'background-color':'#F0EED5', 'background-image':'none'});
    });
    $(':input').blur(function(){
    $(this).css({'background-image':'url(./images/graphic_45lines.png)'});
    });

    // clear form function
    ////////////////////////////////////////////////////////////////////////////////////
    $.fn.clearForm = function() {
    return this.each(function() {
    var type = this.type, tag = this.tagName.toLowerCase();
    if (tag == 'form')
    return $(':input',this).clearForm();
    if (type == 'text' || type == 'password' || tag == 'textarea')
    this.value = '';
    else if (type == 'checkbox' || type == 'radio')
    this.checked = false;
    else if (tag == 'select')
    this.selectedIndex = -1;
    });
    };

    // $('#contact_form').clearForm();
    $(':input').clearForm();

    // validate - bassistance.de
    ////////////////////////////////////////////////////////////////////////////////////
    $("#contact-form").validate({
    // errorLabelContainer: $("#error")
    // errorContainer: $("#error")
    errorPlacement: function(error, element) {
    error.insertAfter(element.prev());
    },
    rules: { firstname: { required: true }, email: { required: true, email: true }
    },
    messages: { firstname: "Please enter your name", email: { required: "Please enter your email",  email: "Please enter a valid email address" }}
    });
    // success: function(label) { label.text("ok!").addClass("success"); }  
	
    }); // end document ready
