$(document).ready( function(){
	// ------- General Style Modifications ------- //
	try{$('.BtnSubmit').button();} catch (err) {}
	try{$('.InputInitialFocus').focus();} catch (err) {}
	try{$('.SelectStyle').selectBox();} catch (err) {}
	
	try{
		$(".BtnActiveSubmit").addClass("ui-state-hover");
		$(".BtnActiveSubmit").css("cursor","default");
		$(".BtnActiveSubmit").mouseleave(function() {
		   $(".BtnActiveSubmit").addClass("ui-state-hover");
		});	
		$(".BtnActiveSubmit").click(function() {
		   return false;
		});
	} catch (err) {}
	
	try{
		$(".BtnChangeClick").click(function() {
			//return false;
			$("#LoaderImage").show();		
			$("#LoaderBar").dialog({
				modal: true,
				resizable: false,
				title: 'please wait...',
				height:70
			});				
		});
	} catch (err) {}
	// try{$('.rounded').corners("5px");} catch (err) {}
	// try{$('#capcha').s3Capcha();} catch (err) {}
	// ---------------------------------- //	
    
	// ------- CharacterPanel Specific ------- //
	try{
		$(".CharImageHolder").click(function() {
			CharPanelChange(1, CharacterListing);
		});
		$('#CharacterPanel').mouseenter(
			function(){$('#CharPanelPrevNextBtnsHolder').show('fade');}
		);	
		$('#CharacterPanel').mouseleave(
			function(){$('#CharPanelPrevNextBtnsHolder').hide('fade');}
		);
	} catch (err){}
	// ---------------------------------- //
	
	// ------- StyleView Specific ------- //
	// try{$("#StyleSizes").buttonset();} catch (err) {}
	var jqzOptions = {
						zoomWidth: 385,
						zoomHeight: 450,
						xOffset: 25,
						yOffset: 80,
						position: "left",
						title: false,
						showEffect: "fadein",
						fadeinSpeed:"fast",
						hideEffect: "hide",
						preloadText:"loading..."
					}
	try{$(".jqzoom").jqzoom(jqzOptions);} catch (err) {}
	var jqzOptions2 = {
						zoomWidth: 385,
						zoomHeight: 450,
						xOffset: 25,
						yOffset: 0,
						position: "left",
						title: false,
						showEffect: "fadein",
						fadeinSpeed:"fast",
						hideEffect: "hide",
						preloadText:"loading..."
					}
	try{$(".jqzoom2").jqzoom(jqzOptions2);} catch (err) {}
	
	try{
		$(".PopZoomLink").removeAttr('target');
		$(".PopZoomLink").click(function() {			
			window.open($(this).attr('href'),'ImageZoomPopup','width=900,height=900');	
			return false;
		})
	} catch (err) {}
	// ---------------------------------- //
	
	
	// ------- Gifts Specific ------- //
	try{$("#GiftsBtnGo").click(function() {
		$( "#dialog-message" ).dialog({
			modal: true,
			resizable: false,
			buttons: [{
				text: 'ok',
				click: function() {$( this ).dialog( "close" );}
			}]
		});											
	});} catch (err) {}
	// ---------------------------------- //
	
	// ------- OrderPayment Specific ------- //
	try{
			if ($('#ShippingOther').attr('checked') !== 'checked') {
				$('#ShippingAddress').hide();
			}
	} catch (err) {}
	
	try{$('#BillADDRESS_5').change(function() {
		if ($('#BillADDRESS_5').val() !== 'United States Of America') {		
			$('#BillADDRESS_4').val('Non-US State');
			$('#BillADDRESS_4').selectBox('value','Non-US State');
		} else {
			if ($('#BillADDRESS_4').val() == 'Non-US State') {
				$('#BillADDRESS_4').selectBox('value','State...');	
				$('#BillADDRESS_4').val('');
			}
		}
	});} catch (err) {}
	
	try{$('#ShipADDRESS_5').change(function() {
		if ($('#ShipADDRESS_5').val() !== 'United States Of America') {		
			$('#ShipADDRESS_4').val('Non-US State');
			$('#ShipADDRESS_4').selectBox('value','Non-US State');
		} else {
			if ($('#ShipADDRESS_4').val() == 'Non-US State') {
				$('#ShipADDRESS_4').selectBox('value','State...');	
				$('#ShipADDRESS_4').val('');
			}
		}
	});} catch (err) {}
		
	try{$('input:radio[name=ShippingAddress]').change(function() {
		if ( $('input:radio[name=ShippingAddress]:checked').val() == 'Billing' ) {
			$('#ShipFirstName').val($('#BillFirstName').val());
			$('#ShipLastName').val($('#BillLastName').val());
			$('#ShipADDRESS_1').val($('#BillADDRESS_1').val());
			$('#ShipADDRESS_2').val($('#BillADDRESS_2').val());
			$('#ShipADDRESS_3').val($('#BillADDRESS_3').val());
			$('#ShipADDRESS_4').val($('#BillADDRESS_4').val());
			$('#ShipADDRESS_5').val($('#BillADDRESS_5').val());
			$('#ShipPOSTCODE').val($('#BillPOSTCODE').val());
			$('#ShippingAddress').hide();
		} else {
			$('#ShipFirstName').val('');
			$('#ShipLastName').val('');
			$('#ShipADDRESS_1').val('');
			$('#ShipADDRESS_2').val('');
			$('#ShipADDRESS_3').val('');
			$('#ShipADDRESS_4').val('');
			$('#ShipADDRESS_5').val('');
			$('#ShipPOSTCODE').val('');	
			$('#ShippingAddress').show('fade');
		}
	});} catch (err) {}
	
	// ---------------------------------- //
	
	// ------- Form Validation Specific ------- /
		try {
			jQuery.validator.addMethod("passwordReg", function( value, element ) {
				var result = this.optional(element) || value.length >= 8 && /\d/.test(value) && /[a-z]/i.test(value);
				if (!result) {
					element.value = "";
					var validator = this;
					setTimeout(function() {
						validator.blockFocusCleanup = true;
						element.focus();
						validator.blockFocusCleanup = false;
					}, 1);
				}
				return result;
			}, "<div style='color:#ff0000; width:280px; margin-top:5px;' ><img src='Resources/Images/warning.gif' alt='Warning!' width='24' height='24' style='float:left; margin-right:5px; margin-bottom:5px;' /> Your password must be at least 8 characters long and contain at least one number and one character.</div>");
			
			jQuery.validator.addMethod("emailAlt", function( value, element ) {						
				var result = this.optional(element) || /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/.test(value);
				if (!result) {
					var validator = this;
					setTimeout(function() {
						/*validator.blockFocusCleanup = true;*/
						/*element.focus();*/
						/*validator.blockFocusCleanup = false;*/
					}, 1);
				}
				return result;
			}, "<div style='color:#ff0000; width:280px; margin-top:5px;' ><img src='Resources/Images/warning.gif' alt='Warning!' width='24' height='24' style='float:left; margin-right:5px; margin-bottom:5px;' /> Please enter a valid email address, example: you@yourdomain.com</div>");
			
			jQuery.validator.messages.required = "";
			$("#GeneralForm").validate({
				invalidHandler: function(e, validator) {
					var errors = validator.numberOfInvalids();
					if (errors) {
						var message = errors == 1
							? 'You missed 1 field. It has been highlighted below'
							: 'You missed ' + errors + ' fields.  They have been highlighted below';
						$("div.error span").html(message);
						$("div.error").show();
					} else {
						$("div.error").hide();
					}
				},
				onkeyup: false,
				submitHandler: function() {
					$("div.error").hide();
					this.form.submit();
				},
				messages: {
					RePassword: {
						required: " ",
						equalTo: "<div style='color:#ff0000; width:280px; margin-top:5px;' ><img src='Resources/Images/warning.gif' alt='Warning!' width='24' height='24' style='float:left; margin-right:5px; margin-bottom:5px;' /> Please enter the same password as above.</div>"	
					},
					BP_EMAIL: {
						required: " ",
						email: "<div style='color:#ff0000; width:280px; margin-top:5px;' ><img src='Resources/Images/warning.gif' alt='Warning!' width='24' height='24' style='float:left; margin-right:5px; margin-bottom:5px;' /> Please enter a valid email address, example: you@yourdomain.com</div>",
						remote: jQuery.validator.format("{0} is already taken, please enter a different address.")	
					}
				},
				debug:false
			});
		} catch (err) {}
	// ---------------------------------- //
});

// -------------------------------------------------------------------- Functions ------------------------------------------------------------------ //

// ------- Character Panel Functions ------- //
var vHideCharPanel = true;
function ShowCharSharePanel() {
	$('#CharacterCollectPanel').hide();
	vHideCharPanel = true;
	$('#CharacterSharePanel').show('fade'); 
	$('html,body').animate({scrollTop: ($('#CharacterSharePanel').offset().top + $('#CharacterSharePanel').height())-$(window).height()}, 500);

	$('#CharacterSharePanel').mouseleave(
		function(){$('#CharacterSharePanel').hide('fade');}
	);
	$('#CharacterSharePanel').mouseenter(
		function(){vHideCharPanel = false;}
	);
	$('#CharShareLink').mouseleave(
		function(){setTimeout("if(vHideCharPanel == true) {$('#CharacterSharePanel').hide('fade');}",1000);}					   
	)
		
}

var vHideCharCollectPanel = true;
function ShowCharCollectPanel() {
	$('#CharacterSharePanel').hide();
	vHideCharCollectPanel = true;
	$('#CharacterCollectPanel').show('fade'); 
	$('html,body').animate({scrollTop: ($('#CharacterCollectPanel').offset().top + $('#CharacterCollectPanel').height())-$(window).height()}, 500);
	
	$('#CharacterCollectPanel').mouseleave(
		function(){$('#CharacterCollectPanel').hide('fade');}
	);
	$('#CharacterCollectPanel').mouseenter(
		function(){vHideCharCollectPanel = false;}
	);
	$('#CharCollectLink').mouseleave(
		function(){setTimeout("if(vHideCharCollectPanel == true) {$('#CharacterCollectPanel').hide('fade');}",1000);}					   
	)
		
}

var CharPanelCurrentIndex = 0;
function CharPanelChange(Increment, CharacterDetails) {
	if ( CharacterDetails.length > 1 ) {
		$('#CharacterPanelImage').hide('fade',{},'fast',function(){
			
			if (Increment == 1) {								 
				if (CharPanelCurrentIndex == (CharacterDetails.length-1)) { 
					CharPanelCurrentIndex = 0; 
				} else { 
					CharPanelCurrentIndex = CharPanelCurrentIndex + Increment;
				}
			} else if (Increment == -1) {
				if (CharPanelCurrentIndex == 0) { 
					CharPanelCurrentIndex = (CharacterDetails.length-1); 
				} else { 
					CharPanelCurrentIndex = CharPanelCurrentIndex + Increment;
				}
			}
			
			$('#CharacterPanelImage').attr('alt',CharacterDetails[CharPanelCurrentIndex].Alt);
			$('#CollectPanelBtn1').attr('href',CharacterDetails[CharPanelCurrentIndex].Collect1);
			$('#CollectPanelBtn2').attr('href',CharacterDetails[CharPanelCurrentIndex].Collect2);
			$('#CollectPanelBtn3').attr('href',CharacterDetails[CharPanelCurrentIndex].Collect3);
			//$('#SharePanelBtn1').attr('href',CharacterDetails[CharPanelCurrentIndex].Btn1);
			//addthis.update('#SharePanelBtn1', 'url', CharacterDetails[CharPanelCurrentIndex].AddThisURL);
			//addthis.update('#SharePanelBtn1', 'title', CharacterDetails[CharPanelCurrentIndex].AddThisTitle);
			
			 $("#SharePanelBtn1").attr("addthis:url",CharacterDetails[CharPanelCurrentIndex].AddThisURL);
			 $("#SharePanelBtn1").attr("addthis:title",CharacterDetails[CharPanelCurrentIndex].AddThisTitle);
			 window.addthis.ost = 0;
			 window.addthis.ready();
			 addthis.toolbox('#SharePanelBtn1');
			 $("#SharePanelBtn1 > .atclear").remove();
			
			$('#ShareFacebookLink').attr('href',CharacterDetails[CharPanelCurrentIndex].Facebook);
			$('#ShareTwitterLink').attr('href',CharacterDetails[CharPanelCurrentIndex].Twitter);
			$('#ShareRSSFeedLink').attr('href',CharacterDetails[CharPanelCurrentIndex].RSSFeed);
			$('#ShareEmailLink').attr('href',CharacterDetails[CharPanelCurrentIndex].Email);
			$('#ShareEmbedLink').attr('href',CharacterDetails[CharPanelCurrentIndex].Embed);
			$('#CharacterPanelImage').attr('width',CharacterDetails[CharPanelCurrentIndex].ImageWidth);	
			$('#CharacterPanelImage').attr('height',CharacterDetails[CharPanelCurrentIndex].ImageHeight);	
			$('#CharacterPanelImage').attr('src',CharacterDetails[CharPanelCurrentIndex].Name);		
			
			$('#CharPanelLoaderImage').show();
		});
		
		$('#CharacterPanelImage').load( function() {
			$('#CharPanelLoaderImage').hide();
			$('#CharacterPanelImage').show('fade',{},'fast')								 
		});
	}
}

function CharPanelInitialise(InitialIndex, CPImageSrc, CPImageWidth, CPImageHeight, CPAlt, CPCollect1, CPCollect2, CPCollect3, CPAddThisURL, CPAddThisTitle, CPFacebook, CPTwitter, CPRSSFeed, CPEmail, CPEmbed) {
	$('#CharacterPanelImage').hide('fade',{},'fast',function(){
		
		CharPanelCurrentIndex = InitialIndex;
		
		$('#CharacterPanelImage').attr('alt',CPAlt);
		$('#CollectPanelBtn1').attr('href',CPCollect1);
		$('#CollectPanelBtn2').attr('href',CPCollect2);
		$('#CollectPanelBtn3').attr('href',CPCollect3);
		
		 $("#SharePanelBtn1").attr("addthis:url",CPAddThisURL);
		 $("#SharePanelBtn1").attr("addthis:title",CPAddThisTitle);
		 window.addthis.ost = 0;
		 window.addthis.ready();
		 addthis.toolbox('#SharePanelBtn1');
		 $("#SharePanelBtn1 > .atclear").remove();
		
		$('#ShareFacebookLink').attr('href',CPFacebook);
		$('#ShareTwitterLink').attr('href',CPTwitter);
		$('#ShareRSSFeedLink').attr('href',CPRSSFeed);
		$('#ShareEmailLink').attr('href',CPEmail);
		$('#ShareEmbedLink').attr('href',CPEmbed);
		$('#CharacterPanelImage').attr('width',CPImageWidth);	
		$('#CharacterPanelImage').attr('height',CPImageHeight);	
		$('#CharacterPanelImage').attr('src',CPImageSrc);		
		
		$('#CharPanelLoaderImage').show();
	});
	
	$('#CharacterPanelImage').load( function() {
		$('#CharPanelLoaderImage').hide();
		$('#CharacterPanelImage').show('fade',{},'fast')								 
	});
}
// ----------------------------------------- //

// --------------------------------------------------------------------------------------------------------------------------------------------------------------- /






// -------------------------------------------------------------------- Additional Components ------------------------------------------------------------------ //

/*
 *  jQuery selectBox (version 1.0.7)
 *
 *  Copyright 2011 Cory LaViska for A Beautiful Site, LLC.
 *
 *  http://abeautifulsite.net/blog/2011/01/jquery-selectbox-plugin/
 *
 */
if(jQuery)(function($){$.extend($.fn,{selectBox:function(method,data){var typeTimer,typeSearch='';var init=function(select,data){if(navigator.userAgent.match(/iPad|iPhone|Android/i))return false;if(select.tagName.toLowerCase()!=='select')return false;select=$(select);if(select.data('selectBox-control'))return false;var control=$('<a class="selectBox" />'),inline=select.attr('multiple')||parseInt(select.attr('size'))>1;var settings=data||{};if(settings.autoWidth===undefined)settings.autoWidth=true;control.addClass(select.attr('class')).attr('style',select.attr('style')||'').attr('title',select.attr('title')||'').attr('tabindex',parseInt(select.attr('tabindex'))).css('display','inline-block').bind('focus.selectBox',function(){if(this!==document.activeElement)$(document.activeElement).blur();if(control.hasClass('selectBox-active'))return;control.addClass('selectBox-active');select.trigger('focus')}).bind('blur.selectBox',function(){if(!control.hasClass('selectBox-active'))return;control.removeClass('selectBox-active');select.trigger('blur')});if(select.attr('disabled'))control.addClass('selectBox-disabled');if(inline){var options=getOptions(select,'inline');control.append(options).data('selectBox-options',options).addClass('selectBox-inline').addClass('selectBox-menuShowing').bind('keydown.selectBox',function(event){handleKeyDown(select,event)}).bind('keypress.selectBox',function(event){handleKeyPress(select,event)}).bind('mousedown.selectBox',function(event){if($(event.target).is('A.selectBox-inline'))event.preventDefault();if(!control.hasClass('selectBox-focus'))control.focus()}).insertAfter(select);if(!select[0].style.height){var size=select.attr('size')?parseInt(select.attr('size')):5;var tmp=control.clone().removeAttr('id').css({position:'absolute',top:'-9999em'}).show().appendTo('body');tmp.find('.selectBox-options').html('<li><a>\u00A0</a></li>');optionHeight=parseInt(tmp.find('.selectBox-options A:first').html('&nbsp;').outerHeight());tmp.remove();control.height(optionHeight*size)}disableSelection(control)}else{var label=$('<span class="selectBox-label" />'),arrow=$('<span class="selectBox-arrow" />');label.text($(select).find('OPTION:selected').text()||'\u00A0');var options=getOptions(select,'dropdown');options.appendTo('BODY');control.data('selectBox-options',options).addClass('selectBox-dropdown').append(label).append(arrow).bind('mousedown.selectBox',function(event){if(control.hasClass('selectBox-menuShowing')){hideMenus()}else{event.stopPropagation();options.data('selectBox-down-at-x',event.screenX).data('selectBox-down-at-y',event.screenY);showMenu(select)}}).bind('keydown.selectBox',function(event){handleKeyDown(select,event)}).bind('keypress.selectBox',function(event){handleKeyPress(select,event)}).insertAfter(select);disableSelection(control)}select.addClass('selectBox').data('selectBox-control',control).data('selectBox-settings',settings).hide()};var getOptions=function(select,type){var options;switch(type){case'inline':options=$('<ul class="selectBox-options" />');if(select.find('OPTGROUP').length){select.find('OPTGROUP').each(function(){var optgroup=$('<li class="selectBox-optgroup" />');optgroup.text($(this).attr('label'));options.append(optgroup);$(this).find('OPTION').each(function(){var li=$('<li />'),a=$('<a />');li.addClass($(this).attr('class'));a.attr('rel',$(this).val()).text($(this).text());li.append(a);if($(this).attr('disabled'))li.addClass('selectBox-disabled');if($(this).attr('selected'))li.addClass('selectBox-selected');options.append(li)})})}else{select.find('OPTION').each(function(){var li=$('<li />'),a=$('<a />');li.addClass($(this).attr('class'));a.attr('rel',$(this).val()).text($(this).text());li.append(a);if($(this).attr('disabled'))li.addClass('selectBox-disabled');if($(this).attr('selected'))li.addClass('selectBox-selected');options.append(li)})}options.find('A').bind('mouseover.selectBox',function(event){addHover(select,$(this).parent())}).bind('mouseout.selectBox',function(event){removeHover(select,$(this).parent())}).bind('mousedown.selectBox',function(event){event.preventDefault();if(!select.selectBox('control').hasClass('selectBox-active'))select.selectBox('control').focus()}).bind('mouseup.selectBox',function(event){hideMenus();selectOption(select,$(this).parent(),event)});disableSelection(options);return options;case'dropdown':options=$('<ul class="selectBox-dropdown-menu selectBox-options" />');if(select.find('OPTGROUP').length){select.find('OPTGROUP').each(function(){var optgroup=$('<li class="selectBox-optgroup" />');optgroup.text($(this).attr('label'));options.append(optgroup);$(this).find('OPTION').each(function(){var li=$('<li />'),a=$('<a />');li.addClass($(this).attr('class'));a.attr('rel',$(this).val()).text($(this).text());li.append(a);if($(this).attr('disabled'))li.addClass('selectBox-disabled');if($(this).attr('selected'))li.addClass('selectBox-selected');options.append(li)})})}else{if(select.find('OPTION').length>0){select.find('OPTION').each(function(){var li=$('<li />'),a=$('<a />');li.addClass($(this).attr('class'));a.attr('rel',$(this).val()).text($(this).text());li.append(a);if($(this).attr('disabled'))li.addClass('selectBox-disabled');if($(this).attr('selected'))li.addClass('selectBox-selected');options.append(li)})}else{options.append('<li>\u00A0</li>')}}options.data('selectBox-select',select).css('display','none').appendTo('BODY').find('A').bind('mousedown.selectBox',function(event){event.preventDefault();if(event.screenX===options.data('selectBox-down-at-x')&&event.screenY===options.data('selectBox-down-at-y')){options.removeData('selectBox-down-at-x').removeData('selectBox-down-at-y');hideMenus()}}).bind('mouseup.selectBox',function(event){if(event.screenX===options.data('selectBox-down-at-x')&&event.screenY===options.data('selectBox-down-at-y')){return}else{options.removeData('selectBox-down-at-x').removeData('selectBox-down-at-y')}selectOption(select,$(this).parent());hideMenus()}).bind('mouseover.selectBox',function(event){addHover(select,$(this).parent())}).bind('mouseout.selectBox',function(event){removeHover(select,$(this).parent())});disableSelection(options);return options}};var destroy=function(select){select=$(select);var control=select.data('selectBox-control');if(!control)return;var options=control.data('selectBox-options');options.remove();control.remove();select.removeClass('selectBox').removeData('selectBox-control').removeData('selectBox-settings').show()};var showMenu=function(select){select=$(select);var control=select.data('selectBox-control'),settings=select.data('selectBox-settings'),options=control.data('selectBox-options');if(control.hasClass('selectBox-disabled'))return false;hideMenus();if(settings.autoWidth)options.css('width',control.outerWidth()-(parseInt(control.css('borderLeftWidth'))+parseInt(control.css('borderLeftWidth'))));options.css({top:control.offset().top+control.outerHeight()-(parseInt(control.css('borderBottomWidth'))),left:control.offset().left});switch(settings.menuTransition){case'fade':options.fadeIn(settings.menuSpeed);break;case'slide':options.slideDown(settings.menuSpeed);break;default:options.show(settings.menuSpeed);break}var li=options.find('.selectBox-selected:first');keepOptionInView(select,li,true);addHover(select,li);control.addClass('selectBox-menuShowing');$(document).bind('mousedown.selectBox',function(event){if($(event.target).parents().andSelf().hasClass('selectBox-options'))return;hideMenus()})};var hideMenus=function(){if($(".selectBox-dropdown-menu").length===0)return;$(document).unbind('mousedown.selectBox');$(".selectBox-dropdown-menu").each(function(){var options=$(this),select=options.data('selectBox-select'),control=select.data('selectBox-control'),settings=select.data('selectBox-settings');switch(settings.menuTransition){case'fade':options.fadeOut(settings.menuSpeed);break;case'slide':options.slideUp(settings.menuSpeed);break;default:options.hide(settings.menuSpeed);break}control.removeClass('selectBox-menuShowing')})};var selectOption=function(select,li,event){select=$(select);li=$(li);var control=select.data('selectBox-control'),settings=select.data('selectBox-settings');if(control.hasClass('selectBox-disabled'))return false;if(li.length===0||li.hasClass('selectBox-disabled'))return false;if(select.attr('multiple')){if(event.shiftKey&&control.data('selectBox-last-selected')){li.toggleClass('selectBox-selected');var affectedOptions;if(li.index()>control.data('selectBox-last-selected').index()){affectedOptions=li.siblings().slice(control.data('selectBox-last-selected').index(),li.index())}else{affectedOptions=li.siblings().slice(li.index(),control.data('selectBox-last-selected').index())}affectedOptions=affectedOptions.not('.selectBox-optgroup, .selectBox-disabled');if(li.hasClass('selectBox-selected')){affectedOptions.addClass('selectBox-selected')}else{affectedOptions.removeClass('selectBox-selected')}}else if(event.metaKey){li.toggleClass('selectBox-selected')}else{li.siblings().removeClass('selectBox-selected');li.addClass('selectBox-selected')}}else{li.siblings().removeClass('selectBox-selected');li.addClass('selectBox-selected')}if(control.hasClass('selectBox-dropdown')){control.find('.selectBox-label').text(li.text())}var i=0,selection=[];if(select.attr('multiple')){control.find('.selectBox-selected A').each(function(){selection[i++]=$(this).attr('rel')})}else{selection=li.find('A').attr('rel')}control.data('selectBox-last-selected',li);if(select.val()!==selection){select.val(selection);select.trigger('change')}return true};var addHover=function(select,li){select=$(select);li=$(li);var control=select.data('selectBox-control'),options=control.data('selectBox-options');options.find('.selectBox-hover').removeClass('selectBox-hover');li.addClass('selectBox-hover')};var removeHover=function(select,li){select=$(select);li=$(li);var control=select.data('selectBox-control'),options=control.data('selectBox-options');options.find('.selectBox-hover').removeClass('selectBox-hover')};var keepOptionInView=function(select,li,center){if(!li||li.length===0)return;select=$(select);var control=select.data('selectBox-control'),options=control.data('selectBox-options'),scrollBox=control.hasClass('selectBox-dropdown')?options:options.parent(),top=parseInt(li.offset().top-scrollBox.position().top),bottom=parseInt(top+li.outerHeight());if(center){scrollBox.scrollTop(li.offset().top-scrollBox.offset().top+scrollBox.scrollTop()-(scrollBox.height()/2))}else{if(top<0){scrollBox.scrollTop(li.offset().top-scrollBox.offset().top+scrollBox.scrollTop())}if(bottom>scrollBox.height()){scrollBox.scrollTop((li.offset().top+li.outerHeight())-scrollBox.offset().top+scrollBox.scrollTop()-scrollBox.height())}}};var handleKeyDown=function(select,event){select=$(select);var control=select.data('selectBox-control'),options=control.data('selectBox-options'),totalOptions=0,i=0;if(control.hasClass('selectBox-disabled'))return;switch(event.keyCode){case 8:event.preventDefault();typeSearch='';break;case 9:case 27:hideMenus();removeHover(select);break;case 13:if(control.hasClass('selectBox-menuShowing')){selectOption(select,options.find('LI.selectBox-hover:first'),event);if(control.hasClass('selectBox-dropdown'))hideMenus()}else{showMenu(select)}break;case 38:case 37:event.preventDefault();if(control.hasClass('selectBox-menuShowing')){var prev=options.find('.selectBox-hover').prev('LI');totalOptions=options.find('LI:not(.selectBox-optgroup)').length;i=0;while(prev.length===0||prev.hasClass('selectBox-disabled')||prev.hasClass('selectBox-optgroup')){prev=prev.prev('LI');if(prev.length===0)prev=options.find('LI:last');if(++i>=totalOptions)break}addHover(select,prev);keepOptionInView(select,prev)}else{showMenu(select)}break;case 40:case 39:event.preventDefault();if(control.hasClass('selectBox-menuShowing')){var next=options.find('.selectBox-hover').next('LI');totalOptions=options.find('LI:not(.selectBox-optgroup)').length;i=0;while(next.length===0||next.hasClass('selectBox-disabled')||next.hasClass('selectBox-optgroup')){next=next.next('LI');if(next.length===0)next=options.find('LI:first');if(++i>=totalOptions)break}addHover(select,next);keepOptionInView(select,next)}else{showMenu(select)}break}};var handleKeyPress=function(select,event){select=$(select);var control=select.data('selectBox-control'),options=control.data('selectBox-options');if(control.hasClass('selectBox-disabled'))return;switch(event.keyCode){case 9:case 27:case 13:case 38:case 37:case 40:case 39:break;default:if(!control.hasClass('selectBox-menuShowing'))showMenu(select);event.preventDefault();clearTimeout(typeTimer);typeSearch+=String.fromCharCode(event.charCode||event.keyCode);options.find('A').each(function(){if($(this).text().substr(0,typeSearch.length).toLowerCase()===typeSearch.toLowerCase()){addHover(select,$(this).parent());keepOptionInView(select,$(this).parent());return false}});typeTimer=setTimeout(function(){typeSearch=''},1000);break}};var enable=function(select){select=$(select);select.attr('disabled',false);var control=select.data('selectBox-control');if(!control)return;control.removeClass('selectBox-disabled')};var disable=function(select){select=$(select);select.attr('disabled',true);var control=select.data('selectBox-control');if(!control)return;control.addClass('selectBox-disabled')};var setValue=function(select,value){select=$(select);select.val(value);value=select.val();var control=select.data('selectBox-control');if(!control)return;var settings=select.data('selectBox-settings'),options=control.data('selectBox-options');control.find('.selectBox-label').text($(select).find('OPTION:selected').text()||'\u00A0');options.find('.selectBox-selected').removeClass('selectBox-selected');options.find('A').each(function(){if(typeof(value)==='object'){for(var i=0;i<value.length;i++){if($(this).attr('rel')==value[i]){$(this).parent().addClass('selectBox-selected')}}}else{if($(this).attr('rel')==value){$(this).parent().addClass('selectBox-selected')}}});if(settings.change)settings.change.call(select)};var setOptions=function(select,options){select=$(select);var control=select.data('selectBox-control'),settings=select.data('selectBox-settings');switch(typeof(data)){case'string':select.html(data);break;case'object':select.html('');for(var i in data){if(data[i]===null)continue;if(typeof(data[i])==='object'){var optgroup=$('<optgroup label="'+i+'" />');for(var j in data[i]){optgroup.append('<option value="'+j+'">'+data[i][j]+'</option>')}select.append(optgroup)}else{var option=$('<option value="'+i+'">'+data[i]+'</option>');select.append(option)}}break}if(!control)return;control.data('selectBox-options').remove();var type=control.hasClass('selectBox-dropdown')?'dropdown':'inline',options=getOptions(select,type);control.data('selectBox-options',options);switch(type){case'inline':control.append(options);break;case'dropdown':control.find('.selectBox-label').text($(select).find('OPTION:selected').text()||'\u00A0');$("BODY").append(options);break}};var disableSelection=function(selector){$(selector).css('MozUserSelect','none').bind('selectstart',function(event){event.preventDefault()})};switch(method){case'control':return $(this).data('selectBox-control');break;case'settings':if(!data)return $(this).data('selectBox-settings');$(this).each(function(){$(this).data('selectBox-settings',$.extend(true,$(this).data('selectBox-settings'),data))});break;case'options':$(this).each(function(){setOptions(this,data)});break;case'value':if(!data)return $(this).val();$(this).each(function(){setValue(this,data)});break;case'enable':$(this).each(function(){enable(this)});break;case'disable':$(this).each(function(){disable(this)});break;case'destroy':$(this).each(function(){destroy(this)});break;default:$(this).each(function(){init(this,method)});break}return $(this)}})})(jQuery);

// --------------------------------------------------------------------------------------------------------------------------------------------------------------- //

/*
 * jQuery UI Button 1.8.13
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Button
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 */

(function($,undefined){var lastActive,baseClasses="ui-button ui-widget ui-state-default ui-corner-all",stateClasses="ui-state-hover ui-state-active ",typeClasses="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",formResetHandler=function(event){$(":ui-button",event.target.form).each(function(){var inst=$(this).data("button");setTimeout(function(){inst.refresh()},1)})},radioGroup=function(radio){var name=radio.name,form=radio.form,radios=$([]);if(name){if(form){radios=$(form).find("[name='"+name+"']")}else{radios=$("[name='"+name+"']",radio.ownerDocument).filter(function(){return!this.form})}}return radios};$.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",formResetHandler);if(typeof this.options.disabled!=="boolean"){this.options.disabled=this.element.attr("disabled")}this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var self=this,options=this.options,toggleButton=this.type==="checkbox"||this.type==="radio",hoverClass="ui-state-hover"+(!toggleButton?" ui-state-active":""),focusClass="ui-state-focus";if(options.label===null){options.label=this.buttonElement.html()}if(this.element.is(":disabled")){options.disabled=true}this.buttonElement.addClass(baseClasses).attr("role","button").bind("mouseenter.button",function(){if(options.disabled){return}$(this).addClass("ui-state-hover");if(this===lastActive){$(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){if(options.disabled){return}$(this).removeClass(hoverClass)}).bind("focus.button",function(){$(this).addClass(focusClass)}).bind("blur.button",function(){$(this).removeClass(focusClass)}).bind("click.button",function(event){if(options.disabled){event.stopImmediatePropagation()}});if(toggleButton){this.element.bind("change.button",function(){self.refresh()})}if(this.type==="checkbox"){this.buttonElement.bind("click.button",function(){if(options.disabled){return false}$(this).toggleClass("ui-state-active");self.buttonElement.attr("aria-pressed",self.element[0].checked)})}else if(this.type==="radio"){this.buttonElement.bind("click.button",function(){if(options.disabled){return false}$(this).addClass("ui-state-active");self.buttonElement.attr("aria-pressed",true);var radio=self.element[0];radioGroup(radio).not(radio).map(function(){return $(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed",false)})}else{this.buttonElement.bind("mousedown.button",function(){if(options.disabled){return false}$(this).addClass("ui-state-active");lastActive=this;$(document).one("mouseup",function(){lastActive=null})}).bind("mouseup.button",function(){if(options.disabled){return false}$(this).removeClass("ui-state-active")}).bind("keydown.button",function(event){if(options.disabled){return false}if(event.keyCode==$.ui.keyCode.SPACE||event.keyCode==$.ui.keyCode.ENTER){$(this).addClass("ui-state-active")}}).bind("keyup.button",function(){$(this).removeClass("ui-state-active")});if(this.buttonElement.is("a")){this.buttonElement.keyup(function(event){if(event.keyCode===$.ui.keyCode.SPACE){$(this).click()}})}}this._setOption("disabled",options.disabled)},_determineButtonType:function(){if(this.element.is(":checkbox")){this.type="checkbox"}else if(this.element.is(":radio")){this.type="radio"}else if(this.element.is("input")){this.type="input"}else{this.type="button"}if(this.type==="checkbox"||this.type==="radio"){var ancestor=this.element.parents().filter(":last"),labelSelector="label[for="+this.element.attr("id")+"]";this.buttonElement=ancestor.find(labelSelector);if(!this.buttonElement.length){ancestor=ancestor.length?ancestor.siblings():this.element.siblings();this.buttonElement=ancestor.filter(labelSelector);if(!this.buttonElement.length){this.buttonElement=ancestor.find(labelSelector)}}this.element.addClass("ui-helper-hidden-accessible");var checked=this.element.is(":checked");if(checked){this.buttonElement.addClass("ui-state-active")}this.buttonElement.attr("aria-pressed",checked)}else{this.buttonElement=this.element}},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass(baseClasses+" "+stateClasses+" "+typeClasses).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());if(!this.hasTitle){this.buttonElement.removeAttr("title")}$.Widget.prototype.destroy.call(this)},_setOption:function(key,value){$.Widget.prototype._setOption.apply(this,arguments);if(key==="disabled"){if(value){this.element.attr("disabled",true)}else{this.element.removeAttr("disabled")}}this._resetButton()},refresh:function(){var isDisabled=this.element.is(":disabled");if(isDisabled!==this.options.disabled){this._setOption("disabled",isDisabled)}if(this.type==="radio"){radioGroup(this.element[0]).each(function(){if($(this).is(":checked")){$(this).button("widget").addClass("ui-state-active").attr("aria-pressed",true)}else{$(this).button("widget").removeClass("ui-state-active").attr("aria-pressed",false)}})}else if(this.type==="checkbox"){if(this.element.is(":checked")){this.buttonElement.addClass("ui-state-active").attr("aria-pressed",true)}else{this.buttonElement.removeClass("ui-state-active").attr("aria-pressed",false)}}},_resetButton:function(){if(this.type==="input"){if(this.options.label){this.element.val(this.options.label)}return}var buttonElement=this.buttonElement.removeClass(typeClasses),buttonText=$("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(buttonElement.empty()).text(),icons=this.options.icons,multipleIcons=icons.primary&&icons.secondary,buttonClasses=[];if(icons.primary||icons.secondary){if(this.options.text){buttonClasses.push("ui-button-text-icon"+(multipleIcons?"s":(icons.primary?"-primary":"-secondary")))}if(icons.primary){buttonElement.prepend("<span class='ui-button-icon-primary ui-icon "+icons.primary+"'></span>")}if(icons.secondary){buttonElement.append("<span class='ui-button-icon-secondary ui-icon "+icons.secondary+"'></span>")}if(!this.options.text){buttonClasses.push(multipleIcons?"ui-button-icons-only":"ui-button-icon-only");if(!this.hasTitle){buttonElement.attr("title",buttonText)}}}else{buttonClasses.push("ui-button-text-only")}buttonElement.addClass(buttonClasses.join(" "))}});$.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(key,value){if(key==="disabled"){this.buttons.button("option",key,value)}$.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return $(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").addClass("ui-corner-all-custom").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return $(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");$.Widget.prototype.destroy.call(this)}})}(jQuery));

// --------------------------------------------------------------------------------------------------------------------------------------------------------------- //
/*!
 * jQzoom Evolution Library v2.3  - Javascript Image magnifier
 * http://www.mind-projects.it
 *
 * Copyright 2011, Engineer Marco Renzi
 * Licensed under the BSD license.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of the organization nor the
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * Date: 03 May 2011 22:16:00
 */
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($){9 v=($.1A.2j&&$.1A.2k<7);9 w=$(1B.1C);9 y=$(y);9 z=F;$.3d.13=8(b){G 5.1Y(8(){9 a=5.3e.3f();A(a==\'a\'){Q 13(5,b)}})};13=8(g,h){9 j=2l;j=$(g).1D("13");A(j)G j;9 k=5;9 l=$.1E({},$.13.2m,h||{});k.3g=g;g.1p=$(g).R(\'1p\');g.1F=F;g.3h=F;g.1u=F;g.1h=F;g.1b={};g.2n=2l;g.14={};g.1G=F;$(g).D({\'3i-1i\':\'1v\',\'3j-3k\':\'1v\'});9 m=$("3l:3m(0)",g);g.V=$(g).R(\'V\');g.1Z=m.R(\'V\');9 n=($.1w(g.V).Y>0)?g.V:g.1Z;9 p=Q 2o(m);9 q=Q 2p();9 r=Q 2q();9 s=Q 2r();9 t=Q 2s();$(g).1H(\'2t\',8(e){e.2u();G F});9 u=[\'20\',\'1c\',\'1j\',\'1q\'];A($.3n($.1w(l.H),u)<0){l.H=\'20\'}$.1E(k,{21:8(){A($(".L",g).Y==0){g.L=$(\'<Z/>\').1I(\'L\');m.3o(g.L)}A(l.H==\'1j\'){l.15=p.w;l.16=p.h}A($(".22",g).Y==0){q.S()}A($(".23",g).Y==0){r.S()}A($(".2v",g).Y==0){t.S()}A(l.24||l.H==\'1c\'||l.1J){k.1K()}k.2w()},2w:8(){A(l.H==\'1c\'){$(".L",g).3p(8(){g.1G=17});$(".L",g).3q(8(){g.1G=F});1B.1C.3r=8(){G F};$(".L",g).D({1L:\'1r\'});$(".22",g).D({1L:\'3s\'})}A(l.H==\'1j\'){$(".1M",g).D({1L:\'3t\'})}$(".L",g).1H(\'3u 3v\',8(a){m.R(\'V\',\'\');$(g).R(\'V\',\'\');g.1F=17;p.1s();A(g.1h){k.25(a)}1k{k.1K()}});$(".L",g).1H(\'3w\',8(a){k.2x()});$(".L",g).1H(\'3x\',8(e){A(e.26>p.E.r||e.26<p.E.l||e.27<p.E.t||e.27>p.E.b){q.1N();G F}g.1F=17;A(g.1h&&!$(\'.23\',g).3y(\':2y\')){k.25(e)}A(g.1h&&(l.H!=\'1c\'||(l.H==\'1c\'&&g.1G))){q.1l(e)}});9 c=Q 2z();9 i=0;9 d=Q 2z();d=$(\'a\').3z(8(){9 a=Q 3A("3B[\\\\s]*:[\\\\s]*\'"+$.1w(g.1p)+"\'","i");9 b=$(5).R(\'1p\');A(a.3C(b)){G 5}});A(d.Y>0){9 f=d.3D(0,1);d.3E(f)}d.1Y(8(){A(l.24){9 a=$.1E({},1O("("+$.1w($(5).R(\'1p\'))+")"));c[i]=Q 28();c[i].1d=a.1x;i++}$(5).2t(8(e){A($(5).3F(\'29\')){G F}d.1Y(8(){$(5).3G(\'29\')});e.2u();k.2A(5);G F})})},1K:8(){A(g.1h==F&&g.1u==F){9 a=$(g).R(\'2B\');g.1u=17;s.2C(a)}},25:8(e){3H(g.2n);q.T();r.T()},2x:8(e){1P(l.H){1t\'1c\':W;1r:m.R(\'V\',g.1Z);$(g).R(\'V\',g.V);A(l.1J){q.1N()}1k{r.O();q.O()}W}g.1F=F},2A:8(a){g.1u=F;g.1h=F;9 b=Q 3I();b=$.1E({},1O("("+$.1w($(a).R(\'1p\'))+")"));A(b.1Q&&b.1x){9 c=b.1Q;9 d=b.1x;$(a).1I(\'29\');$(g).R(\'2B\',d);m.R(\'1d\',c);q.O();r.O();k.1K()}1k{2a(\'2D :: 2E 2F 1R 1x 2G 1Q.\');2b\'2D :: 2E 2F 1R 1x 2G 1Q.\';}G F}});A(m[0].3J){p.1s();A($(".L",g).Y==0)k.21()}8 2o(c){9 d=5;5.6=c[0];5.2H=8(){9 a=0;a=c.D(\'2c-B-P\');M=\'\';9 b=0;b=c.D(\'2c-C-P\');K=\'\';A(a){1R(i=0;i<3;i++){9 x=[];x=a.1S(i,1);A(2I(x)==F){M=M+\'\'+a.1S(i,1)}1k{W}}}A(b){1R(i=0;i<3;i++){A(!2I(b.1S(i,1))){K=K+b.1S(i,1)}1k{W}}}d.M=(M.Y>0)?1O(M):0;d.K=(K.Y>0)?1O(K):0};5.1s=8(){d.2H();d.w=c.P();d.h=c.12();d.1m=c.3K();d.1e=c.3L();d.E=c.1f();d.E.l=c.1f().C+d.K;d.E.t=c.1f().B+d.M;d.E.r=d.w+d.E.l;d.E.b=d.h+d.E.t;d.2J=c.1f().C+d.1m;d.3M=c.1f().B+d.1e};5.6.2K=8(){2a(\'1T 1U 1V X.\');2b\'1T 1U 1V X.\';};5.6.2L=8(){d.1s();A($(".L",g).Y==0)k.21()};G d};8 2s(){9 a=5;5.S=8(){5.6=$(\'<Z/>\').1I(\'2v\').D(\'2d\',\'2M\').2N(l.2O);$(\'.L\',g).S(5.6)};5.T=8(){5.6.B=(p.1e-5.6.12())/2;5.6.C=(p.1m-5.6.P())/2;5.6.D({B:5.6.B,C:5.6.C,11:\'18\',2d:\'2y\'})};5.O=8(){5.6.D(\'2d\',\'2M\')};G 5}8 2p(){9 d=5;5.6=$(\'<Z/>\').1I(\'22\');5.S=8(){$(\'.L\',g).S($(5.6).O());A(l.H==\'1q\'){5.X=Q 28();5.X.1d=p.6.1d;$(5.6).2e().S(5.X)}};5.2P=8(){5.6.w=(1W((l.15)/g.1b.x)>p.w)?p.w:(1W(l.15/g.1b.x));5.6.h=(1W((l.16)/g.1b.y)>p.h)?p.h:(1W(l.16/g.1b.y));5.6.B=(p.1e-5.6.h-2)/2;5.6.C=(p.1m-5.6.w-2)/2;5.6.D({B:0,C:0,P:5.6.w+\'I\',12:5.6.h+\'I\',11:\'18\',1g:\'1v\',2f:1+\'I\'});A(l.H==\'1q\'){5.X.1d=p.6.1d;$(5.6).D({\'2g\':1});$(5.X).D({11:\'18\',1g:\'1y\',C:-(5.6.C+1-p.K)+\'I\',B:-(5.6.B+1-p.M)+\'I\'})}};5.1N=8(){5.6.B=(p.1e-5.6.h-2)/2;5.6.C=(p.1m-5.6.w-2)/2;5.6.D({B:5.6.B,C:5.6.C});A(l.H==\'1q\'){$(5.X).D({11:\'18\',1g:\'1y\',C:-(5.6.C+1-p.K)+\'I\',B:-(5.6.B+1-p.M)+\'I\'})}s.1l()};5.1l=8(e){g.14.x=e.26;g.14.y=e.27;9 b=0;9 c=0;8 2Q(a){G g.14.x-(a.w)/2<p.E.l}8 2R(a){G g.14.x+(a.w)/2>p.E.r}8 2S(a){G g.14.y-(a.h)/2<p.E.t}8 2T(a){G g.14.y+(a.h)/2>p.E.b}b=g.14.x+p.K-p.E.l-(5.6.w+2)/2;c=g.14.y+p.M-p.E.t-(5.6.h+2)/2;A(2Q(5.6)){b=p.K-1}1k A(2R(5.6)){b=p.w+p.K-5.6.w-1}A(2S(5.6)){c=p.M-1}1k A(2T(5.6)){c=p.h+p.M-5.6.h-1}5.6.C=b;5.6.B=c;5.6.D({\'C\':b+\'I\',\'B\':c+\'I\'});A(l.H==\'1q\'){A($.1A.2j&&$.1A.2k>7){$(5.6).2e().S(5.X)}$(5.X).D({11:\'18\',1g:\'1y\',C:-(5.6.C+1-p.K)+\'I\',B:-(5.6.B+1-p.M)+\'I\'})}s.1l()};5.O=8(){m.D({\'2g\':1});5.6.O()};5.T=8(){A(l.H!=\'1j\'&&(l.2U||l.H==\'1c\')){5.6.T()}A(l.H==\'1q\'){m.D({\'2g\':l.2V})}};5.2h=8(){9 o={};o.C=d.6.C;o.B=d.6.B;G o};G 5};8 2q(){9 b=5;5.6=$("<Z 1z=\'23\'><Z 1z=\'1M\'><Z 1z=\'1X\'></Z><Z 1z=\'2i\'></Z></Z></Z>");5.U=$(\'<2W 1z="3N" 1d="3O:\\\'\\\';" 3P="0" 3Q="0" 3R="2X" 3S="3T" 3U="0" ></2W>\');5.1l=8(){5.6.1n=0;5.6.1o=0;A(l.H!=\'1j\'){1P(l.11){1t"C":5.6.1n=(p.E.l-p.K-J.N(l.19)-l.15>0)?(0-l.15-J.N(l.19)):(p.1m+J.N(l.19));5.6.1o=J.N(l.1a);W;1t"B":5.6.1n=J.N(l.19);5.6.1o=(p.E.t-p.M-J.N(l.1a)-l.16>0)?(0-l.16-J.N(l.1a)):(p.1e+J.N(l.1a));W;1t"2X":5.6.1n=J.N(l.19);5.6.1o=(p.E.t-p.M+p.1e+J.N(l.1a)+l.16<2Y.12)?(p.1e+J.N(l.1a)):(0-l.16-J.N(l.1a));W;1r:5.6.1n=(p.2J+J.N(l.19)+l.15<2Y.P)?(p.1m+J.N(l.19)):(0-l.15-J.N(l.19));5.6.1o=J.N(l.1a);W}}5.6.D({\'C\':5.6.1n+\'I\',\'B\':5.6.1o+\'I\'});G 5};5.S=8(){$(\'.L\',g).S(5.6);5.6.D({11:\'18\',1g:\'1v\',2Z:3V});A(l.H==\'1j\'){5.6.D({1L:\'1r\'});9 a=(p.K==0)?1:p.K;$(\'.1M\',5.6).D({2f:a+\'I\'})}$(\'.1M\',5.6).D({P:J.30(l.15)+\'I\',2f:a+\'I\'});$(\'.2i\',5.6).D({P:\'31%\',12:J.30(l.16)+\'I\'});$(\'.1X\',5.6).D({P:\'31%\',11:\'18\'});$(\'.1X\',5.6).O();A(l.V&&n.Y>0){$(\'.1X\',5.6).2N(n).T()}b.1l()};5.O=8(){1P(l.32){1t\'3W\':5.6.3X(l.33,8(){});W;1r:5.6.O();W}5.U.O()};5.T=8(){1P(l.34){1t\'3Y\':5.6.35();5.6.35(l.36,8(){});W;1r:5.6.T();W}A(v&&l.H!=\'1j\'){5.U.P=5.6.P();5.U.12=5.6.12();5.U.C=5.6.1n;5.U.B=5.6.1o;5.U.D({1g:\'1y\',11:"18",C:5.U.C,B:5.U.B,2Z:3Z,P:5.U.P+\'I\',12:5.U.12+\'I\'});$(\'.L\',g).S(5.U);5.U.T()}}};8 2r(){9 c=5;5.6=Q 28();5.2C=8(a){t.T();5.40=a;5.6.1i.11=\'18\';5.6.1i.2c=\'37\';5.6.1i.1g=\'1v\';5.6.1i.C=\'-41\';5.6.1i.B=\'37\';1B.1C.42(5.6);5.6.1d=a};5.1s=8(){9 a=$(5.6);9 b={};5.6.1i.1g=\'1y\';c.w=a.P();c.h=a.12();c.E=a.1f();c.E.l=a.1f().C;c.E.t=a.1f().B;c.E.r=c.w+c.E.l;c.E.b=c.h+c.E.t;b.x=(c.w/p.w);b.y=(c.h/p.h);g.1b=b;1B.1C.43(5.6);$(\'.2i\',g).2e().S(5.6);q.2P()};5.6.2K=8(){2a(\'1T 1U 1V 38 39 X.\');2b\'1T 1U 1V 38 39 X.\';};5.6.2L=8(){c.1s();t.O();g.1u=F;g.1h=17;A(l.H==\'1c\'||l.1J){q.T();r.T();q.1N()}};5.1l=8(){9 a=-g.1b.x*(q.2h().C-p.K+1);9 b=-g.1b.y*(q.2h().B-p.M+1);$(5.6).D({\'C\':a+\'I\',\'B\':b+\'I\'})};G 5};$(g).1D("13",k)};$.13={2m:{H:\'20\',15:3a,16:3a,19:10,1a:0,11:"44",24:17,2O:\'45 46\',V:17,2U:17,2V:0.4,1J:F,34:\'T\',32:\'O\',36:\'47\',33:\'48\'},3b:8(a){9 b=$(a).1D(\'13\');b.3b();G F},3c:8(a){9 b=$(a).1D(\'13\');b.3c();G F},49:8(a){z=17},4a:8(a){z=F}}})(4b);',62,260,'|||||this|node||function|var|||||||||||||||||||||||||||if|top|left|css|pos|false|return|zoomType|px|Math|bleft|zoomPad|btop|abs|hide|width|new|attr|append|show|ieframe|title|break|image|length|div||position|height|jqzoom|mousepos|zoomWidth|zoomHeight|true|absolute|xOffset|yOffset|scale|drag|src|oh|offset|display|largeimageloaded|style|innerzoom|else|setposition|ow|leftpos|toppos|rel|reverse|default|fetchdata|case|largeimageloading|none|trim|largeimage|block|class|browser|document|body|data|extend|zoom_active|mouseDown|bind|addClass|alwaysOn|load|cursor|zoomWrapper|setcenter|eval|switch|smallimage|for|substr|Problems|while|loading|parseInt|zoomWrapperTitle|each|imagetitle|standard|create|zoomPup|zoomWindow|preloadImages|activate|pageX|pageY|Image|zoomThumbActive|alert|throw|border|visibility|empty|borderWidth|opacity|getoffset|zoomWrapperImage|msie|version|null|defaults|timer|Smallimage|Lens|Stage|Largeimage|Loader|click|preventDefault|zoomPreload|init|deactivate|visible|Array|swapimage|href|loadimage|ERROR|Missing|parameter|or|findborder|isNaN|rightlimit|onerror|onload|hidden|html|preloadText|setdimensions|overleft|overright|overtop|overbottom|lens|imageOpacity|iframe|bottom|screen|zIndex|round|100|hideEffect|fadeoutSpeed|showEffect|fadeIn|fadeinSpeed|0px|the|big|300|disable|enable|fn|nodeName|toLowerCase|el|zoom_disabled|outline|text|decoration|img|eq|inArray|wrap|mousedown|mouseup|ondragstart|move|crosshair|mouseenter|mouseover|mouseleave|mousemove|is|filter|RegExp|gallery|test|splice|push|hasClass|removeClass|clearTimeout|Object|complete|outerWidth|outerHeight|bottomlimit|zoomIframe|javascript|marginwidth|marginheight|align|scrolling|no|frameborder|5001|fadeout|fadeOut|fadein|99|url|5000px|appendChild|removeChild|right|Loading|zoom|slow|2000|disableAll|enableAll|jQuery'.split('|'),0,{}))

// --------------------------------------------------------------------------------------------------------------------------------------------------------------- //
/*
 * jQuery validation plug-in 1.7
 *
 * http://bassistance.de/jquery-plugins/jquery-plugin-validation/
 * http://docs.jquery.com/Plugins/Validation
 *
 * Copyright (c) 2006 - 2008 Jörn Zaefferer
 *
 * $Id: jquery.validate.js 6403 2009-06-17 14:27: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
 */
(function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}var validator=$.data(this[0],'validator');if(validator){return validator;}validator=new $.validator(options,this[0]);$.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true;});if(validator.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){validator.submitButton=this;});}this.submit(function(event){if(validator.settings.debug)event.preventDefault();function handle(){if(validator.settings.submitHandler){if(validator.submitButton){var hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm);}validator.settings.submitHandler.call(validator,validator.currentForm);if(validator.submitButton){hidden.remove();}return false;}return true;}if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}return handle();}else{validator.focusInvalid();return false;}});}return validator;},valid:function(){if($(this[0]).is('form')){return this.validate().form();}else{var valid=true;var validator=$(this[0].form).validate();this.each(function(){valid&=validator.element(this);});return valid;}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value);});return result;},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,'validator').settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;if(argument.messages)settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}}var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data);}return data;}});$.extend($.expr[":"],{blank:function(a){return!$.trim(""+a.value);},filled:function(a){return!!$.trim(""+a.value);},unchecked:function(a){return!a.checked;}});$.validator=function(options,form){this.settings=$.extend(true,{},$.validator.defaults,options);this.currentForm=form;this.init();};$.validator.format=function(source,params){if(arguments.length==1)return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args);};if(arguments.length>2&&params.constructor!=Array){params=$.makeArray(arguments).slice(1);}if(params.constructor!=Array){params=[params];}$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n);});return source;};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);this.errorsFor(element).hide();}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted)this.element(element);else if(element.parentNode.name in this.submitted)this.element(element.parentNode);},highlight:function(element,errorClass,validClass){$(element).addClass(errorClass).removeClass(validClass);},unhighlight:function(element,errorClass,validClass){$(element).removeClass(errorClass).addClass(validClass);}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key;});});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var validator=$.data(this[0].form,"validator"),eventType="on"+event.type.replace(/^validate/,"");validator.settings[eventType]&&validator.settings[eventType].call(validator,this[0]);}$(this.currentForm).validateDelegate(":text, :password, :file, select, textarea","focusin focusout keyup",delegate).validateDelegate(":radio, :checkbox, select, option","click",delegate);if(this.settings.invalidHandler)$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid())$(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);}return this.valid();},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name];}else{this.invalid[element.name]=true;}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);}this.showErrors();return result;},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});}this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if($.fn.resetForm)$(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0;for(var i in obj)count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin");}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules()))return false;rulesCache[this.name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0];}var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,element.value.replace(/\r/g,""),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue;}dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id
+", check the '"+rule.method+"' method",e);throw e;}}if(dependencyMismatch)return;if(this.objectLength(rules))this.successList.push(element);return true;},customMetaMessage:function(element,method){if(!$.metadata)return;var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method];},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method]);},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined)return arguments[i];}return undefined;},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customMetaMessage(element,method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g;if(typeof message=="function"){message=message.call(this,rule.parameters,element);}else if(theregex.test(message)){message=jQuery.format(message.replace(theregex,'{$1}'),rule.parameters);}this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper)toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));return toToggle;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);this.showLabel(error.element,error.message);}if(this.errorList.length){this.toShow=this.toShow.add(this.containers);}if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message);}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();}if(!this.labelContainer.append(label).length)this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element);}if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label);}this.toShow=this.toShow.add(label);},errorsFor:function(element){var name=this.idOrName(element);return this.errors().filter(function(){return $(this).attr('for')==name;});},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},checkable:function(element){return/radio|checkbox/i.test(element.type);},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null;});},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return $("option:selected",element).length;case'input':if(this.checkable(element))return this.findByName(element.name).filter(':checked').length;}return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param,element){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();this.formSubmitted=false;}else if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false;}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className);},classRules:function(element){var rules={};var classes=$(element).attr('class');classes&&$.each(classes.split(' '),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});return rules;},attributeRules:function(element){var rules={};var $element=$(element);for(method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value;}}if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;}return rules;},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,'validator').settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata();},staticRules:function(element){var rules={};var validator=$.data(element.form,'validator');if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};}return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter;});$.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}if(rules.messages){delete rules.messages;}return rules;},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message!=undefined?message:$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element))return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var val=$(element).val();return val&&val.length>0;case'input':if(this.checkable(element))return this.getLength(value,element)>0;default:return $.trim(value).length>0;}},remote:function(value,element,param){if(this.optional(element))return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name])this.settings.messages[element.name]={};previous.originalMessage=this.settings.messages[element.name].remote;this.settings.messages[element.name].remote=previous.message;param=typeof param=="string"&&{url:param}||param;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){validator.settings.messages[element.name].remote=previous.originalMessage;var valid=response===true;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}else{var errors={};var message=(previous.message=response||validator.defaultMessage(element,"remote"));errors[element.name]=$.isFunction(message)?message(value):message;validator.showErrors(errors);}previous.valid=valid;validator.stopRequest(element,valid);}},param));return"pending";}else if(this.pending[element.name]){return"pending";}return previous.valid;},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param;},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param;},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value));},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element))return"dependency-mismatch";if(/[^0-9-]+/.test(value))return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(var n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9)nDigit-=9;}nCheck+=nDigit;bEven=!bEven;}return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param=="string"?param.replace(/,/g,'|'):"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,param){var target=$(param).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){$(element).valid();});return value==target.val();}}});$.format=$.validator.format;})(jQuery);;(function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){settings=$.extend(settings,$.extend({},$.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}return(pendingRequests[port]=ajax.apply(this,arguments));}return ajax.apply(this,arguments);};})(jQuery);;(function($){if(!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){this.addEventListener(original,handler,true);},teardown:function(){this.removeEventListener(original,handler,true);},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments);}};function handler(e){e=$.event.fix(e);e.type=fix;return $.event.handle.call(this,e);}});};$.extend($.fn,{validateDelegate:function(delegate,type,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});}});})(jQuery);

// --------------------------------------------------------------------------------------------------------------------------------------------------------------- //

