jQuery.noConflict();
		jQuery(document).ready(function() {
			jQuery("#pfolio").bind('click', function(){
				jQuery('#nav .active').removeClass('active');
				jQuery('#nav #pfolio').addClass('active');
				if(jQuery("#container1").is(':visible'))
				{					
					jQuery("#container1").slideUp('slow',function(){jQuery("#container2").slideDown()});		
				}
				return false;
			});
			jQuery("#home").bind('click', function(){
				jQuery('#nav .active').removeClass('active');
				jQuery('#nav #home').addClass('active');
				if(jQuery("#container2").is(':visible'))
				{								
					jQuery("#container2").slideUp('slow',function(){jQuery("#container1").slideDown()});				
				}
				return false;
			});
			jQuery('#contact').popup({
				opacity:0.5,
				beforFn:function(){
						jQuery('#nav .active').addClass('inactive').removeClass('active');
						jQuery('#nav #contact').addClass('active')
						jQuery("#contact-error").hide();
						jQuery("#contact-loading").hide();
						jQuery("#contact-send").hide();
						jQuery(".contact-content").show();
						},
				afterCloseFn:function(){
						jQuery('#nav .inactive').addClass('active').removeClass('inactive');
						jQuery('#nav #contact').removeClass('active');}
			});			
			jQuery(".codaSliderC1").codaSlider();
			if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))
			{ //test for MSIE x.x;
				var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
				if (ieversion<7){jQuery(".codaSliderC2").codaSlider({cPanelSize:880})} 
					else {jQuery(".codaSliderC2").codaSlider({cPanelSize:876})} 
			}else{jQuery(".codaSliderC2").codaSlider({cPanelSize:876});}
								
			jQuery('.s3sliderC1').s3Slider({timeOut: 4500});
			jQuery('.s3sliderC2').s3Slider({timeOut: 4500});
			
			jQuery('#jsonForm').ajaxForm({ 
				beforeSubmit: function() {return showLoading(jQuery("#jsonForm").get(0))},
				// dataType identifies the expected content type of the server response 
				dataType:  'json', 
				// success identifies the function to invoke when the server response 
				// has been received 
				success:   processJson,
				error: function(a,b,data) { jQuery("#contact-loading").hide(0, function() {alert('Server Error: ' + data) } )}
			})
    });	
	function processJson(data) 
	{ 
		var error_message = '';
		// 'data' is the json object returned from the server
		if(data)
		{
			if(true == data.send) //message was send
			{
				jQuery("#contact-error").css("display","none");	
				setTimeout(function()
				{
					jQuery("#contact-loading").slideUp(200, function() 
					{
						jQuery("#contact-send").slideDown(200);
					});
				},800);
			} else if(data.message)//some error ocurred
			{
				error_message = data.message;				
			} else
			{			
				alert(data);				
			}
		}else
		{	
			error_message = "Server Error! Could not send request!";		
		}
		if(error_message)
		{
			setTimeout(function()
			{
				jQuery("#contact-loading").slideUp(200, function() 
				{
					jQuery("#contact-error").css("display","block");
					jQuery("#contact-error").html(error_message);
					jQuery(".contact-content").slideDown(600);
				});
			},800);
			
		}
	}
	function showLoading(form)
	{		
		jQuery(".contact-content").slideUp(400,function(){jQuery("#contact-loading").slideDown(200)});
		return true;
	}
