/*
 * SimpleModal Basic Modal Dialog
 * http://www.ericmmartin.com/projects/simplemodal/
 * http://code.google.com/p/simplemodal/
 *
 * Copyright (c) 2010 Eric Martin - http://ericmmartin.com
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Revision: $Id: basic.js 254 2010-07-23 05:14:44Z emartin24 $
 */

jQuery(function ($) {
	// Load dialog on page load
	//$('#basic-modal-content').modal();

	// Load dialog on click
	$('#basic-modal .basic').click(function (e) {
		$('#basic-modal-content').modal();

		return false;
	});
	
	$('#basic-modal .basic').click(function (e) {
		var tagMake = $("#tagmake")
		var tagModel = $("#tagmodel")
		
//		tagMake.autocomplete({
//			data: [ ['Apple', 1], ['Apricot', 2], ['Accord', 3], ['Accordion', 4], ['Accon', 5], ['Honda', 6], ['Mitsubishi', 7], ['Pear', 8], ['Prume', 9]]
//		});
//		
//		tagModel.autocomplete({
//			data: [ ['Apple', 1], ['Apricot', 2], ['Accord', 3], ['Accordion', 4], ['Accon', 5], ['Honda', 6], ['Mitsubishi', 7], ['Pear', 8], ['Prume', 9]]
//		});
		
		tagMake.val("Enter Make")
		tagMake.addClass("grayText")
		tagModel.val("Enter Model")
		tagModel.addClass("grayText")
	});
	
	$("#tagmake").blur(function(){
		if($(this).val() == ""){
			$(this).val("Enter Make")
			$(this).addClass("grayText")
		}
	});
	$("#tagmake").focus(function(){
		if($(this).val() == "Enter Make"){
			$(this).val("")
			$(this).removeClass("grayText")
		}
	});	
	$("#tagmodel").blur(function(){
		if($(this).val() == ""){
			$(this).val("Enter Model")
			$(this).addClass("grayText")
		}
	});
	$("#tagmodel").focus(function(){
		if($(this).val() == "Enter Model"){
			$(this).val("")
			$(this).removeClass("grayText")
		}
	});
});
