/*
 * SimpleModal Basic Modal Dialog
 * http://www.ericmmartin.com/projects/simplemodal/
 * http://code.google.com/p/simplemodal/
 *
 * Copyright (c) 2009 Eric Martin - http://ericmmartin.com
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Revision: $Id$
 *
 */

$(document).ready(function () {
	$('#emailFriend').click(function (e) {
		e.preventDefault();
		$('#modalContent').modal();
	});
});

$(document).ready(function () {
	$('#writeReview').click(function (e) {
		e.preventDefault();
		$('#modalContent1').modal();
	});
});

$(document).ready(function () {
	$('#addToCart').click(function (e) {
		e.preventDefault();
		$('#modalContent2').modal();
	});
});

$(document).ready(function () {
	$('#outOfStock').click(function (e) {
		e.preventDefault();
		$('#modalContent3').modal();
	});
});

$(document).ready(function () {
	$('#newShippingInfo').click(function (e) {
		e.preventDefault();
		$('#modalContent4').modal();
	});
});

$(document).ready(function () {
	$('#newBillingInfo').click(function (e) {
		e.preventDefault();
		$('#modalContent5').modal();
	});
});

$(document).ready(function () {
	$('#newShippingInfoLink').click(function (e) {
		e.preventDefault();
		$('#modalContent4').modal();
	});
});

$(document).ready(function(){
// this needs to be optimized.. sorry. 
 
	$("#search").bind("focus blur", function(){
		value = $(this).val();
		//alert(value);
		defaultValue = "I'm looking for...";
		//if the current and default value are the same, clear the input field
		if(value==defaultValue){
		  $(this).val("");
		}
		//if the field is empty, set the value to default
		if(!value){
		  $(this).val(defaultValue);
		}
	  }); 
	
	$("#zipcheck").bind("focus blur", function(){
		value = $(this).val();
		//alert(value);
		defaultValue = "Zip Code";
		//if the current and default value are the same, clear the input field
		if(value==defaultValue){
		  $(this).val("");
		}
		//if the field is empty, set the value to default
		if(!value){
		  $(this).val(defaultValue);
		}
	  }); 
	
	$("#newsemail").bind("focus blur", function(){
		value = $(this).val();
		//alert(value);
		defaultValue = "Email address";
		//if the current and default value are the same, clear the input field
		if(value==defaultValue){
		  $(this).val("");
		}
		//if the field is empty, set the value to default
		if(!value){
		  $(this).val(defaultValue);
		}
	  }); 
	 
	
});


$(document).ready(function () {
	$('.newShippingInfoClass').click(function (e) {
		e.preventDefault();
		$('#modalContent4').modal();
	});
});