function popitup(url) {
	newwindow=window.open(url,'name','height=200,width=150');
	if (window.focus) {newwindow.focus()}
	return false;
}

// After document loads
$(document).ready(function() 
{
	// Set alternating form table rows
	$("table.form tr:odd").addClass("evenRow");
	$("table.sortedList tr:odd").addClass("evenRow");
	$("table.listing tr:odd").addClass("evenRow");
	$("table.indexListing tr:odd").addClass("evenRow");
	$("table.summary tr:odd").addClass("evenRow");
	$("table.itemsList tr:even").addClass("evenRow");
	$("div.listWrap  tr:even").addClass("evenRow");
	
	// feedback messages
	$("a.xit").click(function() {
		$(this).parent().fadeOut();
	});
	
	// popups
	$("a[@rel~='popup']").click(function(){
		window.open($(this).attr("href"),'File Selector','height=600,width=600');
		return false;
	});
	
	//Show active sub-lists in sub nav
	$("div#subNav").find("li.active").parent().css({display: "block"});
	
	//Inactive nav elements
	$("#contentNav li a.inactive").click(function(){
		alert("Please enter and save Property Details before editing this section.");
		return false;
	});
	
	//Image row preview toggles
	$("a.edit").click(function(){
		$(this).parent().hide();
		$(this).parent().parent().find("p.imgEdit").show();
		return false;
	});
	$("a.cancel").click(function(){
		$(this).parent().parent().find("p.imgPreview").show();
		$(this).parent().hide();
		return false;
	});
	
	//AUTO SIZE form table rows
	var width = $("table.form th label").width();
	//alert(width);
	var newwidth = width + 15;
	if( newwidth > 105 ) {
		$("table.form th").css({ width: newwidth + "px" });
	}
	
});

	//popup div
	function show(id) {
	document.getElementById(id).style.display = "block";
	}

	function hide(id) {
	document.getElementById(id).style.display = "none";
	}
