function table_zebra(table_id){
	$(table_id + ' tbody tr:odd').addClass('ui-widget-content');
	$(table_id + ' tbody tr:even').addClass('ui-widget-header');
}
var isNav4, isIE4
if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
  isNav4 = (navigator.appName == "Netscape") ? true : false
  isIE4 = (navigator.appName.indexOf("Microsoft" != -1)) ? true : false
}

function winopen(link,width,height) {
   wopts  = 'width='+width+',height='+height+',resizable=1,alwaysRaised=1,scrollbars=1,location=0,toolbar=0,status=0';
   if (isNav4){
   wopts+=',screenX='+((screen.width-width)/2)+',screenY='+((screen.height-height)/2);
   }else wopts+=',left='+((screen.width-width)/2)+',top='+((screen.height-height)/2);
   window.open(link, 'popup_win', wopts);
}
/*
 * jQuery Disable On Submit Plugin
 * http://www.evanbot.com/article/jquery-disable-on-submit-plugin/13
 *
 * Copyright (c) 2009 Evan Byrne (http://www.evanbot.com)     
 */
$.fn.disableOnSubmit = function(disableList){
	
	if(disableList == null){var $list = 'input[type=submit],input[type=button],input[type=reset],button';}
	else{var $list = disableList;}
	
	// Makes sure button is enabled at start
	$(this).find($list).removeAttr('disabled');
	
	$(this).submit(function(){$(this).find($list).attr('disabled','disabled');});
	return this;
};
midFlag = new Array;
function activateContentPanel(objId){
	if (midFlag[objId]==0){
		$('#sideText_'+objId).removeClass('hide');
		$('#sideText_'+objId).removeClass('show');
		$('#sideText_'+objId).addClass('show');
		$('#sideText_'+objId).show();
		jQuery('#sideText_'+objId+':animated').stop();
		$('#sideText_'+objId).fadeTo(1, 1.0);
		midFlag[objId]=1;
	}else{
		jQuery('#sideText_'+objId+':animated').stop();
		$('#sideText_'+objId).fadeTo(1, 0.0);
		midFlag[objId]=0;
	}
	if (typeof(event) != 'undefined' ) event.returnValue = false;
}

fadeOutStopped = new Array;
function fadeContentPanel(objId, fadeIn){
	/*
	 $('div')
	.filter(function() {
		return this.id.match(/sideText_.*Right/);
	})
	.hide();
	 */
	$('#sideText_'+objId).removeClass('hide');
	$('#sideText_'+objId).removeClass('show');
	$('#sideText_'+objId).addClass('show');

	if (midFlag[objId] == 0){
		if (fadeIn){
			jQuery('#sideText_'+objId+':animated').stop();
			$('#sideText_'+objId).fadeTo(500, 1.0);
		}else{
			fadeOutStopped[objId] = 0;
			jQuery('#sideText_'+objId+':animated').stop();
			$('#sideText_'+objId).fadeTo(5000, 0.0);
		}
	}
	//document.location = '#' + objId;
	if (typeof(event) != 'undefined' ) event.returnValue = false;
}

var pulsatedObj = new Array();
function pulsate(lvId){
	clearTimeout(pulsatedObj[lvId]);
	jQuery('.pulsable_'+lvId).css('visibility', 'visible');
	jQuery('.pulsable_'+lvId).fadeTo(300,0.5, function(){
		jQuery('.pulsable_'+lvId).fadeTo(300,1.0, function(){
			pulsatedObj[lvId] = setTimeout('pulsate("'+lvId+'");',400);
		});
	} );
}

function pulsateStop(lvId){
	clearTimeout(pulsatedObj[lvId]);
	jQuery('.pulsable_'+lvId+':animated').stop();
	jQuery('.pulsable_'+lvId).fadeTo(300,1.0);
}
