/*
 * Jonathan Howard
 *
 * jQuery Pause
 * version 0.2
 *
 * pause() will hold everything in the queue for a given number of milliseconds,
 * or 1000 milliseconds if none is given.
 *
 * unpause() will clear the queue of everything of a given type, or 'fx' if no
 * type is given.
 */

$.fn.pause = function(milli,type) {
	milli = milli || 1000;
	type = type || "fx";
	return this.queue(type,function(){
		var self = this;
		setTimeout(function(){
			$.dequeue(self);
		},milli);
	});
};

$.fn.clearQueue = $.fn.unpause = function(type) {
	return this.each(function(){
		type = type || "fx";
		if(this.queue && this.queue[type]) {
			this.queue[type].length = 0;
		}
	});
};
// END jquery pause function


/* jQuery AlphaNumeric Plugin */
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(2($){$.c.f=2(p){p=$.d({g:"!@#$%^&*()+=[]\\\\\\\';,/{}|\\":<>?~`.- ",4:"",9:""},p);7 3.b(2(){5(p.G)p.4+="Q";5(p.w)p.4+="n";s=p.9.z(\'\');x(i=0;i<s.y;i++)5(p.g.h(s[i])!=-1)s[i]="\\\\"+s[i];p.9=s.O(\'|\');6 l=N M(p.9,\'E\');6 a=p.g+p.4;a=a.H(l,\'\');$(3).J(2(e){5(!e.r)k=o.q(e.K);L k=o.q(e.r);5(a.h(k)!=-1)e.j();5(e.u&&k==\'v\')e.j()});$(3).B(\'D\',2(){7 F})})};$.c.I=2(p){6 8="n";8+=8.P();p=$.d({4:8},p);7 3.b(2(){$(3).f(p)})};$.c.t=2(p){6 m="A";p=$.d({4:m},p);7 3.b(2(){$(3).f(p)})}})(C);',53,53,'||function|this|nchars|if|var|return|az|allow|ch|each|fn|extend||alphanumeric|ichars|indexOf||preventDefault||reg|nm|abcdefghijklmnopqrstuvwxyz|String||fromCharCode|charCode||alpha|ctrlKey||allcaps|for|length|split|1234567890|bind|jQuery|contextmenu|gi|false|nocaps|replace|numeric|keypress|which|else|RegExp|new|join|toUpperCase|ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('|'),0,{}));
// END jquery AlpahNumeric Plugin

$(function(){ // Chris Coyier's css menu functionality

    $("#nav ul.dropdown li").hover(function(){
    
        $(this).addClass("hover");
        $('ul:first',this).css('visibility', 'visible');
    
    }, function(){
    
        $(this).removeClass("hover");
        $('ul:first',this).css('visibility', 'hidden');
    
    });
    
    $("#nav ul.dropdown li ul li:has(ul)").find("a:first").append(" &raquo; ");

}); // end Chris Coyier's menu

/* START MASTER DOM FUNCTIONS */
$(document).ready(function(){ // MASTER DOM FUNCTIONS
	
	// $.preloadCssImages(); // preloadCssImagesjQuery_v5.js
	
	// footer link animation
	$('#footer ul.dropdown ul li a').hover(function() { //mouse in
		$(this).animate({ paddingLeft: '8px' }, 400);
	}, function() { //mouse out
		$(this).animate({ paddingLeft: 4 }, 400);
	});// end footer link animation
	

	
	// disable empty link jumping
	$('a[href=#]').click(function(){
		return false;															  	
	});//end empty link jumping
	// $('a[href=#]').attr('href', 'javascript:void(0);'); //alternate method	
	
	
	// *** jquery UI Dialog Test
	$('#dialog_box').hide(); //jquery ui dialog div start hidden
	$('#dialog_button').click(function(){ // jquery ui dialog test
	
	$("#dialog_box").load('user.login.php').dialog({width: 600, modal: true, title: 'Dialog Test Title', open:function() { 
		$(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar-close").remove();},
		
		buttons: { "Ok": function() { $(this).dialog("close"); }, "Cancel": function() { $(this).dialog("close"); } }
	
	});
	return false;
	});// ** end jquery UI Dialog Test
	
	
	/*$('.wymeditor').wymeditor({ // jquery wymeditor function
		stylesheet: '../css/skin.css'						  
	}); */
	
//	$('#sysmess').hide().fadeTo(3000, 0).fadeTo(1500, 1).fadeTo(10000, 1).fadeTo(1500, 0); //System Messages fadeIn & Out, timing not correct
//	$('#sysmess').hide().animate({opacity: 0.0}, 3000).fadeIn(1500).animate({opacity: 1.0}, 5000).fadeOut(1500); //System Messages fadeIn & Out, timing not correct
//	$('#sysmess').hide().fadeIn(2000); //System Messages fadeIn, no fadeOut

	$('#sysmess').hide()/*.pause(1500)*/.fadeIn(1500)/*.pause(10000).fadeOut(1500)*/; //System Messages using pause plugin
	
   $(".phone_num").mask("(999) 999-9999"); // jquery maskedinput for phone numbers
   $(".date_num").mask("9999-99-99"); // jquery maskedinput for date numbers
//   $(".currency_num").mask("99999.99"); // jquery maskinput for dollar values
   
	$.tablesorter.defaults.widgets = ['zebra']; // jquery tablesorter default settings
	$('.tablesort').tablesorter(); // jquery tablesorter data sorting
   
//   $(".validate_form").validate();// generic jquery form validation
//   $.validator.messages.required = ("*");// default jquery form validation settings
   
	 $('.currency_num').numeric({allow:"."});
//   $('form input[type=text]').alphanumeric({ichars:'"'}); // jquery alphanumeric - dissallow
//   $('form input[type=text]').alphanumeric({allow:"@.-_ "}); // jquery alphanumeric - allow
	
	
}); // END MASTER DOM FUNCTIONS
/* END MASTER DOM FUNCTIONS */
