$(function(){
	 $('#menu-level ul li a')
		.css({cursor:'pointer'})
		.css( {backgroundPosition: "0px 0px"} )		
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(0px -38px)"}, {duration:300, complete:function(){ 
			}})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(0px 0px)"}, {duration:200, complete:function(){ 
			 }})
		})
		.mousedown(function(){
			var thisId = $(this).attr('id');
			var to_thisId = new String("Zmieniono strone na : " + thisId);
			//alert("noey string: " + to_thisId);
			$.post("php/callBack.php", {thisTitle: to_thisId });
		})
	
	
    $("#c-right .mycarousel").jCarouselLite({
        btnNext: ".down",
        btnPrev: ".up",
		vertical: true,
 		easing: "easeInOutQuad",
		scroll: 3,
   		speed: 800,
		posPlace: ".menuUnDigito2"
    });
	
	// Photography
	 $("#gallery-box .mycarousel").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
 		easing: "easeInOutQuad",
		vertical: false,
		visibleHeight:190,
		scroll: 3,
		visible: 3,
   		speed: 1200,
		items:$('#gallery-box .mycarousel ul').children().size(),	
		//posPlace: ".menuUnDigito2"
		btnGo: [".externalControl .1", "null", "null", ".externalControl .4","null", "null", ".externalControl .7","null", "null", ".externalControl .10","null", "null", ".externalControl .13","null", "null",".externalControl .16", "null", "null", ".externalControl .19", "null", "null"]
    });
	
	
	// Webdesign
	 $("#webdesign-box .mycarousel").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
 		easing: "easeInOutQuad",
		vertical: false,
		visibleHeight:190,
		scroll: 1,
		visible: 1,
   		speed: 1200
    });
	
    $("a.l-group").fancybox({
		'hideOnContentClick': true
    });
	
	$('#webdesign-box .mycarousel .ul_webdesign a')
		.mousedown(function(){
			var thisTitle = $(this).attr('title');
			var thisRel = $(this).attr('rel');
			//$.post("php/function.php", {thisTitle: thisTitle, thisRel:thisRel });
			sendPHP (thisTitle,thisRel);
				
		})
		function sendPHP (thisTitle,thisRel) {
			$.post("php/callBack.php", {thisTitle: thisTitle, thisRel:thisRel },
					   function(data){
						//alert("Data loaded: " + data); 							
				   		}
			
				
				);
		}
		$('#f-menu a')
		.mousedown(function(){
			var thisId = $(this).attr('title');
			var to_thisId = new String("Zmieniono strone na : " + thisId);
			//alert("noey string: " + to_thisId);
			$.post("php/callBack.php", {thisTitle: to_thisId });
		})
		$('#commentform #email')			
		.focus(function(){
			var temp = "Please enter valid email !!!"
			var sEmail = $('#commentform #email').val();
			var empty = '';
			if(sEmail == temp){
				$('#commentform #email').val(empty);
				$('#commentform #email').attr('class', 'text_field_right');
			}
		
		})
		
		$('#commentform input#name')			
		.focus(function(){
			//alert("Nacisnieto name");			
			var temp = "Sorry, but this field is required"
			var sname = $('#commentform input#name').val();
			var empty = '';
			if(sname ==	 temp){				
				$('#commentform input#name').val(empty);
				$('#commentform input#name').attr('class' , 'text_field_left');
			}
			
		
		})

});


function validate_contact_us_form() {
	var bError = true;
	var sname = $('#commentform input#name').val();
	if (sname == '') {
		$('#commentform input#name').attr('class' , 'text_field_left-er');
		$('#commentform input#name').val("Sorry, but this field is required");		
	}
	
	var sEmail = $('#commentform #email').val();
 	if (sEmail == '' || !sEmail.match(/^\b[A-Z0-9._%+-]+@(?:[A-Z0-9\-]+\.)+[A-Z]{2,4}\b$/i)) 
	{ 
		$('#commentform #email').attr('class', 'text_field_right-er');
		$('#commentform #email').val("Please enter valid email !!!");
		bError = false;
	}
	
		
	if (bError == false) {
		return false;
	}
	else {
    	return true;
  	}
	
}
