/*  File: basic.js          */
/*  By:   Jeremy Tredway    */
/*  Ver:  2008-10-24        */

// generic check if not null
function notEmpty(str) {
	if((str != '') && (str != null) && (typeof str != 'undefined')) {
		return true;
	} else {
		return false;
	}
}

// synchronize height function
(function($){$.fn.syncHeight=function(settings){var max=0;var browser_id=0;var property=[['min-height','0px'],['height','1%']];if($.browser.msie&&$.browser.version<7){browser_id=1;}
$(this).each(function(){$(this).css(property[browser_id][0],property[browser_id][1]);var val=$(this).height();if(val>max){max=val;}});$(this).each(function(){$(this).css(property[browser_id][0],max+'px');});return this;};})(jQuery);


// onload routines
$(function(){

	// wrap buttons with extra markup
	$("a.button, button.button").wrapInner("<span></span>");
	$("input.button").wrap("<span class='button'></span>");
	$("span.button").each(function(){
		$(this).click(function() {
			$(this).children("input.button").click();
		});
	});

	// initialize table striping
	$(".striped tbody tr:not(.not_striped)").mouseover(function() {$(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");});
	$(".striped tbody tr:not(.not_striped):even").addClass("even");
	$(".striped tbody tr:not(.not_striped):odd").addClass("odd");

	// initialize table hover
	$(".hover tbody tr:not(.not_striped)").mouseover(function() {$(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");});

	// sync columns
	$("#order_meta .meta_col_inner").syncHeight();

});


