$('html').addClass('js');

// General Form Error Function
function formErrors(f, errorInfo)
{
	if (  errorInfo[0] && errorInfo[0][0] )
	{
		
		$(errorInfo[0][0]).focus();
		$(errorInfo[0][0]).addClass('error');
			
		var error_div = $(errorInfo[0][0]).parents('form').find('div.errors');
			
		error_div.html( '<strong>WARNING:</strong> ' + errorInfo[0][1] ).fadeIn();
		return false;
	}	
}

$(document).ready(function() {				   
	
	var tabs = $("ul.tabs").tabs("div.panes > div.pane", { 
					  
		history: true,
		api:true,
		onBeforeClick :function(){ $('html, body').animate({scrollTop:0}, 'fast'); }		
		
		});
	
	$("ul.home_tabs").tabs("div.panes > div.pane",{
						   
		history:true,
		effect:'fade',
		fadeOutSpeed: "slow",
		rotate: true,
		onClick : function(){
			
			$('#home_slogan').html( this.getCurrentPane().attr('title') );
		}
						   
	}).slideshow({autoplay:true,clickable:false,interval:5000});
	
	$('#home_slogan').html( $("div.panes > div.pane:first").attr('title') );
	
	$('body.about_elitesuite').find('a#contact_us').click(
		function(){
																  
			tabs.click( '#pane_contact_us' );
			return false;
										
	}); 	
	
	$('body.elitefile').find('ul.elitefile_tabs').find('a').click(
		function(){
																  
			tabs.click( $(this).attr('rel') );
			return false;
										
	}); 
	
	$('body.case_studies').find('ul.case_study_tabs').find('a').click(
		function(){
																  
			tabs.click( $(this).attr('rel') );
			return false;
										
	}); 
	
	$('div.case_study_link a').click(
		function(){
																  
			tabs.click( $(this).attr('rel') );
			return false;
										
	}); 
	
	 $('#marquee').bxSlider({
		controls: false,
		pager: false,
	        wrapper_class: 'marquee',
	        margin: 0,
	        auto: true,
	        auto_controls: false,
		ticker: true
	    });

});




/**
 * Flash (http://jquery.lukelutman.com/plugins/flash)
 * A jQuery plugin for embedding Flash movies.
 * 
 * Version 1.0
 * November 9th, 2006
 *
 * Copyright (c) 2006 Luke Lutman (http://www.lukelutman.com)
 * Dual licensed under the MIT and GPL licenses.
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.opensource.org/licenses/gpl-license.php
 * 
 * Inspired by:
 * SWFObject (http://blog.deconcept.com/swfobject/)
 * UFO (http://www.bobbyvandersluis.com/ufo/)
 * sIFR (http://www.mikeindustries.com/sifr/)
 * 
 * IMPORTANT: 
 * The packed version of jQuery breaks ActiveX control
 * activation in Internet Explorer. Use JSMin to minifiy
 * jQuery (see: http://jquery.lukelutman.com/plugins/flash#activex).
 *
 **/ 
;(function(){
	
var $$;

/**
 * 
 * @desc Replace matching elements with a flash movie.
 * @author Luke Lutman
 * @version 1.0.1
 *
 * @name flash
 * @param Hash htmlOptions Options for the embed/object tag.
 * @param Hash pluginOptions Options for detecting/updating the Flash plugin (optional).
 * @param Function replace Custom block called for each matched element if flash is installed (optional).
 * @param Function update Custom block called for each matched if flash isn't installed (optional).
 * @type jQuery
 *
 * @cat plugins/flash
 * 
 * @example $('#hello').flash({ src: 'hello.swf' });
 * @desc Embed a Flash movie.
 *
 * @example $('#hello').flash({ src: 'hello.swf' }, { version: 8 });
 * @desc Embed a Flash 8 movie.
 *
 * @example $('#hello').flash({ src: 'hello.swf' }, { expressInstall: true });
 * @desc Embed a Flash movie using Express Install if flash isn't installed.
 *
 * @example $('#hello').flash({ src: 'hello.swf' }, { update: false });
 * @desc Embed a Flash movie, don't show an update message if Flash isn't installed.
 *
**/
$$ = jQuery.fn.flash = function(htmlOptions, pluginOptions, replace, update) {
	
	// Set the default block.
	var block = replace || $$.replace;
	
	// Merge the default and passed plugin options.
	pluginOptions = $$.copy($$.pluginOptions, pluginOptions);
	
	// Detect Flash.
	if(!$$.hasFlash(pluginOptions.version)) {
		// Use Express Install (if specified and Flash plugin 6,0,65 or higher is installed).
		if(pluginOptions.expressInstall && $$.hasFlash(6,0,65)) {
			// Add the necessary flashvars (merged later).
			var expressInstallOptions = {
				flashvars: {  	
					MMredirectURL: location,
					MMplayerType: 'PlugIn',
					MMdoctitle: jQuery('title').text() 
				}					
			};
		// Ask the user to update (if specified).
		} else if (pluginOptions.update) {
			// Change the block to insert the update message instead of the flash movie.
			block = update || $$.update;
		// Fail
		} else {
			// The required version of flash isn't installed.
			// Express Install is turned off, or flash 6,0,65 isn't installed.
			// Update is turned off.
			// Return without doing anything.
			return this;
		}
	}
	
	// Merge the default, express install and passed html options.
	htmlOptions = $$.copy($$.htmlOptions, expressInstallOptions, htmlOptions);
	
	// Invoke $block (with a copy of the merged html options) for each element.
	return this.each(function(){
		block.call(this, $$.copy(htmlOptions));
	});
	
};
/**
 *
 * @name flash.copy
 * @desc Copy an arbitrary number of objects into a new object.
 * @type Object
 * 
 * @example $$.copy({ foo: 1 }, { bar: 2 });
 * @result { foo: 1, bar: 2 };
 *
**/
$$.copy = function() {
	var options = {}, flashvars = {};
	for(var i = 0; i < arguments.length; i++) {
		var arg = arguments[i];
		if(arg == undefined) continue;
		jQuery.extend(options, arg);
		// don't clobber one flash vars object with another
		// merge them instead
		if(arg.flashvars == undefined) continue;
		jQuery.extend(flashvars, arg.flashvars);
	}
	options.flashvars = flashvars;
	return options;
};
/*
 * @name flash.hasFlash
 * @desc Check if a specific version of the Flash plugin is installed
 * @type Boolean
 *
**/
$$.hasFlash = function() {
	// look for a flag in the query string to bypass flash detection
	if(/hasFlash\=true/.test(location)) return true;
	if(/hasFlash\=false/.test(location)) return false;
	var pv = $$.hasFlash.playerVersion().match(/\d+/g);
	var rv = String([arguments[0], arguments[1], arguments[2]]).match(/\d+/g) || String($$.pluginOptions.version).match(/\d+/g);
	for(var i = 0; i < 3; i++) {
		pv[i] = parseInt(pv[i] || 0);
		rv[i] = parseInt(rv[i] || 0);
		// player is less than required
		if(pv[i] < rv[i]) return false;
		// player is greater than required
		if(pv[i] > rv[i]) return true;
	}
	// major version, minor version and revision match exactly
	return true;
};
/**
 *
 * @name flash.hasFlash.playerVersion
 * @desc Get the version of the installed Flash plugin.
 * @type String
 *
**/
$$.hasFlash.playerVersion = function() {
	// ie
	try {
		try {
			// avoid fp6 minor version lookup issues
			// see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
			var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
			try { axo.AllowScriptAccess = 'always';	} 
			catch(e) { return '6,0,0'; }				
		} catch(e) {}
		return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
	// other browsers
	} catch(e) {
		try {
			if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
				return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
			}
		} catch(e) {}}
	return '0,0,0';
};
/**
 *
 * @name flash.htmlOptions
 * @desc The default set of options for the object or embed tag.
 *
**/
$$.htmlOptions = {
	height: 240,
	flashvars: {},
	pluginspage: 'http://www.adobe.com/go/getflashplayer',
	src: '#',
	type: 'application/x-shockwave-flash',
	width: 320		
};
/**
 *
 * @name flash.pluginOptions
 * @desc The default set of options for checking/updating the flash Plugin.
 *
**/
$$.pluginOptions = {
	expressInstall: false,
	update: true,
	version: '6.0.65'
};
/**
 *
 * @name flash.replace
 * @desc The default method for replacing an element with a Flash movie.
 *
**/
$$.replace = function(htmlOptions) {
	this.innerHTML = '<div class="alt">'+this.innerHTML+'</div>';
	jQuery(this)
		.addClass('flash-replaced')
		.prepend($$.transform(htmlOptions));
};
/**
 *
 * @name flash.update
 * @desc The default method for replacing an element with an update message.
 *
**/
$$.update = function(htmlOptions) {
	var url = String(location).split('?');
	url.splice(1,0,'?hasFlash=true&');
	url = url.join('');
	var msg = '<p>This content requires the Flash Player. <a href="http://www.adobe.com/go/getflashplayer">Download Flash Player</a>. Already have Flash Player? <a href="'+url+'">Click here.</a></p>';
	this.innerHTML = '<span class="alt">'+this.innerHTML+'</span>';
	jQuery(this)
		.addClass('flash-update')
		.prepend(msg);
};
/**
 *
 * @desc Convert a hash of html options to a string of attributes, using Function.apply(). 
 * @example toAttributeString.apply(htmlOptions)
 * @result foo="bar" foo="bar"
 *
**/
function toAttributeString() {
	var s = '';
	for(var key in this)
		if(typeof this[key] != 'function')
			s += key+'="'+this[key]+'" ';
	return s;		
};
/**
 *
 * @desc Convert a hash of flashvars to a url-encoded string, using Function.apply(). 
 * @example toFlashvarsString.apply(flashvarsObject)
 * @result foo=bar&foo=bar
 *
**/
function toFlashvarsString() {
	var s = '';
	for(var key in this)
		if(typeof this[key] != 'function')
			s += key+'='+encodeURIComponent(this[key])+'&';
	return s.replace(/&$/, '');		
};
/**
 *
 * @name flash.transform
 * @desc Transform a set of html options into an embed tag.
 * @type String 
 *
 * @example $$.transform(htmlOptions)
 * @result <embed src="foo.swf" ... />
 *
 * Note: The embed tag is NOT standards-compliant, but it 
 * works in all current browsers. flash.transform can be
 * overwritten with a custom function to generate more 
 * standards-compliant markup.
 *
**/
$$.transform = function(htmlOptions) {
	htmlOptions.toString = toAttributeString;
	if(htmlOptions.flashvars) htmlOptions.flashvars.toString = toFlashvarsString;
	return '<embed ' + String(htmlOptions) + '/>';		
};

/**
 *
 * Flash Player 9 Fix (http://blog.deconcept.com/2006/07/28/swfobject-143-released/)
 *
**/
if (window.attachEvent) {
	window.attachEvent("onbeforeunload", function(){
		__flash_unloadHandler = function() {};
		__flash_savedUnloadHandler = function() {};});
}
	
})(); 
/*
bxSlider v2.0
Plugin developed by: Steven Wanderski
http://bxslider.com
http://stevenwanderski.com

Released under the GPL license:
http://www.gnu.org/licenses/gpl.html
*/

(function($){$.fn.bxSlider=function(options){var defaults={alignment:'horizontal',controls:true,speed:500,pager:true,pager_short:false,pager_short_separator:' / ',margin:0,next_text:'next',next_image:'',prev_text:'prev',prev_image:'',auto:false,pause:3500,auto_direction:'next',auto_hover:true,auto_controls:false,ticker:false,ticker_controls:false,ticker_direction:'next',ticker_hover:true,stop_text:'stop',start_text:'start',wrapper_class:'bxslider_wrap'};var o=$.extend(defaults,options);return this.each(function(){var $this=$(this);var $kids=$this.children();var l=$this.children().length;var first=$this.children(':first').clone();var last=$this.children(':last').clone();var w=0,h=0,current_temp=0,pos=0,d=0;var is_working=false,playing=true,tick_play=true;var current=1;var ease='swing',side='',t='';var ani={};$this.append(first).prepend(last);$this.wrap('<div class="bxslider_container"></div>');$this.parent().wrap('<div class="'+o.wrapper_class+'"></div>');if(o.alignment=='horizontal'){$this.children().css({'float':'left','listStyle':'none','marginRight':o.margin});w=first.outerWidth(true);$this.css({'width':'99999px','position':'relative','left':-w});$this.parent().css({'position':'relative','overflow':'hidden','width':w-o.margin});}else if(o.alignment=='vertical'){$kids.each(function(){if($(this).height()>h){h=$(this).height();}});w=first.outerWidth();$this.children().css({'height':h,'listStyle':'none','marginBottom':o.margin});$this.css({'height':'99999px','width':w,'position':'relative','top':-(h+o.margin)});$this.parent().css({'position':'relative','overflow':'hidden','height':h})}
if(o.pager&&!o.ticker){$this.parent().after('<div class="bx_pager"></div>');if(!o.pager_short){var $a;$kids.each(function(index){$a=$('<a href="#">'+(index+1)+'</a>');$this.parent().siblings('.bx_pager').append($a);$a.click(function(){is_working=false;tick_play=false;$this.stop();move_slide(index+1);current=index+1;if(o.auto){clearInterval(t);$this.parent().siblings('.auto_controls').find('a').html(o.start_text);playing=false;}
else if(o.ticker){$this.parent().siblings('.ticker_controls').find('a').html(o.start_text);playing=false;}
return false;});});}else{$this.parent().siblings('.bx_pager').append();}
set_active(1);}
if(o.controls&&!o.ticker){if(o.next_image!=''||o.prev_image!=''){$this.parent().after('<a class="prev" href="#"><img src="'+o.prev_image+'" /></a><a class="next" href="#"><img src="'+o.next_image+'" /></a>');}
else{$this.parent().after('<a class="prev" href="#">'+o.prev_text+'</a><a class="next" href="#">'+o.next_text+'</a>');}
$this.parent().siblings('.next').click(function(){if(!is_working){move_slide(++current);}
if(o.auto){clearInterval(t);$this.parent().siblings('.auto_controls').find('a').html(o.start_text);playing=false;}
return false;});$this.parent().siblings('.prev').click(function(){if(!is_working){move_slide(--current);}
if(o.auto){clearInterval(t);$this.parent().siblings('.auto_controls').find('a').html(o.start_text);playing=false;}
return false;});}
if(o.auto&&!o.ticker){t=setInterval(function(){if(o.auto_direction=='next'){move_slide(++current);}else{move_slide(--current);}},o.pause);if(o.auto_hover){$this.hover(function(){clearInterval(t);},function(){if(playing){t=setInterval(function(){if(o.auto_direction=='next'){move_slide(++current);}
else{move_slide(--current);}},o.pause);}});}
if(o.auto_controls){$this.parent().after('<div class="auto_controls"><a class="auto_link" href="#">'+o.stop_text+'</a></div>');$this.parent().siblings('.auto_controls').find('a').click(function(){if(playing){clearInterval(t);$(this).html(o.start_text);playing=false;}
else{t=setInterval(function(){if(o.auto_direction=='next'){move_slide(++current);}else{move_slide(--current);}},o.pause);$(this).html(o.stop_text);playing=true;}
return false;});}}
if(o.ticker){var tick_play=true;tick_slide();$this.hover(function(){$this.stop();},function(){if(tick_play){tick_slide();}});if(o.ticker_controls){$this.parent().after('<div class="ticker_controls"><a class="ticker_link" href="#">'+o.stop_text+'</a></div>');$this.parent().siblings('.ticker_controls').find('a').click(function(){if(tick_play){$this.stop();$(this).html(o.start_text);tick_play=false;}
else{is_working=false;$(this).html(o.stop_text)
tick_slide();tick_play=true;}
return false;});}}
function tick_slide(){if(o.ticker_direction=='next'&&o.alignment=='horizontal'){$this.animate({left:'-=5px'},o.speed/5,'linear',function(){if(parseInt($this.css('left'))<=-((l+1)*w)){$this.css('left',-w);}
tick_slide();});}else if(o.ticker_direction=='prev'&&o.alignment=='horizontal'){$this.animate({left:'+=5px'},o.speed/5,'linear',function(){if(parseInt($this.css('left'))>=-(w)){$this.css('left',-((l+1)*w));}
tick_slide();});}else if(o.ticker_direction=='next'&&o.alignment=='vertical'){$this.animate({top:'-=5px'},o.speed/5,'linear',function(){if(parseInt($this.css('top'))<=-((l+1)*(h+o.margin))){$this.css('top',-(h+o.margin));}
tick_slide();});}else if(o.ticker_direction=='prev'&&o.alignment=='vertical'){$this.animate({top:'+=4px'},o.speed/5,'linear',function(){if(parseInt($this.css('top'))>-(h+o.margin)){$this.css('top',-((l+1)*(h+o.margin-1)));}
tick_slide();});}}
function move_slide(num){if(o.ticker){ease='linear';}
if(!is_working){if(o.alignment=='horizontal'){d=w;side='left';}
else if(o.alignment=='vertical'){d=h+o.margin;side='top';}
pos=num*d;ani[side]=-pos;is_working=true;$this.animate(ani,o.speed,ease,function(){is_working=false;if(current>l){$this.css(side,-d);current=1;}
else if(current<1){$this.css(side,-(d*l));current=l;}
set_active(current);});}}
function set_active(num){if(o.pager&&!o.pager_short){$this.parent().siblings('.bx_pager').find('a').removeClass('active').eq(num-1).addClass('active');}
else if(o.pager_short){$this.parent().siblings('.bx_pager').html(num+o.pager_short_separator+$kids.length);}}});};})(jQuery); 
(function($){var options={};var returnHash=[];$.fn.RSV=function(params){options=$.extend({},$.fn.RSV.defaults,params);return this.each(function(){$(this).bind('submit',{currForm:this,options:options},$(this).RSV.validate);});};$.fn.RSV.defaults={rules:[],displayType:"alert-all",errorFieldClass:null,errorTextIntro:"Please fix the following error(s) and resubmit:",errorJSItemBullet:"* ",errorHTMLItemBullet:"&bull; ",errorTargetElementId:"rsvErrors",customErrorHandler:null,onCompleteHandler:null};$.fn.RSV.validate=function(event)
{options=event.data.options;var form=event.data.currForm;var rules=options.rules;returnHash=[];for(var i=0;i<rules.length;i++)
{var row=rules[i].replace(/\\,/ig,"%%C%%");row=row.split(",");var satisfiesIfConditions=true;while(row[0].match("^if:"))
{var cond=row[0];cond=cond.replace("if:","");var comparison="equal";var parts=[];if(cond.search("!=")!=-1)
{parts=cond.split("!=");comparison="not_equal";}
else
parts=cond.split("=");var fieldToCheck=parts[0];var valueToCheck=parts[1];var fieldnameValue="";if(form[fieldToCheck].type==undefined)
{for(var j=0;j<form[fieldToCheck].length;j++)
{if(form[fieldToCheck][j].checked)
fieldnameValue=form[fieldToCheck][j].value;}}
else if(form[fieldToCheck].type=="checkbox")
{if(form[fieldToCheck].checked)
fieldnameValue=form[parts[0]].value;}
else
fieldnameValue=form[parts[0]].value;if(comparison=="equal"&&fieldnameValue!=valueToCheck)
{satisfiesIfConditions=false;break;}
else if(comparison=="not_equal"&&fieldnameValue==valueToCheck)
{satisfiesIfConditions=false;break;}
else
row.shift();}
if(!satisfiesIfConditions)
continue;var requirement=row[0];var fieldName=row[1];var fieldName2,fieldName3,errorMessage,lengthRequirements,date_flag;if(requirement!="function"&&form[fieldName]==undefined)
{alert("RSV Error: the field \""+fieldName+"\" doesn't exist! Please check your form and settings.");return false;}
if(requirement!="function"&&options.errorFieldClass)
{if(form[fieldName].type==undefined)
{for(var j=0;j<form[fieldName].length;j++)
{if($(form[fieldName][j]).hasClass(options.errorFieldClass))
$(form[fieldName][j]).removeClass(options.errorFieldClass);}}
else
{if($(form[fieldName]).hasClass(options.errorFieldClass))
$(form[fieldName]).removeClass(options.errorFieldClass);}}
if(row.length==6)
{fieldName2=row[2];fieldName3=row[3];date_flag=row[4];errorMessage=row[5];}
else if(row.length==5)
{fieldName2=row[2];fieldName3=row[3];errorMessage=row[4];}
else if(row.length==4)
{fieldName2=row[2];errorMessage=row[3];}
else
errorMessage=row[2];if(requirement.match("^length"))
{lengthRequirements=requirement;requirement="length";}
if(requirement.match("^range"))
{rangeRequirements=requirement;requirement="range";}
switch(requirement)
{case"required":if(form[fieldName].type==undefined)
{var oneIsChecked=false;for(var j=0;j<form[fieldName].length;j++)
{if(form[fieldName][j].checked)
oneIsChecked=true;}
if(!oneIsChecked)
{if(!processError(form[fieldName],errorMessage))
return false;}}
else if(form[fieldName].type=="select-multiple")
{var oneIsSelected=false;for(var k=0;k<form[fieldName].length;k++)
{if(form[fieldName][k].selected)
oneIsSelected=true;}
if(!oneIsSelected||form[fieldName].length==0)
{if(!processError(form[fieldName],errorMessage))
return false;}}
else if(form[fieldName].type=="checkbox")
{if(!form[fieldName].checked)
{if(!processError(form[fieldName],errorMessage))
return false;}}
else if(!form[fieldName].value)
{if(!processError(form[fieldName],errorMessage))
return false;}
break;case"digits_only":if(form[fieldName].value&&form[fieldName].value.match(/\D/))
{if(!processError(form[fieldName],errorMessage))
return false;}
break;case"letters_only":if(form[fieldName].value&&form[fieldName].value.match(/[^a-zA-Z]/))
{if(!processError(form[fieldName],errorMessage))
return false;}
break;case"is_alpha":if(form[fieldName].value&&form[fieldName].value.match(/\W/))
{if(!processError(form[fieldName],errorMessage))
return false;}
break;case"custom_alpha":var conversion={"L":"[A-Z]","V":"[AEIOU]","l":"[a-z]","v":"[aeiou]","D":"[a-zA-Z]","F":"[aeiouAEIOU]","C":"[BCDFGHJKLMNPQRSTVWXYZ]","x":"[0-9]","c":"[bcdfghjklmnpqrstvwxyz]","X":"[1-9]","E":"[bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ]"};var reg_exp_str="";for(var j=0;j<fieldName2.length;j++)
{if(conversion[fieldName2.charAt(j)])
reg_exp_str+=conversion[fieldName2.charAt(j)];else
reg_exp_str+=fieldName2.charAt(j);}
var reg_exp=new RegExp(reg_exp_str);if(form[fieldName].value&&reg_exp.exec(form[fieldName].value)==null)
{if(!processError(form[fieldName],errorMessage))
return false;}
break;case"reg_exp":var reg_exp_str=fieldName2.replace(/%%C%%/ig, ",");if(row.length==5)
var reg_exp=new RegExp(reg_exp_str,fieldName3);else
var reg_exp=new RegExp(reg_exp_str);if(form[fieldName].value&&reg_exp.exec(form[fieldName].value)==null)
{if(!processError(form[fieldName],errorMessage))
return false;}
break;case"length":comparison_rule="";rule_string="";if(lengthRequirements.match(/length=/))
{comparison_rule="equal";rule_string=lengthRequirements.replace("length=","");}
else if(lengthRequirements.match(/length>=/))
{comparison_rule="greater_than_or_equal";rule_string=lengthRequirements.replace("length>=","");}
else if(lengthRequirements.match(/length>/))
{comparison_rule="greater_than";rule_string=lengthRequirements.replace("length>","");}
else if(lengthRequirements.match(/length<=/))
{comparison_rule="less_than_or_equal";rule_string=lengthRequirements.replace("length<=","");}
else if(lengthRequirements.match(/length</))
{comparison_rule="less_than";rule_string=lengthRequirements.replace("length<","");}
switch(comparison_rule)
{case"greater_than_or_equal":if(!(form[fieldName].value.length>=parseInt(rule_string)))
{if(!processError(form[fieldName],errorMessage))
return false;}
break;case"greater_than":if(!(form[fieldName].value.length>parseInt(rule_string)))
{if(!processError(form[fieldName],errorMessage))
return false;}
break;case"less_than_or_equal":if(!(form[fieldName].value.length<=parseInt(rule_string)))
{if(!processError(form[fieldName],errorMessage))
return false;}
break;case"less_than":if(!(form[fieldName].value.length<parseInt(rule_string)))
{if(!processError(form[fieldName],errorMessage))
return false;}
break;case"equal":var range_or_exact_number=rule_string.match(/[^_]+/);var fieldCount=range_or_exact_number[0].split("-");if(fieldCount.length==2)
{if(form[fieldName].value.length<fieldCount[0]||form[fieldName].value.length>fieldCount[1])
{if(!processError(form[fieldName],errorMessage))
return false;}}
else
{if(form[fieldName].value.length!=fieldCount[0])
{if(!processError(form[fieldName],errorMessage))
return false;}}
break;}
break;case"valid_email":if(form[fieldName].value&&!isValidEmail(form[fieldName].value))
{if(!processError(form[fieldName],errorMessage))
return false;}
break;case"valid_date":var isLaterDate=false;if(date_flag=="later_date")
isLaterDate=true;else if(date_flag=="any_date")
isLaterDate=false;if(!isValidDate(form[fieldName].value,form[fieldName2].value,form[fieldName3].value,isLaterDate))
{if(!processError(form[fieldName],errorMessage))
return false;}
break;case"same_as":if(form[fieldName].value!=form[fieldName2].value)
{if(!processError(form[fieldName],errorMessage))
return false;}
break;case"range":comparison_rule="";rule_string="";if(rangeRequirements.match(/range=/))
{comparison_rule="equal";rule_string=rangeRequirements.replace("range=","");}
else if(rangeRequirements.match(/range>=/))
{comparison_rule="greater_than_or_equal";rule_string=rangeRequirements.replace("range>=","");}
else if(rangeRequirements.match(/range>/))
{comparison_rule="greater_than";rule_string=rangeRequirements.replace("range>","");}
else if(rangeRequirements.match(/range<=/))
{comparison_rule="less_than_or_equal";rule_string=rangeRequirements.replace("range<=","");}
else if(rangeRequirements.match(/range</))
{comparison_rule="less_than";rule_string=rangeRequirements.replace("range<","");}
switch(comparison_rule)
{case"greater_than_or_equal":if(!(form[fieldName].value>=Number(rule_string)))
{if(!processError(form[fieldName],errorMessage))
return false;}
break;case"greater_than":if(!(form[fieldName].value>Number(rule_string)))
{if(!processError(form[fieldName],errorMessage))
return false;}
break;case"less_than_or_equal":if(!(form[fieldName].value<=Number(rule_string)))
{if(!processError(form[fieldName],errorMessage))
return false;}
break;case"less_than":if(!(form[fieldName].value<Number(rule_string)))
{if(!processError(form[fieldName],errorMessage))
return false;}
break;case"equal":var rangeValues=rule_string.split("-");if((form[fieldName].value<Number(rangeValues[0]))||(form[fieldName].value>Number(rangeValues[1])))
{if(!processError(form[fieldName],errorMessage))
return false;}
break;}
break;case"function":custom_function=fieldName;eval("var result = "+custom_function+"()");if(result.constructor.toString().indexOf("Array")!=-1)
{for(var j=0;j<result.length;j++)
{if(!processError(result[j][0],result[j][1]))
return false;}}
break;default:alert("Unknown requirement flag in validateFields(): "+requirement);return false;}}
if(typeof options.customErrorHandler=='function')
return options.customErrorHandler(form,returnHash);else if(options.displayType=="alert-all")
{var errorStr=options.errorTextIntro+"\n\n";for(var i=0;i<returnHash.length;i++)
{errorStr+=options.errorJSItemBullet+returnHash[i][1]+"\n";styleField(returnHash[i][0],i==0);}
if(returnHash.length>0)
{alert(errorStr);return false;}}
else if(options.displayType=="display-html")
{var success=displayHTMLErrors(form,returnHash);if(!success)
return false;}
if(typeof options.onCompleteHandler=='function')
return options.onCompleteHandler();else
return true;}
function processError(obj,message)
{message=message.replace(/%%C%%/ig,",");var continueProcessing=true;switch(options.displayType)
{case"alert-one":alert(message);styleField(obj,true);continueProcessing=false;break;case"alert-all":case"display-html":returnHash.push([obj,message]);break;}
return continueProcessing;}
function displayHTMLErrors(f,errorInfo)
{var errorHTML=options.errorTextIntro+"<br /><br />";for(var i=0;i<errorInfo.length;i++)
{errorHTML+=options.errorHTMLItemBullet+errorInfo[i][1]+"<br />";styleField(errorInfo[i][0],i==0);}
if(errorInfo.length>0)
{$("#"+options.errorTargetElementId).css("display","block");$("#"+options.errorTargetElementId).html(errorHTML);return false;}
return true;}
function styleField(field,focus)
{if(field.type==undefined)
{if(focus)
field[0].focus();for(var i=0;i<field.length;i++)
{if(!$(field[i]).hasClass(options.errorFieldClass))
$(field[i]).addClass(options.errorFieldClass);}}
else
{if(options.errorFieldClass)
$(field).addClass(options.errorFieldClass);if(focus)
field.focus();}}
function isValidEmail(str)
{var s=$.trim(str);var at="@";var dot=".";var lat=s.indexOf(at);var lstr=s.length;var ldot=s.indexOf(dot);if(s.indexOf(at)==-1||(s.indexOf(at)==-1||s.indexOf(at)==0||s.indexOf(at)==lstr)||(s.indexOf(dot)==-1||s.indexOf(dot)==0||s.indexOf(dot)==lstr)||(s.indexOf(at,(lat+1))!=-1)||(s.substring(lat-1,lat)==dot||s.substring(lat+1,lat+2)==dot)||(s.indexOf(dot,(lat+2))==-1)||(s.indexOf(" ")!=-1))
{return false;}
return true;}
function isValidDate(month,day,year,isLaterDate)
{var daysInMonth;if((year%4==0)&&((year%100!=0)||(year%400==0)))
daysInMonth=[31,29,31,30,31,30,31,31,30,31,30,31];else
daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31];if(!month||!day||!year)return false;if(1>month||month>12)return false;if(year<0)return false;if(1>day||day>daysInMonth[month-1])return false;if(isLaterDate)
{var today=new Date();var currMonth=today.getMonth()+1;var currDay=today.getDate();var currYear=today.getFullYear();if(String(currMonth).length==1)currMonth="0"+currMonth;if(String(currDay).length==1)currDay="0"+currDay;var currDate=String(currYear)+String(currMonth)+String(currDay);if(String(month).length==1)month="0"+month;if(String(day).length==1)day="0"+day;incomingDate=String(year)+String(month)+String(day);if(Number(currDate)>Number(incomingDate))
return false;}
return true;}})(jQuery); 


/*
 
 jQuery Tools 1.2.3 Slideshow - Extend it.

 NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.

 http://flowplayer.org/tools/tabs/slideshow.html

 Since: September 2009
 Date:    Mon Jun 7 13:43:53 2010 +0000 
*/
(function(d){function r(g,a){function p(f){var e=d(f);return e.length<2?e:g.parent().find(f)}var c=this,j=g.add(this),b=g.data("tabs"),h,l,m,n=false,o=p(a.next).click(function(){b.next()}),k=p(a.prev).click(function(){b.prev()});d.extend(c,{getTabs:function(){return b},getConf:function(){return a},play:function(){if(!h){var f=d.Event("onBeforePlay");j.trigger(f);if(f.isDefaultPrevented())return c;n=false;h=setInterval(b.next,a.interval);j.trigger("onPlay");b.next()}},pause:function(){if(!h)return c;
var f=d.Event("onBeforePause");j.trigger(f);if(f.isDefaultPrevented())return c;h=clearInterval(h);m=clearInterval(m);j.trigger("onPause")},stop:function(){c.pause();n=true}});d.each("onBeforePlay,onPlay,onBeforePause,onPause".split(","),function(f,e){d.isFunction(a[e])&&c.bind(e,a[e]);c[e]=function(s){return c.bind(e,s)}});if(a.autopause){var t=b.getTabs().add(o).add(k).add(b.getPanes());t.hover(function(){c.pause();l=clearInterval(l)},function(){n||(l=setTimeout(c.play,a.interval))})}if(a.autoplay)m=
setTimeout(c.play,a.interval);else c.stop();a.clickable&&b.getPanes().click(function(){b.next()});if(!b.getConf().rotate){var i=a.disabledClass;b.getIndex()||k.addClass(i);b.onBeforeClick(function(f,e){if(e){k.removeClass(i);e==b.getTabs().length-1?o.addClass(i):o.removeClass(i)}else k.addClass(i)})}}var q;q=d.tools.tabs.slideshow={conf:{next:".forward",prev:".backward",disabledClass:"disabled",autoplay:false,autopause:true,interval:3E3,clickable:true,api:false}};d.fn.slideshow=function(g){var a=
this.data("slideshow");if(a)return a;g=d.extend({},q.conf,g);this.each(function(){a=new r(d(this),g);d(this).data("slideshow",a)});return g.api?a:this}})(jQuery);


