//var $j = jQuery.noConflict();

$(document).ready(function(){
		

		
		// ADD STYLE CLASS TO TEXT INPUTS
		$('input[@type=text]').addClass("text_input");
		$('input[@type=password]').addClass("text_input");	
		$('textarea').addClass("text_input");		
		
		
		// CHANGE TEXT INPUT CLASS ON FOCUS AND BLUR
		/*
		$('input[@type=text]').focus(function() {
			$(this).addClass("text_input_focus");
			
			$(this).blur(function() {
				$(this).removeClass("text_input_focus");	
			});
		});
		
		$('textarea').focus(function() {
			$(this).addClass("text_input_focus");
			
			$(this).blur(function() {
				$(this).removeClass("text_input_focus");	
			});
		});	
		*/
	$(".accountTable tr:even").addClass("alt");
	
	$("#nav li ul").hide();
		
	$("#nav li").hover(
		function(){ $("ul", this).show();
					thisid = $(this).attr("id");
					$(this).attr({id: thisid + "_over"});
				}, 
		function() { $("ul", this).hide();
					thisid = $(this).attr("id").replace("_over", "");
					$(this).attr({id: thisid});
				}
		
	);
	
	if (document.all) {
		$("#nav li").mouseover(
			function() {$(this).addClass("over");},
			function() {$(this).removeClass("over");}
		);
		$("#nav li").mouseout(
			function() {}
			//setTimeout("function() {$j(this).removeClass('over')}", 1000);
		);			
	}
	


});	
	



function followLink(hash)
{
	//window.location = hash.t.href;
	return true;
}

function showMessage(message)
{
	
	$('body').append('<div class="jqmWindow" id="dialog"><p class="message"></p><p><img src="/images/misc/progressbar_green.gif" /></p></div>');
	//
	
	$('#dialog').jqm({overlay: 80, overlayClass: 'jqmOverlay', modal: true, trigger: false, toTop: true});
	
	$('#dialog p.message').html(message);
	
	$('#dialog').jqmShow();
}

function hideMessage()
{
	$('#dialog').jqmHide();
	$('#dialog').remove();
}

function showTableLoading(targetTable, wrapper)
{
	$(wrapper).prepend('<div id=\"loadingTable\"><div><img src="/images/misc/progressbar_green.gif" /></div></div>');
	$('#loadingTable').height($(targetTable).outerHeight({ margin: false }));
}

function updateTableStripes(targetTable)
{
	$(targetTable).find('tbody tr:even').addClass('alt');
}

 
	

