function change_image( path, name ){
	jQuery('#item-photo').attr({'src' : path});
	jQuery('#item-name').html( name );
}

jQuery(function()
{ 

jQuery("#closeThisThanks").click(function (event) {
	jQuery("#thanks4vote").fadeOut('fast');
});

jQuery("#language").click(function (event) {
	jQuery("#box-lang").animate({ top: "170"}, 600 );
	return false;
});

jQuery("#close-this").click(function (event) {
	jQuery("#box-lang").animate({ top: "-100"}, 600 );
	return false;
});

jQuery("#compare").click(function () { 
	jQuery("div#msg-compare").fadeIn("fast");
	jQuery("input.checkbox").fadeIn("fast");
});

jQuery("#tab-description").click(function (event) {
	jQuery("#scroll").animate({ marginLeft: "0"}, 500 );
	jQuery("#open-message").css({'background-position' : '0 0'});
	jQuery("#description-button").css({'background-position' : '0 -14px'});
	jQuery("#compare-button").css({'background-position' : '0 0'});
	jQuery("#feedback-button").css({'background-position' : '0 0'});
});

jQuery("#tab-compare").click(function (event) {
	jQuery("#scroll").animate({ marginLeft: "-620px"}, 500 );
	jQuery("#open-message").css({'background-position' : '0 -34px'});
	jQuery("#compare-button").css({'background-position' : '0 -14px'});
	jQuery("#description-button").css({'background-position' : '0 0'});
	jQuery("#feedback-button").css({'background-position' : '0 0'});
});

jQuery("#tab-feedback").click(function (event) {
	jQuery("#scroll").animate({ marginLeft: "-1240px"}, 500 );
	jQuery("#open-message").css({'background-position' : '0 -68px'});
	jQuery("#description-button").css({'background-position' : '0 0'});
	jQuery("#compare-button").css({'background-position' : '0 0'});	
	jQuery("#feedback-button").css({'background-position' : '0 -11px'});
});

jQuery("#send-form").click(function (event) {

	var name = jQuery("input#name").val();
	var mail = jQuery("input#mail").val();
	var msg = jQuery("textarea#msg").val();

	at = mail.indexOf("@")
	dot = mail.indexOf(".") 
	
	if ( name == "" ){
        jQuery("#err-name").animate({ marginLeft: "0"}, 300 );
        return false;
	}

	if ( (mail == "") || (at == -1) || (dot == -1) ){
        jQuery("#err-mail").animate({ marginLeft: "0"}, 300 );
        return false;
	}    

	if ( msg == "" ){
        jQuery("#err-msg").animate({ marginLeft: "0"}, 300 );
		return false;
	}     
    
    else {
		jQuery.facebox(name + ', thanks for you\'re feedback.')
		//$.facebox(function() { $.get('form.html', function(data) { $.facebox(data); });
    }  
        
});


});

function remove_error( id ){

	jQuery( id ).animate({ marginLeft: "120px"}, 300 );

}
