function verifyLogin() {
	if (document.getElementById('email').value == "email" || document.getElementById('password').value == "password") {
		alert("Please enter your e-mail and password.");
		return false;
	}
	return true;
}

function clickclear(thisfield, defaulttext) {
	if (thisfield.value == defaulttext) {
		thisfield.value = "";
	}
}

function clickrecall(thisfield, defaulttext) {
	if (thisfield.value == "") {
		thisfield.value = defaulttext;
	}
}

function IsNumeric(strString)
   //  check for valid numeric strings
   {
   var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }



function submitSearch() {
	var cityzip = document.getElementById('cityzip').value;

	if (document.getElementById('cityzip').value == "City or Zip Code" && document.getElementById('tempmls').value == "") {
		alert("Please enter a city, zip code or MLS Number.");
		return;
	}
	else if (document.getElementById('tempmls').value != "") {
		document.getElementById('mls_id1').value = document.getElementById('tempmls').value;
		document.the_mls_form.search_type.value = "mls_id";
		document.the_mls_form.submit();
		return;
	}
	else if (IsNumeric(cityzip) == false) {
		document.qs_form.city.value = cityzip;
		document.qs_form.zipcode.value = "";
		document.qs_form.search_type.value = "city";
		document.qs_form.submit();
	}
	else {
		document.qs_form.zipcode.value = cityzip;
		document.qs_form.city.value = "";
		document.qs_form.search_type.value = "zipcode";
		document.qs_form.submit();
	}
}

function submitMap() {
	var cityzip = document.getElementById('cityzip').value;

	if (document.getElementById('cityzip').value == "City or Zip Code" && document.getElementById('tempmls').value == "") {
		alert("Please enter a city, zip code or MLS Number.");
		return;
	}
	else if (document.getElementById('tempmls').value != "") {
		document.getElementById('mls_id1').value = document.getElementById('tempmls').value;
		document.the_mls_form.search_type.value = "mls_id";
		document.the_mls_form.display_style.value = "map";
		document.the_mls_form.submit();
		return;
	}
	else if (IsNumeric(cityzip) == false) {
		document.qs_form.city.value = cityzip;
		document.qs_form.zipcode.value = "";
		document.qs_form.search_type.value = "city";
		document.qs_form.display_style.value = "map";
		document.qs_form.submit();
	}
	else {
		document.qs_form.zipcode.value = cityzip;
		document.qs_form.city.value = "";
		document.qs_form.search_type.value = "zipcode";
		document.qs_form.display_style.value = "map";
		document.qs_form.submit();
	}
}

jQuery(document).ready(function(){
    jQuery('.show_showing').hide();
    jQuery('.showing').click(function(){
        jQuery('.show_showing').fadeIn();
    });
    jQuery("ul.tabs").tabs("div.panes > div");
    $("img[rel]").overlay();
    jQuery('.left_img').click(function(){
        alert('Hello');
    });
    var title= window.location;
    jQuery('.fb').prepend('<iframe src="http://www.facebook.com/plugins/like.php?app_id=165809056824785&amp;href=' + title + '&amp;send=false&amp;layout=button_count&amp;width=200&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:80px; height:21px;" allowTransparency="true"></iframe>');
    jQuery('.location').append('<iframe width="600px" scrolling="no" height="350px" frameborder="0" marginwidth="0" marginheight="0" src="http://www.map-generator.org/81f39f79-463e-415f-b051-af8abddbd63e/iframe-map.aspx">');
    jQuery('.facebook').append('<iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FInglenook-Carmel%2F100553173337831&amp;width=269&amp;colorscheme=light&amp;show_faces=true&amp;border_color&amp;stream=false&amp;header=false&amp;height=248" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:269px; height:248px;" allowTransparency="true"></iframe>');
});
