jQuery(document).ready(function() {

	/*Changing the default text value on focus---------------------------*/
	jQuery('.default-value').each(function() {
		var default_value = this.value;
		jQuery(this).focus(function() {
			if(this.value == default_value) {
				this.value = '';
			}
		});
		jQuery(this).blur(function() {
			if(this.value == '') {
				this.value = default_value;
			}
		});
	});

	/*Showing plain text in a password field---------------------------*/
	jQuery('#password-clear').show();
	jQuery('#password-password').hide();

	jQuery('#password-clear').focus(function() {
		jQuery('#password-clear').hide();
		jQuery('#password-password').show();
		jQuery('#password-password').focus();
	});
	jQuery('#password-password').blur(function() {
		if(jQuery('#password-password').val() == '') {
			jQuery('#password-clear').show();
			jQuery('#password-password').hide();
			jQuery('#password-clear').val('Password');
		}
	});


    jQuery(function() {
        jQuery('a.lightbox').lightBox();
    });


	$(document).ready(function(){
		$("a[rel^='prettyPhoto']").prettyPhoto();

		$('#location_area').bind('click focus focusin focusout', function() {
			$('#location_area').blur();
		});
	});

	//$('#location_area').click( function(){ $('#location_area').blur();});

});

function showRestaurantImage(imgNr){
	switch(imgNr)
	{
		case '1':
			jQuery('#rest_img_2').fadeOut('slow');
			jQuery('#rest_img_3').fadeOut('slow');
			jQuery('#rest_img_1').fadeIn('slow');
		break;
		case '2':
			jQuery('#rest_img_1').fadeOut('slow');
			jQuery('#rest_img_3').fadeOut('slow');
			jQuery('#rest_img_2').fadeIn('slow');
		break;
		case '3':
			jQuery('#rest_img_1').fadeOut('slow');
			jQuery('#rest_img_2').fadeOut('slow');
			jQuery('#rest_img_3').fadeIn('slow');
		break;
		default:
			jQuery('#rest_img_2').hide();
			jQuery('#rest_img_3').hide();
			jQuery('#rest_img_1').show();
		break;
	}
}

function showHomePageRestaurantBox(nr, url){
	switch(nr)
	{
		//LATEST REVIEWED
		case '1':
			jQuery('#brand_new').hide('');
			jQuery('#special_offers').hide('');
			jQuery('#latest_reviewed').show('');
		 	jQuery('#brand_new_img').attr("src", url + "btn_brand_new_off.jpg");
		 	jQuery('#special_offers_img').attr("src", url + "btn_special_offers_off.jpg");
		 	jQuery('#latest_reviewed_img').attr("src", url + "btn_latest_reviewed_on.jpg");
		break;
		//BRAND NEW
		case '2':
			jQuery('#latest_reviewed').hide('');
			jQuery('#special_offers').hide('');
			jQuery('#brand_new').show('');
		 	jQuery('#brand_new_img').attr("src", url + "btn_brand_new_on.jpg");
		 	jQuery('#special_offers_img').attr("src", url + "btn_special_offers_off.jpg");
		 	jQuery('#latest_reviewed_img').attr("src", url + "btn_latest_reviewed_off.jpg");
		break;
		//SPECIAL OFFERS
		case '3':
			jQuery('#latest_reviewed').hide('');
			jQuery('#brand_new').hide('');
			jQuery('#special_offers').show('');
		 	jQuery('#brand_new_img').attr("src", url + "btn_brand_new_off.jpg");
		 	jQuery('#special_offers_img').attr("src", url + "btn_special_offers_on.jpg");
		 	jQuery('#latest_reviewed_img').attr("src", url + "btn_latest_reviewed_off.jpg");
		break;
	}
}

