function popup(mylink, windowname, params) {
  if (!window.focus) return true;
  var href;

  if (typeof (mylink) == 'string')
    href = mylink;
  else
    href = mylink.href;

  if (params == '')
    params = 'width=400,height=200,scrollbars=yes';

  window.open(href, windowname, params);
  return false;
}

function closeSelf() {
  self.close();
  return false;
}

function getNumeric(val) {
  var numVal = jQuery.trim(val);
  numVal = numVal.toString().replace(/\$|\,/g, '');
  numVal = isNaN(numVal) || numVal === '' || numVal === null ? 0.00 : numVal;

  return parseFloat(numVal).toFixed(2);
}

$(document).ready(
	function() {

		// Open links with rel="external" in new window - like ye ole' target="_blank"
		$('a[rel="external"]').click(function() {window.open( $(this).attr('href') ); return false;});
		
		// Style form elements with uniform
		$("#content select, input:checkbox, input:radio, input:text, input.contentformsubmit").uniform();

		// Zebra-stripe data tables
		$("table.data tbody").each(function() {
			$(this).removeClass("odd even");
			$("tr:odd", this).addClass("odd");
			$("tr:even", this).addClass("even");
		});
		
		// Fancybox
		$(".floorplans .thumbnail a").fancybox();

	}
);

