$(function() {	
	basketCount = 0;
	voucherTotal = '';
	chargeTotal = '';
	basketTotal = '';
///////////////////////////////////////////////////////
/// submit basket ///
///////////////////////////////////////////////////////
	$('#voucher-basket .button button').live('click', function() {
		if(basketCount =="0"){ alert('Please add a voucher to your basket to proceed.'); return false; } 
	});	
///////////////////////////////////////////////////////
/// value selector ///
///////////////////////////////////////////////////////
	$('#voucher-promo .controls a').live('click', function() {
		var control = $(this).parent().attr('class');
		var voucherValue = $('#voucher-promo .value li.current').html();
		//$('.vouchers-new #vouchers-promo .value li').removeClass('current');
		if(control == "up"){ 
			if(voucherValue!="500"){
				$('#voucher-promo .value li.current').next().addClass('next'); 
				$('#voucher-promo .value li').removeClass('current');
				$('#voucher-promo .value li.next').removeClass('next').addClass('current');
			}
		} else {
			if(voucherValue!="10"){
				$('#voucher-promo .value li.current').prev().addClass('prev'); 
				$('#voucher-promo .value li').removeClass('current');
				$('#voucher-promo .value li.prev').removeClass('prev').addClass('current');
			}
		}
		return false;
	});
///////////////////////////////////////////////////////
/// remove voucher ///
///////////////////////////////////////////////////////
	$('.voucher-basket li a').live('click', function() {
		basketCount -=1;	
		var voucherClass = $(this).parent().attr('class');
		var price = $('.'+voucherClass+' .price b').html();
		var charge = $(this).attr('rel');
		voucherTotal = Number(voucherTotal)-Number(price);
		chargeTotal = Number(chargeTotal)-Number(charge);
		basketTotal = Number(voucherTotal)+Number(chargeTotal);
		voucherTotal = voucherTotal.toFixed(2);
		chargeTotal = chargeTotal.toFixed(2);
		basketTotal = basketTotal.toFixed(2);
		$('.voucher-basket .voucher-total span').empty().append(voucherTotal);
		$('.voucher-basket .charges span').empty().append(chargeTotal);
		$('.voucher-basket .total span').empty().append(basketTotal);
		$('.voucher-basket .basketTotal').val(basketTotal);
		if(basketCount == 0){ 
			$('.voucher-basket .empty').show();
		}
		$('.'+voucherClass+'').remove();
		$('#'+voucherClass+'').remove(); 
		return false;
	});
///////////////////////////////////////////////////////
/// add to basket ///
///////////////////////////////////////////////////////	
	$('#voucher-promo .button a').live('click', function() {
		basketCount +=1;
		var image = $(this).attr('rel');
		var arr = image.split("/");
		var voucherImage = arr[5]+'/'+arr[6];
		var voucherBrand = arr[5];
		var voucherName = $('#voucher-promo h2.title').html();
		var voucherDesc = $('#voucher-promo .strapline').html();
		var price = $('#voucher-promo .value .current').text();
		var charge = $('#voucher-promo .charge span').text();
		var buttonClass = $(this).attr('class');
		voucherTotal = Number(voucherTotal)+Number(price);
		chargeTotal = Number(chargeTotal)+Number(charge);
		basketTotal = Number(voucherTotal)+Number(chargeTotal);
		voucherTotal = voucherTotal.toFixed(2);
		chargeTotal = chargeTotal.toFixed(2);
		basketTotal = basketTotal.toFixed(2);
		var categoryTitle = "";
		var categoryDesc = "";
		var type = $(this).attr('class');
		if(voucherBrand == "paintballguide" || voucherBrand == "laserguide"){
			var categoryTitle = "Combat Sports";
			var categoryDesc = "Updating to our Combat Games Voucher allows recipients to select an experience from a wider range of activities and locations. Our Combat Games Voucher is redeemable at 200 Paintball, Laser Combat, Airsoft, Indoor Paintball locations in the UK and Ireland.";
		}
		if(voucherBrand == "quadguide" || voucherBrand == "kartingguide" || voucherBrand == "offroadingguide" || voucherBrand == "rallyguide" || voucherBrand == "drivingguide"){
			var categoryTitle = "Motor Sports";
			var categoryDesc = "Updating to our Motor Sports Voucher allows recipients to select an experience from a wider range of activities and locations. Our Motor Sports Voucher is redeemable at 236 Karting, Quad Biking, 4x4 Off Roading, Driving Experiences, Rally Driving, Mini Moto, Tank Driving, Off Road Karting, Hovercraft Experiences, Dumper Truck Racing, Monster Truck Driving, Segway locations in the UK and Ireland.";
		}	
		if(voucherBrand == "clayshootingguide"){
			var categoryTitle = "Shooting";
			var categoryDesc = "Updating to our Shooting Voucher allows recipients to select an experience from a wider range of activities and locations. Our Shooting Voucher is redeemable at 138 Clay Pigeon Shooting, Archery, Air Rifle Ranges locations in the UK and Ireland.";
		}
		$('.voucher-basket .empty').hide();
		$('.voucher-basket .voucher-total span').empty().append(voucherTotal);
		$('.voucher-basket .charges span').empty().append(chargeTotal);
		$('.voucher-basket .total span').empty().append(voucherTotal);
		$('.voucher-basket .basketTotal').val(basketTotal);
		$('.voucher-basket .basket').append('<li class="voucher-'+basketCount+'"><span class="img" style="background-image:url('+image+');"></span><span class="price">&pound;<b>'+price+'</b></span> <a href="#" rel="'+charge+'">x</a> <input type="hidden" name="voucher['+basketCount+'][value]" value="'+price+'" /><input type="hidden" name="voucher['+basketCount+'][charge]" value="'+charge+'" /><input type="hidden" name="voucher['+basketCount+'][name]" value="'+voucherName+'" /><input type="hidden" name="voucher['+basketCount+'][desc]" value="'+voucherDesc+'" /><input type="hidden" name="voucher['+basketCount+'][image]" value="'+voucherImage+'" /><input type="hidden" name="voucher['+basketCount+'][brand]" value="'+voucherBrand+'" /><input type="hidden" name="voucher['+basketCount+'][type]" value="'+type+'" /><input type="hidden" name="voucher['+basketCount+'][categoryTitle]" value="'+categoryTitle+'" /><input type="hidden" name="voucher['+basketCount+'][categoryDesc]" value="'+categoryDesc+'" /></li>');
		return false;
	});
/////////////////////////////////////////////////////
/// booking link ///
/////////////////////////////////////////////////////
	$('#venue-format-packages input').click(function(){
		var packageInfo = $(this).val();
		var arr = packageInfo.split('|');
		var package=arr[0];
		var price=arr[2];
		var packageID=arr[1];
		var venueID=arr[3];
		var activityID=arr[4];
		$('#format-advanced .book-online a').attr('href','https://activitybooker.net/en/booking/paintballguide.co.uk/pdID-'+packageID+'_oVenue-'+venueID+'_oVenAct-'+activityID+'');
		$('#format-advanced .enquiry a').attr('href','https://activitybooker.net/en/enquiry/paintballguide.co.uk/pdID-'+packageID+'_oVenue-'+venueID+'_oVenAct-'+activityID+'');
	});
/////////////////////////////////////////////////////
/// add to basket ///
/////////////////////////////////////////////////////
	$('a.add-to-basket').live('click',function() {
		$('#basket-container').removeClass('hidden');
		$('#basket h2.title').hide();								   
		$('#basket').empty().load($(this).attr('rel')).show();
		return false;
	});
	$('#basket-container #basket').live('click',function() {
		$(this).parent().removeClass('hidden');
		$('#basket h2.title').hide();
		$('#basket .wrapper').show();
		return false;
	});
/////////////////////////////////////////////////////
/// venues select ///
/////////////////////////////////////////////////////
	$('.venues-list-select select').live('change', function() {
		var href = $("option:selected", $('.venues-list-select select') ).val();
		location.href = href ;
		return false;			  
	});
/////////////////////////////////////////////////////
/// formats ///
/////////////////////////////////////////////////////
	$('#formats-preview .formats-list-advanced li').hide();
	$('#formats-preview .formats-list-advanced li.current').show();
	$('#formats-preview .formats-list li a').live('mouseover', function() {
		var rel=$(this).attr('rel');
		$('#formats-preview .formats-list-advanced li').hide().removeClass('current');
		$('#formats-preview .formats-list-advanced #'+rel+'').show().addClass('current');
		$('.formats-list li').removeClass('current');
		$(this).parent().addClass('current');
		return false;			  
	});	
	$('#formats-preview .formats-list li a').live('click', function() {
		var href=$(this).attr('href');
		// determine if ajax isset
		var bodyClass = $('body').attr('class');
		if(bodyClass != "ajaxed"){ $('body').addClass('ajaxed').append('<div id="overlay"></div><div id="ajax"></div>'); }
		// loads ajax
		$('body').append('<div id="loading"></div>');
		$('#ajax').fadeIn().load('/resources2/pages'+href+'&websiteID='+websiteID+'');
		setTimeout( function() { 
			$('#loading').fadeOut().remove(); 
			$('#ajax .plugin').append('<a href="#" class="ajax-close AJAXCLOSEjs">x</a>');
		}, 5000);
		return false;			  
	});		   
/////////////////////////////////////////////////////
// activity menu //
/////////////////////////////////////////////////////
	$('.expandable-menu li ul').hide(0);
	$('.expandable-menu li ul.open').show(0);
	$('.expandable-menu h3 a').live('click', function() {
		var container = $(this).parent().parent();
		var next=$(this).parent().next();
		var expanded=$(this).parent().parent().attr('class');
		$('.expandable-menu li ul').hide().removeClass('open');
		$('.expandable-menu li').removeClass('expanded');
		if(expanded=="category expanded"){
		} else {
			$(next).slideDown('slow').addClass('open').show();
			$(container).addClass('expanded');
		}
		return false;
	});
/////////////////////////////////////////////////////
/// redeem ///
/////////////////////////////////////////////////////
	$('.REDEEMjs').live('click', function() {
		var name = $(".redeemNameJS").val();
		var email = $(".redeemEmailJS").val();
		var telephone = $(".redeemTelephoneJS").val();
		var websiteID = $(".redeemWebsiteIDJS").val();
		var website = $(".redeemWebsiteJS").val();
		var voucherExpiry = $(".redeemVoucherExpiryJS").val();	
		var voucherID = $(".redeemVoucherIDJS").val();	
		var date = $(".redeemDateJS").val();
		var type = $(".redeemTypeJS").val();
		var subscribe = '';	
		var location = $("select[name='redeemLocationJS']").val();;
		var package = $(".redeemPackageJS").val();
		var locationID = '';
		var activityID = '';
		var comment = name+' would like to redeem a voucher. VOUCHER ID:'+voucherID+'. VOUCHER EXPIRY:'+voucherExpiry+'. LOCATION:'+location+'. Package:'+package+'. DATE:'+date+'.';
		// reset form
		$('.required').removeClass('value-required');
		// if input is empty on required field prompt
		if(name==""){ $(".redeemNameJS").parent().addClass('value-required'); }
		if(email==""){ $(".redeemEmailJS").parent().addClass('value-required'); }
		if(telephone==""){ $(".redeemTelephoneJS").parent().addClass('value-required'); }
		if(voucherExpiry==""){ $(".redeemVoucherExpiryJS").parent().addClass('value-required'); }
		if(voucherID==""){ $(".redeemVoucherIDJS").parent().addClass('value-required'); }
		if(date==""){ $(".redeemDateJS").parent().addClass('value-required'); }
		
		// if required inputs aren't empty - proceed
		if(name!="" && email!="" && telephone!="" && voucherExpiry!="" && voucherID!="" && date!=""){ 
			$('.voucher-redeem-form .button').empty().addClass('loading');
			// post to database
			$.post('/resources2/plugins/content/contact-SBIQ.php', { name:name, email:email, telephone:telephone, comment:comment, subscribe:subscribe, website:website, websiteID:websiteID, activityID:activityID, locationID:locationID, type:type},
			// database has been updated, email sent
			function(data){
				if (data=='success'){
				$('#column2').empty().append("<div id='thankyou'><p class='intro'>Thank you for submitting your voucher redemption request, the details will now be checked against our records and a member of our customer services team will be in touch within 2 working days.</p></div>");
				}
				if(data=='SUSS'){
					$('#column2').empty().append("<div id='thankyou'><p class='intro'>That appeared to be a bit spammy. If it was a genuine enquiry please try again.</p><p>References to search engines, links and marketing will flag your submission as spammy.</p></div>");
				}
				if(data=='REQUIRED'){
					$('#column2').empty().append("<div id='thankyou'><p class='intro'>Required data was missing from the form.</p><p>Please try again</p></div>");
				}
			});
		}
		return false;
	});
/////////////////////////////////////////////////////
/// contact ///
/////////////////////////////////////////////////////
	$('.contactjs').live('click', function() {	
		var name = $(".contactNameJS").val();
		var email = $(".contactEmailJS").val();
		var telephone = $(".contactTelephoneJS").val();
		var subscribe = $(".contactSubscribeJS").val();
		var websiteID = $(".contactWebsiteIDJS").val();
		var website = $(".contactWebsiteJS").val();
		var locationID = $(".contactLocationJS").val();
		var comment = $(".contactCommentJS").val();
		// reset form
		$('.required').removeClass('value-required');
		// if input is empty on required field prompt
		if(name==""){ $(".contactNameJS").parent().addClass('value-required'); }
		if(email==""){ $(".contactEmailJS").parent().addClass('value-required'); }
		if(comment==""){ $(".contactCommentJS").parent().addClass('value-required'); }
		// dont submit spammy lookign messages
		spamMessage = 'This appears to be spam';
		if(comment.indexOf('SEO')>=0){$("#commentMessage").html(spamMessage); return false;}
		if(comment.indexOf('google')>=0){$("#commentMessage").html(spamMessage);return false;}
		if(comment.indexOf('optimization')>=0){$("#commentMessage").html(spamMessage);return false;}
		if(comment.indexOf('seo')>=0){$("#commentMessage").html(spamMessage);return false;}
		if(comment.indexOf('optimisation')>=0){$("#commentMessage").html(spamMessage);return false;}
		if(comment.indexOf('rankings')>=0){$("#commentMessage").html(spamMessage);return false;}
		if(comment.indexOf('a href')>=0){$("#commentMessage").html(spamMessage);return false;}
		if(comment.indexOf('search engine')>=0){$("#commentMessage").html(spamMessage);return false;}
		if(comment.indexOf('Search Engine')>=0){$("#commentMessage").html(spamMessage);return false;}
		
		// if required inputs aren't empty - proceed
		if(name!="" && email!="" && comment!=""){ 
			$('.contact-form .button').empty().addClass('loading');
			// post to database
			$.post('/resources2/plugins/content/contact-SBIQ.php', { name:name, email:email, telephone:telephone, comment:comment, subscribe:subscribe, website:website, websiteID:websiteID, locationID:locationID},
			// database has been updated, email sent
			function(data){
				if (data=='success'){
				$('.contact-form').empty().append("<div id='thankyou'><p class='intro'>Thank you for your enquiry. An interactive quote from ActivityIQ will be emailed to you shortly, you will be notified via sms when it has been sent.</p><p>If you do not receive a quote from us within 24hrs please check your spam folder, or call us</p></div>");
				}
				if(data=='SUSS'){
					$('.contact-form').empty().append("<div id='thankyou'><p class='intro'>That appeared to be a bit spammy. If it was a genuine enquiry please try again.</p><p>References to search engines, links and marketing will flag your submission as spammy.</p></div>");
				}
				if(data=='REQUIRED'){
					$('.contact-form').empty().append("<div id='thankyou'><p class='intro'>Required data was missing from the form.</p><p>Please try again</p></div>");
				}
			});
		}
		return false;
	});	
/////////////////////////////////////////////////////
/// callback ///
/////////////////////////////////////////////////////	
	$('.callbackJS').live('click', function() {	
		var name = $(".callbackNameJS").val();
		var telephone = $(".callbackTelephoneJS").val();
		var website = $(".callbackWebsiteJS").val();
		var time = '';
		// reset form
		$('.required').removeClass('value-required');
		// if input is empty on required field prompt
		if(name=="" || name.length<2){ $(".callbackNameJS").parent().addClass('value-required'); }
		if(telephone=="" || telephone.length<6){ $(".callbackTelephoneJS").parent().addClass('value-required'); }
		// if required inputs aren't empty - proceed
		if(name!="" && name.length>=2 && telephone!="" && telephone.length>5){ 
			$('.callback-form .button').empty().addClass('loading');
			// post to database
			$.post('/resources2/plugins/content/callback-SBIQ.php', { name:name, telephone:telephone, website:website, time:time},
			// database has been updated, email sent
			function(data){
				$('.callback-form').empty().append("<div id='thankyou'><p class='intro'>Thank you for your callback request. A member of our sales team will be intouch shortly.<p></div>");
			});
		}
		return false;
	});
/////////////////////////////////////////////////////
/// ajax ///
/////////////////////////////////////////////////////		   
	$('.ajax').live('click', function() {
		var rel = $(this).attr('rel');
		var loadType = $(this).attr('name');
		// determine if ajax isset
		var bodyClass = $('body').attr('class');
		if(bodyClass != "ajaxed"){ $('body').addClass('ajaxed').append('<div id="overlay"></div><div id="ajax"></div>'); }
		// loads ajax
		$('body').append('<div id="loading"></div>');
		if(loadType=="href"){
			$('#ajax').fadeIn().append('<div id="availability-advanced" class="plugin"><a href="#" class="ajax-close AJAXCLOSEjs">x</a><iframe src="'+rel+'" width="652px" height="565px" scrolling="no" frameborder="0"></iframe></div>');
			//$('#ajax').fadeIn().append('<div id="iframe" class="plugin"><a href="#" class="ajax-close AJAXCLOSEjs">x</a><iframe src="'+rel+'" width="600px" height="400px" scrolling="no" frameborder="0"></iframe></div>');
		}else if(loadType=="contact"){
			$('#ajax').fadeIn().append('<div id="contact" class="plugin"><a href="#" class="ajax-close AJAXCLOSEjs">x</a><iframe src="'+rel+'" width="801px" height="594px" scrolling="no" frameborder="0"></iframe></div>');
		} else if(loadType=="tellafriend"){
			$('#ajax').fadeIn().append('<div id="tellafriend" class="plugin"><a href="#" class="ajax-close AJAXCLOSEjs">x</a><iframe src="'+rel+'" width="400px" height="594px" scrolling="no" frameborder="0"></iframe></div>');
		} else if(loadType=="hours"){
			$('#ajax').fadeIn().append('<div id="office-hours" class="plugin"><a href="#" class="ajax-close AJAXCLOSEjs">x</a><iframe src="'+rel+'" width="400px" height="370px" scrolling="no" frameborder="0"></iframe></div>');
		} else if(loadType=="reviews"){
			$('#ajax').fadeIn().append('<div id="venue-reviews" class="plugin"><a href="#" class="ajax-close AJAXCLOSEjs">x</a><iframe src="'+rel+'" width="600px" height="400px" scrolling="no" frameborder="0"></iframe></div>');
		} else if(loadType=="callback"){
			$('#ajax').fadeIn().append('<div id="callback" class="plugin"><a href="#" class="ajax-close AJAXCLOSEjs">x</a><iframe src="'+rel+'" width="400px" height="370px" scrolling="no" frameborder="0"></iframe></div>');
		} else if(loadType=="redeem"){
			$('#ajax').fadeIn().append('<div id="redeem" class="plugin"><a href="#" class="ajax-close AJAXCLOSEjs">x</a><iframe src="'+rel+'" width="600px" height="615px" scrolling="no" frameborder="0"></iframe></div>');
		} else {
			$('#ajax').fadeIn().load(''+rel+'');
		}
		setTimeout( function() { $('#loading').fadeOut().remove(); }, 5000);
		return false;
	});
/////////////////////////////////////////////////////
	function close_ajax(){
		$('#loading').remove();
		$('body').removeClass('ajaxed');
		$('#overlay').remove();
		$('#ajax').remove();
		return false;
	}
	// this closes the specific ajax div
	$('.AJAXCLOSEjs').live('click',function() {
		close_ajax();
	});
	// this closes all ajax related divs
	$('#overlay').live('click',function() {
		close_ajax();
	});
/////////////////////////////////////////////////////
/// venue formats advanced ///
/////////////////////////////////////////////////////
	$('#venue-formats-advanced .package').hide();
	$('#venue-formats-advanced .selected').show();
	$('#venue-formats-advanced .formats-list a').live('click', function() {
		var rel = $(this).attr('rel');
		var parentClass = $(this).attr('class');
		if(parentClass =="current"){
		} else {
			$('#venue-formats-advanced .package').removeClass('selected').hide();
			$(rel).addClass('selected').show();
			$('#venue-formats-advanced .formats-list li').removeClass('current');
			$(this).parent().addClass('current');
		}
		return false;
	});	
/////////////////////////////////////////////////////
/// packages ///
/////////////////////////////////////////////////////
	$('.VENUEPACKAGEjs').live('click', function() {
		var rel = $(this).attr('rel');
		var linkClass = $(this).attr('class');
		var parentID = '#'+$(this).parent().attr('id');
		$('.packageDetailsJS').remove();
		if(linkClass == "package-link VENUEPACKAGEjs open"){
			$(this).parent().removeClass('selected');
			$(this).removeClass('open');
			$(''+parentID+' .packageDetailsJS').remove();
		} else {
			$(this).parent().addClass('selected');
			$(this).addClass('open');
			$(parentID).append('<div class="packageDetailsJS"></div>');
			$(''+parentID+' .packageDetailsJS').load('/plugins/content/venuePackageAjax.asp'+rel+'');
		}
		return false;
	});	
///////////////////////////////////////////////////////
/// venue gallery ///
///////////////////////////////////////////////////////
	$('.gallery .thumbnails a').click(function(){
		var rel = $(this).attr('rel');
		var activityImage = 'background-image:url('+rel+');';
		$('.gallery .preview .img').attr('style',''+activityImage+'');
		//if(venueID!=""){
			//$('.gallery .preview .img span').attr('style',''+venueImage+'');
		//}
		return false;
	});													  									  
/////////////////////////////////////////////////////
/// venues map ///
/////////////////////////////////////////////////////
	$('.map li').hide();
	$('.map .hover').hover(function() {  
		var area=$(this).attr('alt');
		var id=$(this).attr('id');
		$('.map img').attr('src','http://images.activitysearch.co.uk/maps/'+area+'.png');
		$('.map li').hide();
		$('.map .'+id+'').show();
		return false;
	});
/////////////////////////////////////////////////////
/// tab menu ///
/////////////////////////////////////////////////////
	$('.tabs-container').hide(0);
	$('.tabs-selected').show(0);
	$('.tabs-menu li a').live('click', function() {
		var li = $(this).parent();
		var liValue = $(this).attr('rev');
		var ul = $(this).parent().parent();
		var tab = (ul).children();
		var wrapper = $(this).parent().parent().parent().attr('id');
		var rel = $(this).attr('rel');
		var container = '#'+wrapper+' .'+rel;
		var href = $(this).attr('href');
		var node = '#'+wrapper+' '+href+'';
		var selected = $(this).parent().attr('class');
		if(selected=="tab-selected"){
		} else {
			// this identifies any links not part of the tab structure
			if($(this).attr('target')=="_blank" || $(this).html()=="Redeem a Voucher"){
			} else {
				$(container).hide(0).removeClass('tabs-selected');
				$(tab).removeClass('tab-selected');
				$(li).addClass('tab-selected');
				if(rel == "tabs-ajax-container"){
					$(node).show(0).addClass('tabs-selected').load('http://'+window.location.hostname+'/en/index/plug-'+liValue+'');
				} else {
					$(node).show(0).addClass('tabs-selected');
				}
				return false;
			}
		}
	});
/////////////////////////////////////////////////////
/// tab link ///
/////////////////////////////////////////////////////
	$('.tab-link').live('click', function() {
		var href = $(this).attr('href');
		$(href).trigger('click');
		return false;
	});
///////////////////////////////////////////////////////
/// read more ///
///////////////////////////////////////////////////////
	$('.READMOREjs .APPENDjs').append('... <a href="#" class="expand">Read More</a>');
	$('.READMOREjs').css('cursor', 'pointer');
	$('.READMOREjs').click(function(){
		var container = $(this).parent();
		var next = $(this).next();
		var expanded = $(this).parent().attr('id');
		$('.READMORECONTENTjs').slideUp('slow');
		$('#open').attr('id','');
		if(expanded=="open"){
			$(next).slideUp('slow');
			$(container).attr('id','');
		} else {
			$(next).slideDown('slow').show();
			$(container).attr('id','open');
		}
		return false;
	});
/////////////////////////////////////////////////////
});
/////////////////////////////////////////////////////
/// clear form ///
/////////////////////////////////////////////////////
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}
/////////////////////////////////////////////////////
// JQuery Cycle Plugin //
/////////////////////////////////////////////////////
/*
 * jQuery Cycle Plugin (with Transition Definitions)
 * Examples and documentation at: http://jquery.malsup.com/cycle/
 * Copyright (c) 2007-2009 M. Alsup
 * Version: 2.73 (04-NOV-2009)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * Requires: jQuery v1.2.6 or later
 *
 * Originally based on the work of:
 *	1) Matt Oakes
 *	2) Torsten Baldes (http://medienfreunde.com/lab/innerfade/)
 *	3) Benjamin Sterling (http://www.benjaminsterling.com/experiments/jqShuffle/)
 */
(function(i){var l="2.73";if(i.support==undefined){i.support={opacity:!(i.browser.msie)}}function a(q){if(i.fn.cycle.debug){f(q)}}function f(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments," "))}}i.fn.cycle=function(r,q){var s={s:this.selector,c:this.context};if(this.length===0&&r!="stop"){if(!i.isReady&&s.s){f("DOM not ready, queuing slideshow");i(function(){i(s.s,s.c).cycle(r,q)});return this}f("terminating; zero elements found by selector"+(i.isReady?"":" (DOM not ready)"));return this}return this.each(function(){var w=m(this,r,q);if(w===false){return}if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=this.cyclePause=0;var x=i(this);var y=w.slideExpr?i(w.slideExpr,this):x.children();var u=y.get();if(u.length<2){f("terminating; too few slides: "+u.length);return}var t=k(x,y,u,w,s);if(t===false){return}var v=t.continuous?10:h(t.currSlide,t.nextSlide,t,!t.rev);if(v){v+=(t.delay||0);if(v<10){v=10}a("first timeout: "+v);this.cycleTimeout=setTimeout(function(){e(u,t,0,!t.rev)},v)}})};function m(q,t,r){if(q.cycleStop==undefined){q.cycleStop=0}if(t===undefined||t===null){t={}}if(t.constructor==String){switch(t){case"stop":q.cycleStop++;if(q.cycleTimeout){clearTimeout(q.cycleTimeout)}q.cycleTimeout=0;i(q).removeData("cycle.opts");return false;case"pause":q.cyclePause=1;return false;case"resume":q.cyclePause=0;if(r===true){t=i(q).data("cycle.opts");if(!t){f("options not found, can not resume");return false}if(q.cycleTimeout){clearTimeout(q.cycleTimeout);q.cycleTimeout=0}e(t.elements,t,1,1)}return false;case"prev":case"next":var u=i(q).data("cycle.opts");if(!u){f('options not found, "prev/next" ignored');return false}i.fn.cycle[t](u);return false;default:t={fx:t}}return t}else{if(t.constructor==Number){var s=t;t=i(q).data("cycle.opts");if(!t){f("options not found, can not advance slide");return false}if(s<0||s>=t.elements.length){f("invalid slide index: "+s);return false}t.nextSlide=s;if(q.cycleTimeout){clearTimeout(q.cycleTimeout);q.cycleTimeout=0}if(typeof r=="string"){t.oneTimeFx=r}e(t.elements,t,1,s>=t.currSlide);return false}}return t}function b(q,r){if(!i.support.opacity&&r.cleartype&&q.style.filter){try{q.style.removeAttribute("filter")}catch(s){}}}function k(y,J,u,t,E){var C=i.extend({},i.fn.cycle.defaults,t||{},i.metadata?y.metadata():i.meta?y.data():{});if(C.autostop){C.countdown=C.autostopCount||u.length}var r=y[0];y.data("cycle.opts",C);C.$cont=y;C.stopCount=r.cycleStop;C.elements=u;C.before=C.before?[C.before]:[];C.after=C.after?[C.after]:[];C.after.unshift(function(){C.busy=0});if(!i.support.opacity&&C.cleartype){C.after.push(function(){b(this,C)})}if(C.continuous){C.after.push(function(){e(u,C,0,!C.rev)})}n(C);if(!i.support.opacity&&C.cleartype&&!C.cleartypeNoBg){g(J)}if(y.css("position")=="static"){y.css("position","relative")}if(C.width){y.width(C.width)}if(C.height&&C.height!="auto"){y.height(C.height)}if(C.startingSlide){C.startingSlide=parseInt(C.startingSlide)}if(C.random){C.randomMap=[];for(var H=0;H<u.length;H++){C.randomMap.push(H)}C.randomMap.sort(function(L,w){return Math.random()-0.5});C.randomIndex=0;C.startingSlide=C.randomMap[0]}else{if(C.startingSlide>=u.length){C.startingSlide=0}}C.currSlide=C.startingSlide=C.startingSlide||0;var x=C.startingSlide;J.css({position:"absolute",top:0,left:0}).hide().each(function(w){var L=x?w>=x?u.length-(w-x):x-w:u.length-w;i(this).css("z-index",L)});i(u[x]).css("opacity",1).show();b(u[x],C);if(C.fit&&C.width){J.width(C.width)}if(C.fit&&C.height&&C.height!="auto"){J.height(C.height)}var D=C.containerResize&&!y.innerHeight();if(D){var v=0,B=0;for(var F=0;F<u.length;F++){var q=i(u[F]),K=q[0],A=q.outerWidth(),I=q.outerHeight();if(!A){A=K.offsetWidth}if(!I){I=K.offsetHeight}v=A>v?A:v;B=I>B?I:B}if(v>0&&B>0){y.css({width:v+"px",height:B+"px"})}}if(C.pause){y.hover(function(){this.cyclePause++},function(){this.cyclePause--})}if(c(C)===false){return false}var s=false;t.requeueAttempts=t.requeueAttempts||0;J.each(function(){var N=i(this);this.cycleH=(C.fit&&C.height)?C.height:N.height();this.cycleW=(C.fit&&C.width)?C.width:N.width();if(N.is("img")){var L=(i.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete);var O=(i.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete);var M=(i.browser.opera&&((this.cycleW==42&&this.cycleH==19)||(this.cycleW==37&&this.cycleH==17))&&!this.complete);var w=(this.cycleH==0&&this.cycleW==0&&!this.complete);if(L||O||M||w){if(E.s&&C.requeueOnImageNotLoaded&&++t.requeueAttempts<100){f(t.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){i(E.s,E.c).cycle(t)},C.requeueTimeout);s=true;return false}else{f("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}}}return true});if(s){return false}C.cssBefore=C.cssBefore||{};C.animIn=C.animIn||{};C.animOut=C.animOut||{};J.not(":eq("+x+")").css(C.cssBefore);if(C.cssFirst){i(J[x]).css(C.cssFirst)}if(C.timeout){C.timeout=parseInt(C.timeout);if(C.speed.constructor==String){C.speed=i.fx.speeds[C.speed]||parseInt(C.speed)}if(!C.sync){C.speed=C.speed/2}while((C.timeout-C.speed)<250){C.timeout+=C.speed}}if(C.easing){C.easeIn=C.easeOut=C.easing}if(!C.speedIn){C.speedIn=C.speed}if(!C.speedOut){C.speedOut=C.speed}C.slideCount=u.length;C.currSlide=C.lastSlide=x;if(C.random){C.nextSlide=C.currSlide;if(++C.randomIndex==u.length){C.randomIndex=0}C.nextSlide=C.randomMap[C.randomIndex]}else{C.nextSlide=C.startingSlide>=(u.length-1)?0:C.startingSlide+1}if(!C.multiFx){var G=i.fn.cycle.transitions[C.fx];if(i.isFunction(G)){G(y,J,C)}else{if(C.fx!="custom"&&!C.multiFx){f("unknown transition: "+C.fx,"; slideshow terminating");return false}}}var z=J[x];if(C.before.length){C.before[0].apply(z,[z,z,C,true])}if(C.after.length>1){C.after[1].apply(z,[z,z,C,true])}if(C.next){i(C.next).bind(C.prevNextEvent,function(){return o(C,C.rev?-1:1)})}if(C.prev){i(C.prev).bind(C.prevNextEvent,function(){return o(C,C.rev?1:-1)})}if(C.pager){d(u,C)}j(C,u);return C}function n(q){q.original={before:[],after:[]};q.original.cssBefore=i.extend({},q.cssBefore);q.original.cssAfter=i.extend({},q.cssAfter);q.original.animIn=i.extend({},q.animIn);q.original.animOut=i.extend({},q.animOut);i.each(q.before,function(){q.original.before.push(this)});i.each(q.after,function(){q.original.after.push(this)})}function c(w){var u,s,r=i.fn.cycle.transitions;if(w.fx.indexOf(",")>0){w.multiFx=true;w.fxs=w.fx.replace(/\s*/g,"").split(",");for(u=0;u<w.fxs.length;u++){var v=w.fxs[u];s=r[v];if(!s||!r.hasOwnProperty(v)||!i.isFunction(s)){f("discarding unknown transition: ",v);w.fxs.splice(u,1);u--}}if(!w.fxs.length){f("No valid transitions named; slideshow terminating.");return false}}else{if(w.fx=="all"){w.multiFx=true;w.fxs=[];for(p in r){s=r[p];if(r.hasOwnProperty(p)&&i.isFunction(s)){w.fxs.push(p)}}}}if(w.multiFx&&w.randomizeEffects){var t=Math.floor(Math.random()*20)+30;for(u=0;u<t;u++){var q=Math.floor(Math.random()*w.fxs.length);w.fxs.push(w.fxs.splice(q,1)[0])}a("randomized fx sequence: ",w.fxs)}return true}function j(r,q){r.addSlide=function(u,v){var t=i(u),w=t[0];if(!r.autostopCount){r.countdown++}q[v?"unshift":"push"](w);if(r.els){r.els[v?"unshift":"push"](w)}r.slideCount=q.length;t.css("position","absolute");t[v?"prependTo":"appendTo"](r.$cont);if(v){r.currSlide++;r.nextSlide++}if(!i.support.opacity&&r.cleartype&&!r.cleartypeNoBg){g(t)}if(r.fit&&r.width){t.width(r.width)}if(r.fit&&r.height&&r.height!="auto"){$slides.height(r.height)}w.cycleH=(r.fit&&r.height)?r.height:t.height();w.cycleW=(r.fit&&r.width)?r.width:t.width();t.css(r.cssBefore);if(r.pager){i.fn.cycle.createPagerAnchor(q.length-1,w,i(r.pager),q,r)}if(i.isFunction(r.onAddSlide)){r.onAddSlide(t)}else{t.hide()}}}i.fn.cycle.resetState=function(r,q){q=q||r.fx;r.before=[];r.after=[];r.cssBefore=i.extend({},r.original.cssBefore);r.cssAfter=i.extend({},r.original.cssAfter);r.animIn=i.extend({},r.original.animIn);r.animOut=i.extend({},r.original.animOut);r.fxFn=null;i.each(r.original.before,function(){r.before.push(this)});i.each(r.original.after,function(){r.after.push(this)});var s=i.fn.cycle.transitions[q];if(i.isFunction(s)){s(r.$cont,i(r.elements),r)}};function e(x,q,w,y){if(w&&q.busy&&q.manualTrump){i(x).stop(true,true);q.busy=false}if(q.busy){return}var u=q.$cont[0],A=x[q.currSlide],z=x[q.nextSlide];if(u.cycleStop!=q.stopCount||u.cycleTimeout===0&&!w){return}if(!w&&!u.cyclePause&&((q.autostop&&(--q.countdown<=0))||(q.nowrap&&!q.random&&q.nextSlide<q.currSlide))){if(q.end){q.end(q)}return}if(w||!u.cyclePause){var v=q.fx;A.cycleH=A.cycleH||i(A).height();A.cycleW=A.cycleW||i(A).width();z.cycleH=z.cycleH||i(z).height();z.cycleW=z.cycleW||i(z).width();if(q.multiFx){if(q.lastFx==undefined||++q.lastFx>=q.fxs.length){q.lastFx=0}v=q.fxs[q.lastFx];q.currFx=v}if(q.oneTimeFx){v=q.oneTimeFx;q.oneTimeFx=null}i.fn.cycle.resetState(q,v);if(q.before.length){i.each(q.before,function(B,C){if(u.cycleStop!=q.stopCount){return}C.apply(z,[A,z,q,y])})}var s=function(){i.each(q.after,function(B,C){if(u.cycleStop!=q.stopCount){return}C.apply(z,[A,z,q,y])})};if(q.nextSlide!=q.currSlide){q.busy=1;if(q.fxFn){q.fxFn(A,z,q,s,y)}else{if(i.isFunction(i.fn.cycle[q.fx])){i.fn.cycle[q.fx](A,z,q,s)}else{i.fn.cycle.custom(A,z,q,s,w&&q.fastOnEvent)}}}q.lastSlide=q.currSlide;if(q.random){q.currSlide=q.nextSlide;if(++q.randomIndex==x.length){q.randomIndex=0}q.nextSlide=q.randomMap[q.randomIndex]}else{var t=(q.nextSlide+1)==x.length;q.nextSlide=t?0:q.nextSlide+1;q.currSlide=t?x.length-1:q.nextSlide-1}if(q.pager){i.fn.cycle.updateActivePagerLink(q.pager,q.currSlide)}}var r=0;if(q.timeout&&!q.continuous){r=h(A,z,q,y)}else{if(q.continuous&&u.cyclePause){r=10}}if(r>0){u.cycleTimeout=setTimeout(function(){e(x,q,0,!q.rev)},r)}}i.fn.cycle.updateActivePagerLink=function(q,r){i(q).each(function(){i(this).find("a").removeClass("activeSlide").filter("a:eq("+r+")").addClass("activeSlide")})};function h(v,s,u,r){if(u.timeoutFn){var q=u.timeoutFn(v,s,u,r);while((q-u.speed)<250){q+=u.speed}a("calculated timeout: "+q+"; speed: "+u.speed);if(q!==false){return q}}return u.timeout}i.fn.cycle.next=function(q){o(q,q.rev?-1:1)};i.fn.cycle.prev=function(q){o(q,q.rev?1:-1)};function o(r,u){var q=r.elements;var t=r.$cont[0],s=t.cycleTimeout;if(s){clearTimeout(s);t.cycleTimeout=0}if(r.random&&u<0){r.randomIndex--;if(--r.randomIndex==-2){r.randomIndex=q.length-2}else{if(r.randomIndex==-1){r.randomIndex=q.length-1}}r.nextSlide=r.randomMap[r.randomIndex]}else{if(r.random){if(++r.randomIndex==q.length){r.randomIndex=0}r.nextSlide=r.randomMap[r.randomIndex]}else{r.nextSlide=r.currSlide+u;if(r.nextSlide<0){if(r.nowrap){return false}r.nextSlide=q.length-1}else{if(r.nextSlide>=q.length){if(r.nowrap){return false}r.nextSlide=0}}}}if(i.isFunction(r.prevNextClick)){r.prevNextClick(u>0,r.nextSlide,q[r.nextSlide])}e(q,r,1,u>=0);return false}function d(r,s){var q=i(s.pager);i.each(r,function(t,u){i.fn.cycle.createPagerAnchor(t,u,q,r,s)});i.fn.cycle.updateActivePagerLink(s.pager,s.startingSlide)}i.fn.cycle.createPagerAnchor=function(u,v,s,t,w){var r;if(i.isFunction(w.pagerAnchorBuilder)){r=w.pagerAnchorBuilder(u,v)}else{r='<a href="#">'+(u+1)+"</a>"}if(!r){return}var x=i(r);if(x.parents("body").length===0){var q=[];if(s.length>1){s.each(function(){var y=x.clone(true);i(this).append(y);q.push(y[0])});x=i(q)}else{x.appendTo(s)}}x.bind(w.pagerEvent,function(A){A.preventDefault();w.nextSlide=u;var z=w.$cont[0],y=z.cycleTimeout;if(y){clearTimeout(y);z.cycleTimeout=0}if(i.isFunction(w.pagerClick)){w.pagerClick(w.nextSlide,t[w.nextSlide])}e(t,w,1,w.currSlide<u);return false});if(w.pagerEvent!="click"){x.click(function(){return false})}if(w.pauseOnPagerHover){x.hover(function(){w.$cont[0].cyclePause++},function(){w.$cont[0].cyclePause--})}};i.fn.cycle.hopsFromLast=function(t,s){var r,q=t.lastSlide,u=t.currSlide;if(s){r=u>q?u-q:t.slideCount-q}else{r=u<q?q-u:q+t.slideCount-u}return r};function g(s){function r(t){t=parseInt(t).toString(16);return t.length<2?"0"+t:t}function q(w){for(;w&&w.nodeName.toLowerCase()!="html";w=w.parentNode){var t=i.css(w,"background-color");if(t.indexOf("rgb")>=0){var u=t.match(/\d+/g);return"#"+r(u[0])+r(u[1])+r(u[2])}if(t&&t!="transparent"){return t}}return"#ffffff"}s.each(function(){i(this).css("background-color",q(this))})}i.fn.cycle.commonReset=function(v,t,u,r,s,q){i(u.elements).not(v).hide();u.cssBefore.opacity=1;u.cssBefore.display="block";if(r!==false&&t.cycleW>0){u.cssBefore.width=t.cycleW}if(s!==false&&t.cycleH>0){u.cssBefore.height=t.cycleH}u.cssAfter=u.cssAfter||{};u.cssAfter.display="none";i(v).css("zIndex",u.slideCount+(q===true?1:0));i(t).css("zIndex",u.slideCount+(q===true?0:1))};i.fn.cycle.custom=function(B,v,q,s,r){var A=i(B),w=i(v);var t=q.speedIn,z=q.speedOut,u=q.easeIn,y=q.easeOut;w.css(q.cssBefore);if(r){if(typeof r=="number"){t=z=r}else{t=z=1}u=y=null}var x=function(){w.animate(q.animIn,t,u,s)};A.animate(q.animOut,z,y,function(){if(q.cssAfter){A.css(q.cssAfter)}if(!q.sync){x()}});if(q.sync){x()}};i.fn.cycle.transitions={fade:function(r,s,q){s.not(":eq("+q.currSlide+")").css("opacity",0);q.before.push(function(v,t,u){i.fn.cycle.commonReset(v,t,u);u.cssBefore.opacity=0});q.animIn={opacity:1};q.animOut={opacity:0};q.cssBefore={top:0,left:0}}};i.fn.cycle.ver=function(){return l};i.fn.cycle.defaults={fx:"fade",timeout:4000,timeoutFn:null,continuous:0,speed:1000,speedIn:null,speedOut:null,next:null,prev:null,prevNextClick:null,prevNextEvent:"click",pager:null,pagerClick:null,pagerEvent:"click",pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!i.support.opacity,cleartypeNoBg:false,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0,manualTrump:true,requeueOnImageNotLoaded:true,requeueTimeout:250}})(jQuery);
/*
 * jQuery Cycle Plugin Transition Definitions
 * This script is a plugin for the jQuery Cycle Plugin
 * Examples and documentation at: http://malsup.com/jquery/cycle/
 * Copyright (c) 2007-2008 M. Alsup
 * Version:	 2.72
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
(function(a){a.fn.cycle.transitions.none=function(c,d,b){b.fxFn=function(g,e,f,h){a(e).show();a(g).hide();h()}};a.fn.cycle.transitions.scrollUp=function(d,e,c){d.css("overflow","hidden");c.before.push(a.fn.cycle.commonReset);var b=d.height();c.cssBefore={top:b,left:0};c.cssFirst={top:0};c.animIn={top:0};c.animOut={top:-b}};a.fn.cycle.transitions.scrollDown=function(d,e,c){d.css("overflow","hidden");c.before.push(a.fn.cycle.commonReset);var b=d.height();c.cssFirst={top:0};c.cssBefore={top:-b,left:0};c.animIn={top:0};c.animOut={top:b}};a.fn.cycle.transitions.scrollLeft=function(d,e,c){d.css("overflow","hidden");c.before.push(a.fn.cycle.commonReset);var b=d.width();c.cssFirst={left:0};c.cssBefore={left:b,top:0};c.animIn={left:0};c.animOut={left:0-b}};a.fn.cycle.transitions.scrollRight=function(d,e,c){d.css("overflow","hidden");c.before.push(a.fn.cycle.commonReset);var b=d.width();c.cssFirst={left:0};c.cssBefore={left:-b,top:0};c.animIn={left:0};c.animOut={left:b}};a.fn.cycle.transitions.scrollHorz=function(c,d,b){c.css("overflow","hidden").width();b.before.push(function(h,f,g,e){a.fn.cycle.commonReset(h,f,g);g.cssBefore.left=e?(f.cycleW-1):(1-f.cycleW);g.animOut.left=e?-h.cycleW:h.cycleW});b.cssFirst={left:0};b.cssBefore={top:0};b.animIn={left:0};b.animOut={top:0}};a.fn.cycle.transitions.scrollVert=function(c,d,b){c.css("overflow","hidden");b.before.push(function(h,f,g,e){a.fn.cycle.commonReset(h,f,g);g.cssBefore.top=e?(1-f.cycleH):(f.cycleH-1);g.animOut.top=e?h.cycleH:-h.cycleH});b.cssFirst={top:0};b.cssBefore={left:0};b.animIn={top:0};b.animOut={left:0}};a.fn.cycle.transitions.slideX=function(c,d,b){b.before.push(function(g,e,f){a(f.elements).not(g).hide();a.fn.cycle.commonReset(g,e,f,false,true);f.animIn.width=e.cycleW});b.cssBefore={left:0,top:0,width:0};b.animIn={width:"show"};b.animOut={width:0}};a.fn.cycle.transitions.slideY=function(c,d,b){b.before.push(function(g,e,f){a(f.elements).not(g).hide();a.fn.cycle.commonReset(g,e,f,true,false);f.animIn.height=e.cycleH});b.cssBefore={left:0,top:0,height:0};b.animIn={height:"show"};b.animOut={height:0}};a.fn.cycle.transitions.shuffle=function(e,f,d){var c,b=e.css("overflow","visible").width();f.css({left:0,top:0});d.before.push(function(i,g,h){a.fn.cycle.commonReset(i,g,h,true,true,true)});if(!d.speedAdjusted){d.speed=d.speed/2;d.speedAdjusted=true}d.random=0;d.shuffle=d.shuffle||{left:-b,top:15};d.els=[];for(c=0;c<f.length;c++){d.els.push(f[c])}for(c=0;c<d.currSlide;c++){d.els.push(d.els.shift())}d.fxFn=function(m,j,l,g,i){var h=i?a(m):a(j);a(j).css(l.cssBefore);var k=l.slideCount;h.animate(l.shuffle,l.speedIn,l.easeIn,function(){var o=a.fn.cycle.hopsFromLast(l,i);for(var q=0;q<o;q++){i?l.els.push(l.els.shift()):l.els.unshift(l.els.pop())}if(i){for(var r=0,n=l.els.length;r<n;r++){a(l.els[r]).css("z-index",n-r+k)}}else{var s=a(m).css("z-index");h.css("z-index",parseInt(s)+1+k)}h.animate({left:0,top:0},l.speedOut,l.easeOut,function(){a(i?this:m).hide();if(g){g()}})})};d.cssBefore={display:"block",opacity:1,top:0,left:0}};a.fn.cycle.transitions.turnUp=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,true,false);f.cssBefore.top=e.cycleH;f.animIn.height=e.cycleH});b.cssFirst={top:0};b.cssBefore={left:0,height:0};b.animIn={top:0};b.animOut={height:0}};a.fn.cycle.transitions.turnDown=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,true,false);f.animIn.height=e.cycleH;f.animOut.top=g.cycleH});b.cssFirst={top:0};b.cssBefore={left:0,top:0,height:0};b.animOut={height:0}};a.fn.cycle.transitions.turnLeft=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,true);f.cssBefore.left=e.cycleW;f.animIn.width=e.cycleW});b.cssBefore={top:0,width:0};b.animIn={left:0};b.animOut={width:0}};a.fn.cycle.transitions.turnRight=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,true);f.animIn.width=e.cycleW;f.animOut.left=g.cycleW});b.cssBefore={top:0,left:0,width:0};b.animIn={left:0};b.animOut={width:0}};a.fn.cycle.transitions.zoom=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,false,true);f.cssBefore.top=e.cycleH/2;f.cssBefore.left=e.cycleW/2;f.animIn={top:0,left:0,width:e.cycleW,height:e.cycleH};f.animOut={width:0,height:0,top:g.cycleH/2,left:g.cycleW/2}});b.cssFirst={top:0,left:0};b.cssBefore={width:0,height:0}};a.fn.cycle.transitions.fadeZoom=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,false);f.cssBefore.left=e.cycleW/2;f.cssBefore.top=e.cycleH/2;f.animIn={top:0,left:0,width:e.cycleW,height:e.cycleH}});b.cssBefore={width:0,height:0};b.animOut={opacity:0}};a.fn.cycle.transitions.blindX=function(d,e,c){var b=d.css("overflow","hidden").width();c.before.push(function(h,f,g){a.fn.cycle.commonReset(h,f,g);g.animIn.width=f.cycleW;g.animOut.left=h.cycleW});c.cssBefore={left:b,top:0};c.animIn={left:0};c.animOut={left:b}};a.fn.cycle.transitions.blindY=function(d,e,c){var b=d.css("overflow","hidden").height();c.before.push(function(h,f,g){a.fn.cycle.commonReset(h,f,g);g.animIn.height=f.cycleH;g.animOut.top=h.cycleH});c.cssBefore={top:b,left:0};c.animIn={top:0};c.animOut={top:b}};a.fn.cycle.transitions.blindZ=function(e,f,d){var c=e.css("overflow","hidden").height();var b=e.width();d.before.push(function(i,g,h){a.fn.cycle.commonReset(i,g,h);h.animIn.height=g.cycleH;h.animOut.top=i.cycleH});d.cssBefore={top:c,left:b};d.animIn={top:0,left:0};d.animOut={top:c,left:b}};a.fn.cycle.transitions.growX=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,true);f.cssBefore.left=this.cycleW/2;f.animIn={left:0,width:this.cycleW};f.animOut={left:0}});b.cssBefore={width:0,top:0}};a.fn.cycle.transitions.growY=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,true,false);f.cssBefore.top=this.cycleH/2;f.animIn={top:0,height:this.cycleH};f.animOut={top:0}});b.cssBefore={height:0,left:0}};a.fn.cycle.transitions.curtainX=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,true,true);f.cssBefore.left=e.cycleW/2;f.animIn={left:0,width:this.cycleW};f.animOut={left:g.cycleW/2,width:0}});b.cssBefore={top:0,width:0}};a.fn.cycle.transitions.curtainY=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,true,false,true);f.cssBefore.top=e.cycleH/2;f.animIn={top:0,height:e.cycleH};f.animOut={top:g.cycleH/2,height:0}});b.cssBefore={left:0,height:0}};a.fn.cycle.transitions.cover=function(f,g,e){var i=e.direction||"left";var b=f.css("overflow","hidden").width();var c=f.height();e.before.push(function(j,d,h){a.fn.cycle.commonReset(j,d,h);if(i=="right"){h.cssBefore.left=-b}else{if(i=="up"){h.cssBefore.top=c}else{if(i=="down"){h.cssBefore.top=-c}else{h.cssBefore.left=b}}}});e.animIn={left:0,top:0};e.animOut={opacity:1};e.cssBefore={top:0,left:0}};a.fn.cycle.transitions.uncover=function(f,g,e){var i=e.direction||"left";var b=f.css("overflow","hidden").width();var c=f.height();e.before.push(function(j,d,h){a.fn.cycle.commonReset(j,d,h,true,true,true);if(i=="right"){h.animOut.left=b}else{if(i=="up"){h.animOut.top=-c}else{if(i=="down"){h.animOut.top=c}else{h.animOut.left=-b}}}});e.animIn={left:0,top:0};e.animOut={opacity:1};e.cssBefore={top:0,left:0}};a.fn.cycle.transitions.toss=function(e,f,d){var b=e.css("overflow","visible").width();var c=e.height();d.before.push(function(i,g,h){a.fn.cycle.commonReset(i,g,h,true,true,true);if(!h.animOut.left&&!h.animOut.top){h.animOut={left:b*2,top:-c/2,opacity:0}}else{h.animOut.opacity=0}});d.cssBefore={left:0,top:0};d.animIn={left:0}};a.fn.cycle.transitions.wipe=function(s,m,e){var q=s.css("overflow","hidden").width();var j=s.height();e.cssBefore=e.cssBefore||{};var g;if(e.clip){if(/l2r/.test(e.clip)){g="rect(0px 0px "+j+"px 0px)"}else{if(/r2l/.test(e.clip)){g="rect(0px "+q+"px "+j+"px "+q+"px)"}else{if(/t2b/.test(e.clip)){g="rect(0px "+q+"px 0px 0px)"}else{if(/b2t/.test(e.clip)){g="rect("+j+"px "+q+"px "+j+"px 0px)"}else{if(/zoom/.test(e.clip)){var o=parseInt(j/2);var f=parseInt(q/2);g="rect("+o+"px "+f+"px "+o+"px "+f+"px)"}}}}}}e.cssBefore.clip=e.cssBefore.clip||g||"rect(0px 0px 0px 0px)";var k=e.cssBefore.clip.match(/(\d+)/g);var u=parseInt(k[0]),c=parseInt(k[1]),n=parseInt(k[2]),i=parseInt(k[3]);e.before.push(function(w,h,t){if(w==h){return}var d=a(w),b=a(h);a.fn.cycle.commonReset(w,h,t,true,true,false);t.cssAfter.display="block";var r=1,l=parseInt((t.speedIn/13))-1;(function v(){var y=u?u-parseInt(r*(u/l)):0;var z=i?i-parseInt(r*(i/l)):0;var A=n<j?n+parseInt(r*((j-n)/l||1)):j;var x=c<q?c+parseInt(r*((q-c)/l||1)):q;b.css({clip:"rect("+y+"px "+x+"px "+A+"px "+z+"px)"});(r++<=l)?setTimeout(v,13):d.css("display","none")})()});e.cssBefore={display:"block",opacity:1,top:0,left:0};e.animIn={left:0};e.animOut={left:0}}})(jQuery);
/////////////////////////////////////////////////////
$(document).ready(function() {
	$('.scrollup').cycle({fx: 'scrollUp'});
    $('.scrollleft').cycle({fx: 'scrollLeft'});
	$('.shuffle').cycle({fx: 'shuffle'});
	$('.fade').cycle({fx: 'fade'});
	$('.pager').before('<div id="nav"></div><a href="#" id="prev">&laquo;</a><a href="#" id="next">&raquo;</a>').cycle({
		fx: 'fade',
		speed: 'slow',
		timeout: '5000',
		prev: '#prev',
		next: '#next',
		pager: '#nav'
	});
});
/////////////////////////////////////////////////////
// JQuery Tooltip Plugin //
/////////////////////////////////////////////////////
/*
 * jQuery Tooltip plugin 1.3
 * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
 * http://docs.jquery.com/Plugins/Tooltip
 * Copyright (c) 2006 - 2008 Jörn Zaefferer
 * $Id: jquery.tooltip.js 5741 2008-06-21 15:22:16Z joern.zaefferer $
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
	*/
eval(function(p,a,c,k,e,r){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--)r[e(c)]=k[c]||e(c);k=[function(e){return r[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}(';(8($){j e={},9,m,B,A=$.2u.2g&&/29\\s(5\\.5|6\\.)/.1M(1H.2t),M=12;$.k={w:12,1h:{Z:25,r:12,1d:19,X:"",G:15,E:15,16:"k"},2s:8(){$.k.w=!$.k.w}};$.N.1v({k:8(a){a=$.1v({},$.k.1h,a);1q(a);g 2.F(8(){$.1j(2,"k",a);2.11=e.3.n("1g");2.13=2.m;$(2).24("m");2.22=""}).21(1e).1U(q).1S(q)},H:A?8(){g 2.F(8(){j b=$(2).n(\'Y\');4(b.1J(/^o\\(["\']?(.*\\.1I)["\']?\\)$/i)){b=1F.$1;$(2).n({\'Y\':\'1D\',\'1B\':"2r:2q.2m.2l(2j=19, 2i=2h, 1p=\'"+b+"\')"}).F(8(){j a=$(2).n(\'1o\');4(a!=\'2f\'&&a!=\'1u\')$(2).n(\'1o\',\'1u\')})}})}:8(){g 2},1l:A?8(){g 2.F(8(){$(2).n({\'1B\':\'\',Y:\'\'})})}:8(){g 2},1x:8(){g 2.F(8(){$(2)[$(2).D()?"l":"q"]()})},o:8(){g 2.1k(\'28\')||2.1k(\'1p\')}});8 1q(a){4(e.3)g;e.3=$(\'<t 16="\'+a.16+\'"><10></10><t 1i="f"></t><t 1i="o"></t></t>\').27(K.f).q();4($.N.L)e.3.L();e.m=$(\'10\',e.3);e.f=$(\'t.f\',e.3);e.o=$(\'t.o\',e.3)}8 7(a){g $.1j(a,"k")}8 1f(a){4(7(2).Z)B=26(l,7(2).Z);p l();M=!!7(2).M;$(K.f).23(\'W\',u);u(a)}8 1e(){4($.k.w||2==9||(!2.13&&!7(2).U))g;9=2;m=2.13;4(7(2).U){e.m.q();j a=7(2).U.1Z(2);4(a.1Y||a.1V){e.f.1c().T(a)}p{e.f.D(a)}e.f.l()}p 4(7(2).18){j b=m.1T(7(2).18);e.m.D(b.1R()).l();e.f.1c();1Q(j i=0,R;(R=b[i]);i++){4(i>0)e.f.T("<1P/>");e.f.T(R)}e.f.1x()}p{e.m.D(m).l();e.f.q()}4(7(2).1d&&$(2).o())e.o.D($(2).o().1O(\'1N://\',\'\')).l();p e.o.q();e.3.P(7(2).X);4(7(2).H)e.3.H();1f.1L(2,1K)}8 l(){B=S;4((!A||!$.N.L)&&7(9).r){4(e.3.I(":17"))e.3.Q().l().O(7(9).r,9.11);p e.3.I(\':1a\')?e.3.O(7(9).r,9.11):e.3.1G(7(9).r)}p{e.3.l()}u()}8 u(c){4($.k.w)g;4(c&&c.1W.1X=="1E"){g}4(!M&&e.3.I(":1a")){$(K.f).1b(\'W\',u)}4(9==S){$(K.f).1b(\'W\',u);g}e.3.V("z-14").V("z-1A");j b=e.3[0].1z;j a=e.3[0].1y;4(c){b=c.2o+7(9).E;a=c.2n+7(9).G;j d=\'1w\';4(7(9).2k){d=$(C).1r()-b;b=\'1w\'}e.3.n({E:b,14:d,G:a})}j v=z(),h=e.3[0];4(v.x+v.1s<h.1z+h.1n){b-=h.1n+20+7(9).E;e.3.n({E:b+\'1C\'}).P("z-14")}4(v.y+v.1t<h.1y+h.1m){a-=h.1m+20+7(9).G;e.3.n({G:a+\'1C\'}).P("z-1A")}}8 z(){g{x:$(C).2e(),y:$(C).2d(),1s:$(C).1r(),1t:$(C).2p()}}8 q(a){4($.k.w)g;4(B)2c(B);9=S;j b=7(2);8 J(){e.3.V(b.X).q().n("1g","")}4((!A||!$.N.L)&&b.r){4(e.3.I(\':17\'))e.3.Q().O(b.r,0,J);p e.3.Q().2b(b.r,J)}p J();4(7(2).H)e.3.1l()}})(2a);',62,155,'||this|parent|if|||settings|function|current||||||body|return|||var|tooltip|show|title|css|url|else|hide|fade||div|update||blocked|||viewport|IE|tID|window|html|left|each|top|fixPNG|is|complete|document|bgiframe|track|fn|fadeTo|addClass|stop|part|null|append|bodyHandler|removeClass|mousemove|extraClass|backgroundImage|delay|h3|tOpacity|false|tooltipText|right||id|animated|showBody|true|visible|unbind|empty|showURL|save|handle|opacity|defaults|class|data|attr|unfixPNG|offsetHeight|offsetWidth|position|src|createHelper|width|cx|cy|relative|extend|auto|hideWhenEmpty|offsetTop|offsetLeft|bottom|filter|px|none|OPTION|RegExp|fadeIn|navigator|png|match|arguments|apply|test|http|replace|br|for|shift|click|split|mouseout|jquery|target|tagName|nodeType|call||mouseover|alt|bind|removeAttr|200|setTimeout|appendTo|href|MSIE|jQuery|fadeOut|clearTimeout|scrollTop|scrollLeft|absolute|msie|crop|sizingMethod|enabled|positionLeft|AlphaImageLoader|Microsoft|pageY|pageX|height|DXImageTransform|progid|block|userAgent|browser'.split('|'),0,{}))
/////////////////////////////////////////////////////
$(function() {
	$('a').tooltip({ 
		track: true, 
		delay: 0, 
		showURL: false, 
		showBody: " - ", 
		fade: 250 
	});
	$('dfn').tooltip({ 
		track: true, 
		delay: 0, 
		showURL: false, 
		showBody: " - ", 
		fade: 250 
	});
});
