jQuery.noConflict();

function urlparam(name) {
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

active = urlparam('site');
if(!active) active = 'home';

jQuery(document).ready(function(){

		jQuery('.nav').hover(function() {
        jQuery(this).animate({ height: "8%" }, {queue:false,duration:400}).css('background-color','#71c01c');
      }, function() {
        if(this.id != active) jQuery(this).animate({ height: "4%" }, {queue:false,duration:400}).css('background-color','#6cb121');
      }
    ).click(function() {
        jQuery('#'+active).animate({ height: "4%" }, {queue:false,duration:400}).css('background-color','#6cb121');
        active = this.id;
        jQuery('.content').fadeOut('slow',function(){
          window.setTimeout('jQuery("#'+active+'_content").fadeIn("slow");',700);
        });
      });
    
    jQuery("#kontakt_content #submit").click(function() {
    var url = 'http://www.codearts.at/jx_msg.php';
    var msg = jQuery('#kontakt_content #msg').val();
    var email = jQuery('#kontakt_content #email').val();
    var name = jQuery('#kontakt_content #name').val();
    var tel = jQuery('#kontakt_content #tel').val();
     
    jQuery.ajax({
       type: "POST",
       url: url,
       dataType: "html",
       data: {msg: msg, email: email, name: name, tel: tel},
       success: function(html) {
                jQuery("#notice").html(html);
                jQuery("#notice").corner("15px");
            		window.setTimeout("jQuery('#notice').fadeIn('slow');",1500);
            		window.setTimeout("jQuery('#notice').fadeOut('slow');",10000);
              	}
       });
    });
    
    jQuery("#kontakt_content #msg").click(function(){
        jQuery(this).val('');
    });

    jQuery(".content").corner("5px");
    jQuery(".fixed_content").corner("5px");

    if(active != 'home') jQuery('.content').hide();
    jQuery('#'+active+'_content').fadeIn("slow");    
    jQuery('#'+active).animate({ height: '8%' }, {queue:false,duration:400}).css('background-color','#71c01c');

});
