var loading = '<img src="/wp-content/themes/menachem/images/style/ajaxloader.gif" alt="loading" width="16" height="16" />';
var startoffset = $('#navwrap').offset();

$(document).ready(function() {

	//===================================//
	//============= Nav ============//
	//===================================//	
	$("#nav li").hover(function() {
    		$(this).addClass('sfhover');
		}, function() {
    		$(this).removeClass('sfhover');
    });


	
	//===================================//
	//============= Tooltips ============//
	//===================================//
	$(".coverlink").screenshotPreview();

	  
	//===================================//
	//========== Music player ===========//
	//===================================//
	var inlinePlayer = null;
	soundManager.debugMode = false; // disable or enable debug output
	soundManager.url = '/wp-content/themes/menachem/flash'; // path to directory containing SM2 SWF
	soundManager.onready(function() {
		if (soundManager.supported()) {
		  // soundManager.createSound() etc. may now be called
		  inlinePlayer = new InlinePlayer();
		}
	});


	//===================================//
	//============ Ajax Tour ============//
	//===================================//
	$('.viewconcert').click(function(){
		$('#datedetail').html(loading);
		var concertid = $(this).attr('href').split('#')[1];
		$.get('/tour',{concert:concertid},function(data){
			$('#datedetail').html('<div class="span-17 last regrow">'+data+'</div>');
			$("#booking_form").bind('submit',function(){
				submitbooking($(this));
				return false;
			});			
		});		
		return false;
	})
	

	//===================================//
	//=========== Contact Form ==========//
	//===================================//
	$("#ctc_form").submit(function(){
		$('#formfeedback').html("").removeClass('valid').removeClass('invalid');
		var thisform = $(this);
		if(validate($(thisform))){
			//alert('submit');
			$(thisform).ajaxSubmit(function(data){   				
   				$(thisform).clearForm();
   				$('#formfeedback').addClass('valid').html(data);
   			});			
		} else {
			//alert('not  valid');
		}
		return false;
	});
	function validate(form){
		var ck_name = /^[A-Za-z0-9 ]{3,20}$/;
		var ck_email = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
		var name = $('#'+form.attr("id")+' input[name=ctc_name]').val();
		var email = $('#'+form.attr("id")+' input[name=ctc_mail]').val();
		var msg = $('#'+form.attr("id")+' textarea[name=ctc_message]').val();
		var errors = [];
		if (!ck_name.test(name)) { errors[errors.length] = "Please enter your name."; }
		if (!ck_email.test(email)) { errors[errors.length] = "Please provide a valid email address."; }
		if (msg.length < 1){ errors[errors.length] = "Please leave us a short message."; }
		if (errors.length > 0) {
			reportErrors(errors);
			return false;
		}
		return true;
	}
	function reportErrors(errors){
		 var msg="";
		 //msg = "Please Enter Valide Data...\n";
		 for (var i = 0; i<errors.length; i++) {
		 var numError = i + 1;
		  msg += "\n"+ numError + ". " + errors[i]+"<br />";
		}
		 $('#formfeedback').addClass('invalid').html(msg+"<br />");
	}
	jQuery.fn.clearForm = function() {
	  return this.each(function() {
	 var type = this.type, tag = this.tagName.toLowerCase();
	 if (tag == 'form')
	   return jQuery(':input',this).clearForm();
	 if (type == 'text' || type == 'password' || tag == 'textarea')
	   this.value = '';
	 else if (type == 'checkbox' || type == 'radio')
	   this.checked = false;
	 else if (tag == 'select')
	   this.selectedIndex = -1;
	  });
	};


	//===================================//
	//Booking Form
	//===================================//
	var hash_ = location.hash.split("-");
	var promo = hash_[2];
	if(promo!=undefined){
		//alert(promo);
		$("input[name=promocode]").val(promo).parent().hide();
		
	}	
	$("#booking_form").submit(function(){
		submitbooking($(this));
		return false;
	});
	

	//===================================//
	//========== Shopping Cart ==========//
	//===================================//
	$("#opener").click(function(e){
		e.preventDefault();
		if($("#contents ul").children().length > 0){
			$("#contents").slideToggle(function(){
				if($("#contents").is(":visible")){
					$("#opener").removeClass("ui-icon-circle-arrow-s").addClass("ui-icon-circle-arrow-l");
				} else {
					$("#opener").removeClass("ui-icon-circle-arrow-l").addClass("ui-icon-circle-arrow-s");
				}
			});
		}
	});
	$(".cartclear").live("click",function(e){
		e.preventDefault();
		var qty = $(this).parent().find(".qty"),
		span = $(this).parent().find("span"),
		singleAmount = parseFloat(span.text().substr(1)) / parseInt(qty.text()),
		newTotal = parseFloat(span.text().substr(1)) - singleAmount,
		roundTotal = Math.round(newTotal * 100) / 100;
		if(parseInt(qty.text()) > 1){
			qty.text(parseInt(qty.text()) - 1);
			span.html("&pound;" + roundTotal);
			$(this).parent().find("input").eq(1).val(parseInt($(this).parent().find("input").eq(1).val()) - 1);
		} else {
			$(this).parent().remove();
			if($("#contents ul").children().length ===0){
				$("#opener").removeClass("ui-icon-circle-arrow-l").addClass("ui-icon-circle-arrow-s").closest("#cartHeader").next().hide();
			}
		}
		$("#items").text(parseInt($("#items").text()) -1);
		var newCost = parseFloat($("#cost span").text().substr(1)) - singleAmount,
		roundCost = Math.round(newCost * 100) / 100;
		$("#cost span").html("&pound;" + roundCost);
		saveState();
	});
	$("#clearAll").click(function(e){
		e.preventDefault();
		$("#contents li").remove();
		$("#cartHeader p #items").html('0');
		$("#cost span").html("&pound;0.00");
		$("#opener").removeClass("ui-icon-circle-arrow-l").addClass("ui-icon-circle-arrow-s").closest("#cartHeader").next().hide();
		saveState("empty");
	});
	$(".addtocart").live("click",function(e){
		e.preventDefault();
		var key = base64_decode($(this).attr("href").substr(1)).split("#");
		//alert(print_r(key,true));		
		var id = key[0],
		price = key[1],
		productName = key[2],
		qty = 1,
		type=id.substr(0,1);
		itemFactory(id, productName, qty, price, type);
		saveState();
		var targetOffset = $("#cart").offset().top;
		$('html,body').animate({scrollTop: targetOffset}, 1000, function(){
			$("#contents").slideDown();
			$("#opener").removeClass("ui-icon-circle-arrow-s").addClass("ui-icon-circle-arrow-l");
			headerScrolling();
		});		
	});
	$("input[name=shipping]").change(function(){
		var newS = $(this).val();
		var oldS = $("#checkoutshipping").val();
		var oldT = $("#checkouttotal").text();
		var newT = parseFloat( parseFloat(oldT - oldS) + parseFloat(newS) );
		$("#checkouttotal").text(newT);
		$("#checkouttotal_").val(newT);
		$("#checkoutshipping").val(newS);
	});
	if($("#paypal_checkout").length > 0){ $("#paypal_checkout").submit(); }
	
	//if cookie exists build cart
	if($.cookie("cart")){
		var cookieArray = $.cookie("cart").split("&"), total = 0, cost = 0;
		
		$.each(cookieArray, function(i, val) {
			var itemArray = val.split("=");
			
			//add new items
			//alert(print_r(itemArray,true));
			itemFactory(itemArray[0], itemArray[1], itemArray[2], itemArray[3], itemArray[0].substr(0,1)); 
			
			total += parseInt(itemArray[2]);
			cost += parseFloat(itemArray[3]);
		});
		
		//update cart total items
		(total === 1) ? 
			$("#cartHeader p").html('Cart: <span id="items">1</span> item') :
			$("#cartHeader p").html('Cart: <span id="items">' + total + '</span> items');		
		
		//update cart total price
		$("#cost span").html("&pound;" + cost);
	}
	
	//save cart state
	function saveState(isEmpty) {
				
		//check whether empty
		if(isEmpty == "empty") {
			
			//delete cookie
			$.cookie("cart", null, { path: "/", expires: "" });
		} else {
			var state = "";
			
			//make serialized string of cart items
			$("#contents li").each(function(i){
				state += $(this).data("id") + "=" + $(this).find("p").eq(1).text() + "=" + $(this).find(".qty").text() + "=" + $(this).find("span").text().substr(1);
				if(i < $("#contents li").length - 1){
					state += "&";
				}
			});
			
			//write cookie
			$.cookie("cart", state, { path: "/", expires: "" });
		}	
	}
	
	$('li.page-item-9 a').not('ul.children li a').click(function(){ return false; });
	$('li.page-item-53 a').not('ul.children li a').click(function(){ return false; });
	
	$('#blogrollwrap p').css("background","transparent");
	
});


//============================================================================================================================//



//===================================//
//======== Header Scrolling =========//
//===================================//	
function headerScrolling(){	
	if($(this).scrollTop() > startoffset.top){
		var bottomval = $(this).scrollTop() - startoffset.top + 20 +"px";
		$('#navwrap').css('bottom', '-'+bottomval);
		//$('#navwrap').fadeTo("fast",0.50);
	} else {
		$('#navwrap').css('bottom', "-20px");
		//$('#navwrap').fadeTo("fast",1);
	}	
}


//===================================//
//Booking Form
//===================================//
function submitbooking(thisform){
	$('#formfeedback').html("").removeClass('valid').removeClass('invalid');
	var total=0;
	$(".itemqty").each(function(){
		total+=Number($(this).val());
	});
	if(total>0){
		$(thisform).ajaxSubmit(function(data){   				
			$(thisform).clearForm();
			$('#itemchoices').addClass('valid').html('');
			$(thisform).after(data);
			$("#paypal_checkout").bind('submit',function(){					
				$("#paypal_checkout").append(loading);
			});   				
		});	
	} else {
		//alert('not  valid');
	}		
}

//===================================//
//Shopping Cart
//===================================//
function itemFactory(id, productName, qty, uprice, type){
	
	//Append Product
	var product = $("<li>").data("id",id).attr("id",id),
	quantity = $("<p>").addClass("qty").text(qty).appendTo(product),
	title = $("<p>").text(productName).appendTo(product),
	price = $("<span>").html("&pound;"+uprice).appendTo(product),
	clear = $("<a>").attr({href:"#",title:"delete"}).text("x").addClass("cartclear").insertBefore(price),
	input = $("<input>").attr({type: "hidden", name: "productId[]"}).val(id).appendTo(product);
	input = $("<input>").attr({type: "hidden", name: "produtQty[]"}).val(qty).appendTo(product);
	input = $("<input>").attr({type: "hidden", name: "produtName[]"}).val(productName).appendTo(product);
	input = $("<input>").attr({type: "hidden", name: "produtPrice[]"}).val(uprice).appendTo(product);
	var thisli = $("li#"+id);
	exists = $(thisli).length,
	recalc = 1;
	
	if(type=='d'){ if(exists==0){ product.appendTo("#contents ul"); } else { recalc=0; } }
	else { 
		if(exists==0){ product.appendTo("#contents ul"); }
		else { 
			var newTotal = parseFloat($(thisli).find('span').text().substr(1)) + parseFloat(uprice);
			var roundTotal = Math.round(newTotal*100)/100;
			$(thisli).find(".qty").text( parseInt( parseInt($(thisli).text()) + parseInt(1) ) );
			$(thisli).find("input").eq(1).val( parseInt( parseInt($(thisli).find("input").eq(1).val()) + parseInt(1) ) );
			$(thisli).find("span").html("&pound;"+roundTotal);
			append=0;
		}
	}
	
	//Recalc Prices
	if(recalc==1){
	var currentCost = parseFloat($("#cost span").text().substr(1)),
	newCost = parseFloat(parseFloat(currentCost)+parseFloat(uprice)),
	roundCost = Math.round(newCost * 100) / 100;
	$("#items").text(parseInt($("#items").text())+1);	
	$("#cost span").html("&pound;" + roundCost);
	}
}

//===================================//
//============ Tooltip ==============//
//===================================//
jQuery.fn.screenshotPreview = function(){	
	/* CONFIG */
		xOffset = 10;
		yOffset = 20;

	/* END CONFIG */
	jQuery(this).hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "" + this.t : "";
		jQuery("body").append("<p id='screenshot'>"+ c +"</p>");								 
		jQuery("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		jQuery("#screenshot").remove();
    });	
	jQuery(this).mousemove(function(e){
		jQuery("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

//===================================//
//========= SoundManager 2 ==========//
//===================================//
var soundManager=null;function SoundManager(c,e){this.flashVersion=8;this.debugMode=false;this.debugFlash=false;this.useConsole=true;this.consoleOnly=false;this.waitForWindowLoad=false;this.nullURL="null.mp3";this.allowPolling=true;this.useFastPolling=false;this.useMovieStar=false;this.bgColor="#ffffff";this.useHighPerformance=false;this.flashLoadTimeout=1000;this.wmode=null;this.allowFullScreen=true;this.allowScriptAccess="always";this.defaultOptions={autoLoad:false,stream:true,autoPlay:false,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5000,onbeforefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:200,multiShot:true,multiShotEvents:false,position:null,pan:0,volume:100};this.flash9Options={isMovieStar:null,usePeakData:false,useWaveformData:false,useEQData:false,onbufferchange:null,ondataerror:null};this.movieStarOptions={onmetadata:null,useVideo:false,bufferTime:null};var d=null;var i=this;var h="soundManager";this.version=null;this.versionNumber="V2.95b.20100101";this.movieURL=null;this.url=null;this.altURL=null;this.swfLoaded=false;this.enabled=false;this.o=null;this.id=(e||"sm2movie");this.oMC=null;this.sounds={};this.soundIDs=[];this.muted=false;this.isFullScreen=false;this.isIE=(navigator.userAgent.match(/MSIE/i));this.isSafari=(navigator.userAgent.match(/safari/i));this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.specialWmodeCase=false;this._onready=[];this._debugOpen=true;this._didAppend=false;this._appendSuccess=false;this._didInit=false;this._disabled=false;this._windowLoaded=false;this._hasConsole=(typeof console!="undefined"&&typeof console.log!="undefined");this._debugLevels=["log","info","warn","error"];this._defaultFlashVersion=8;this._oRemoved=null;this._oRemovedHTML=null;var f=function(j){return document.getElementById(j)};this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.netStreamTypes=["aac","flv","mov","mp4","m4v","f4v","m4a","mp4v","3gp","3g2"];this.netStreamPattern=new RegExp("\\.("+this.netStreamTypes.join("|")+")(\\?.*)?$","i");this.filePattern=null;this.features={buffering:false,peakData:false,waveformData:false,eqData:false,movieStar:false};this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local+internet access)"},description:null,noRemote:null,noLocal:null};this._setVersionInfo=function(){if(i.flashVersion!=8&&i.flashVersion!=9){alert(i._str("badFV",i.flashVersion,i._defaultFlashVersion));i.flashVersion=i._defaultFlashVersion}i.version=i.versionNumber+(i.flashVersion==9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(i.flashVersion>8){i.defaultOptions=i._mergeObjects(i.defaultOptions,i.flash9Options);i.features.buffering=true}if(i.flashVersion>8&&i.useMovieStar){i.defaultOptions=i._mergeObjects(i.defaultOptions,i.movieStarOptions);i.filePatterns.flash9=new RegExp("\\.(mp3|"+i.netStreamTypes.join("|")+")(\\?.*)?$","i");i.features.movieStar=true}else{i.useMovieStar=false;i.features.movieStar=false}i.filePattern=i.filePatterns[(i.flashVersion!=8?"flash9":"flash8")];i.movieURL=(i.flashVersion==8?"soundmanager2.swf":"soundmanager2_flash9.swf");i.features.peakData=i.features.waveformData=i.features.eqData=(i.flashVersion>8)};this._overHTTP=(document.location?document.location.protocol.match(/http/i):null);this._waitingforEI=false;this._initPending=false;this._tryInitOnFocus=(this.isSafari&&typeof document.hasFocus=="undefined");this._isFocused=(typeof document.hasFocus!="undefined"?document.hasFocus():null);this._okToDisable=!this._tryInitOnFocus;this.useAltURL=!this._overHTTP;var a="";this.strings={};var b="";this._str=function(){var p=Array.prototype.slice.call(arguments);var n=p.shift();var m=i.strings&&i.strings[n]?i.strings[n]:"";if(m&&p&&p.length){for(var l=0,k=p.length;l<k;l++){m=m.replace("%s",p[l])}}return m};this.supported=function(){return(i._didInit&&!i._disabled)};this.getMovie=function(j){return i.isIE?window[j]:(i.isSafari?f(j)||document[j]:f(j))};this.loadFromXML=function(j){try{i.o._loadFromXML(j)}catch(k){i._failSafely();return true}};this.createSound=function(k){var m="soundManager.createSound(): ";if(!i._didInit){throw i._complain(m+i._str("notReady"),arguments.callee.caller)}if(arguments.length==2){k={id:arguments[0],url:arguments[1]}}var l=i._mergeObjects(k);var j=l;if(j.id.toString().charAt(0).match(/^[0-9]$/)){}if(i._idCheck(j.id,true)){return i.sounds[j.id]}if(i.flashVersion>8&&i.useMovieStar){if(j.isMovieStar===null){j.isMovieStar=(j.url.match(i.netStreamPattern)?true:false)}if(j.isMovieStar){}if(j.isMovieStar&&(j.usePeakData||j.useWaveformData||j.useEQData)){j.usePeakData=false;j.useWaveformData=false;j.useEQData=false}}i.sounds[j.id]=new d(j);i.soundIDs[i.soundIDs.length]=j.id;if(i.flashVersion==8){i.o._createSound(j.id,j.onjustbeforefinishtime)}else{i.o._createSound(j.id,j.url,j.onjustbeforefinishtime,j.usePeakData,j.useWaveformData,j.useEQData,j.isMovieStar,(j.isMovieStar?j.useVideo:false),(j.isMovieStar?j.bufferTime:false))}if(j.autoLoad||j.autoPlay){if(i.sounds[j.id]){i.sounds[j.id].load(j)}}if(j.autoPlay){i.sounds[j.id].play()}return i.sounds[j.id]};this.createVideo=function(j){if(arguments.length==2){j={id:arguments[0],url:arguments[1]}}if(i.flashVersion>=9){j.isMovieStar=true;j.useVideo=true}else{return false}if(!i.useMovieStar){}return i.createSound(j)};this.destroySound=function(k,j){if(!i._idCheck(k)){return false}for(var l=0;l<i.soundIDs.length;l++){if(i.soundIDs[l]==k){i.soundIDs.splice(l,1);continue}}i.sounds[k].unload();if(!j){i.sounds[k].destruct()}delete i.sounds[k]};this.destroyVideo=this.destroySound;this.load=function(j,k){if(!i._idCheck(j)){return false}i.sounds[j].load(k)};this.unload=function(j){if(!i._idCheck(j)){return false}i.sounds[j].unload()};this.play=function(j,k){if(!i._didInit){throw i._complain(b+i._str("notReady"),arguments.callee.caller)}if(!i._idCheck(j)){if(typeof k!="Object"){k={url:k}}if(k&&k.url){k.id=j;i.createSound(k)}else{return false}}i.sounds[j].play(k)};this.start=this.play;this.setPosition=function(j,k){if(!i._idCheck(j)){return false}i.sounds[j].setPosition(k)};this.stop=function(j){if(!i._idCheck(j)){return false}i.sounds[j].stop()};this.stopAll=function(){for(var j in i.sounds){if(i.sounds[j] instanceof d){i.sounds[j].stop()}}};this.pause=function(j){if(!i._idCheck(j)){return false}i.sounds[j].pause()};this.pauseAll=function(){for(var j=i.soundIDs.length;j--;){i.sounds[i.soundIDs[j]].pause()}};this.resume=function(j){if(!i._idCheck(j)){return false}i.sounds[j].resume()};this.resumeAll=function(){for(var j=i.soundIDs.length;j--;){i.sounds[i.soundIDs[j]].resume()}};this.togglePause=function(j){if(!i._idCheck(j)){return false}i.sounds[j].togglePause()};this.setPan=function(j,k){if(!i._idCheck(j)){return false}i.sounds[j].setPan(k)};this.setVolume=function(k,j){if(!i._idCheck(k)){return false}i.sounds[k].setVolume(j)};this.mute=function(j){if(typeof j!="string"){j=null}if(!j){for(var k=i.soundIDs.length;k--;){i.sounds[i.soundIDs[k]].mute()}i.muted=true}else{if(!i._idCheck(j)){return false}i.sounds[j].mute()}};this.muteAll=function(){i.mute()};this.unmute=function(j){if(typeof j!="string"){j=null}if(!j){for(var k=i.soundIDs.length;k--;){i.sounds[i.soundIDs[k]].unmute()}i.muted=false}else{if(!i._idCheck(j)){return false}i.sounds[j].unmute()}};this.unmuteAll=function(){i.unmute()};this.toggleMute=function(j){if(!i._idCheck(j)){return false}i.sounds[j].toggleMute()};this.getMemoryUse=function(){if(i.flashVersion==8){return 0}if(i.o){return parseInt(i.o._getMemoryUse(),10)}};this.disable=function(k){if(typeof k=="undefined"){k=false}if(i._disabled){return false}i._disabled=true;for(var j=i.soundIDs.length;j--;){i._disableObject(i.sounds[i.soundIDs[j]])}i.initComplete(k)};this.canPlayURL=function(j){return(j?(j.match(i.filePattern)?true:false):null)};this.getSoundById=function(k,l){if(!k){throw new Error("SoundManager.getSoundById(): sID is null/undefined")}var j=i.sounds[k];if(!j&&!l){}return j};this.onready=function(k,j){if(k&&k instanceof Function){if(i._didInit){}if(!j){j=window}i._addOnReady(k,j);i._processOnReady();return true}else{throw i._str("needFunction")}};this.oninitmovie=function(){};this.onload=function(){soundManager._wD("soundManager.onload()",1)};this.onerror=function(){};this._idCheck=this.getSoundById;this._complain=function(k,m){var l="Error: ";if(!m){return new Error(l+k)}var o=new Error("");var p=null;if(o.stack){try{var q="@";var r=o.stack.split(q);p=r[4]}catch(n){p=o.stack}}if(typeof console!="undefined"&&typeof console.trace!="undefined"){console.trace()}var j=l+k+". \nCaller: "+m.toString()+(o.stack?" \nTop of stacktrace: "+p:(o.message?" \nMessage: "+o.message:""));return new Error(j)};var g=function(){return false};g._protected=true;this._disableObject=function(k){for(var j in k){if(typeof k[j]=="function"&&typeof k[j]._protected=="undefined"){k[j]=g}}j=null};this._failSafely=function(j){if(typeof j=="undefined"){j=false}if(!i._disabled||j){i.disable(j)}};this._normalizeMovieURL=function(j){var k=null;if(j){if(j.match(/\.swf(\?.*)?$/i)){k=j.substr(j.toLowerCase().lastIndexOf(".swf?")+4);if(k){return j}}else{if(j.lastIndexOf("/")!=j.length-1){j=j+"/"}}}return(j&&j.lastIndexOf("/")!=-1?j.substr(0,j.lastIndexOf("/")+1):"./")+i.movieURL};this._getDocument=function(){return(document.body?document.body:(document.documentElement?document.documentElement:document.getElementsByTagName("div")[0]))};this._getDocument._protected=true;this._setPolling=function(j,k){if(!i.o||!i.allowPolling){return false}i.o._setPolling(j,k)};this._createMovie=function(q,n){var p=null;var w=(n?n:i.url);var m=(i.altURL?i.altURL:w);if(i._didAppend&&i._appendSuccess){return false}i._didAppend=true;i._setVersionInfo();i.url=i._normalizeMovieURL(i._overHTTP?w:m);n=i.url;if(i.useHighPerformance&&i.useMovieStar&&i.defaultOptions.useVideo===true){p="soundManager note: disabling highPerformance, not applicable with movieStar mode+useVideo";i.useHighPerformance=false}i.wmode=(!i.wmode&&i.useHighPerformance&&!i.useMovieStar?"transparent":i.wmode);if(i.wmode!==null&&i.flashLoadTimeout!==0&&(!i.useHighPerformance||i.debugFlash)&&!i.isIE&&navigator.platform.match(/win32/i)){i.specialWmodeCase=true;i.wmode=null}if(i.flashVersion==8){i.allowFullScreen=false}var u={name:q,id:q,src:n,width:"100%",height:"100%",quality:"high",allowScriptAccess:i.allowScriptAccess,bgcolor:i.bgColor,pluginspage:"http://www.macromedia.com/go/getflashplayer",type:"application/x-shockwave-flash",wmode:i.wmode,allowfullscreen:(i.allowFullScreen?"true":"false")};if(i.debugFlash){u.FlashVars="debug=1"}if(!i.wmode){delete u.wmode}var l=null;var v=null;var j=null;var t=null;if(i.isIE){l=document.createElement("div");j='<object id="'+q+'" data="'+n+'" type="'+u.type+'" width="'+u.width+'" height="'+u.height+'"><param name="movie" value="'+n+'" /><param name="AllowScriptAccess" value="'+i.allowScriptAccess+'" /><param name="quality" value="'+u.quality+'" />'+(i.wmode?'<param name="wmode" value="'+i.wmode+'" /> ':"")+'<param name="bgcolor" value="'+i.bgColor+'" /><param name="allowFullScreen" value="'+u.allowFullScreen+'" />'+(i.debugFlash?'<param name="FlashVars" value="'+u.FlashVars+'" />':"")+"<!-- --></object>"}else{l=document.createElement("embed");for(v in u){if(u.hasOwnProperty(v)){l.setAttribute(v,u[v])}}}var r=null;var B=null;if(i.debugMode){r=document.createElement("div");r.id=i.debugID+"-toggle";B={position:"fixed",bottom:"0px",right:"0px",width:"1.2em",height:"1.2em",lineHeight:"1.2em",margin:"2px",textAlign:"center",border:"1px solid #999",cursor:"pointer",background:"#fff",color:"#333",zIndex:10001};r.appendChild(document.createTextNode("-"));r.onclick=i._toggleDebug;r.title="Toggle SM2 debug console";if(navigator.userAgent.match(/msie 6/i)){r.style.position="absolute";r.style.cursor="hand"}for(v in B){if(B.hasOwnProperty(v)){r.style[v]=B[v]}}}var k=i._getDocument();if(k){i.oMC=f("sm2-container")?f("sm2-container"):document.createElement("div");var o=(i.debugMode?" sm2-debug":"")+(i.debugFlash?" flash-debug":"");if(!i.oMC.id){i.oMC.id="sm2-container";i.oMC.className="movieContainer"+o;var A=null;t=null;if(i.useHighPerformance){A={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"}}else{A={position:"absolute",width:"8px",height:"8px",top:"-9999px",left:"-9999px"}}var z=null;if(!i.debugFlash){for(z in A){if(A.hasOwnProperty(z)){i.oMC.style[z]=A[z]}}}try{if(!i.isIE){i.oMC.appendChild(l)}k.appendChild(i.oMC);if(i.isIE){t=i.oMC.appendChild(document.createElement("div"));t.className="sm2-object-box";t.innerHTML=j}i._appendSuccess=true}catch(y){throw new Error(i._str("appXHTML"))}}else{if(i.debugMode||i.debugFlash){i.oMC.className+=o}i.oMC.appendChild(l);if(i.isIE){t=i.oMC.appendChild(document.createElement("div"));t.className="sm2-object-box";t.innerHTML=j}i._appendSuccess=true}k=null}if(p){}};this._writeDebug=function(j,l,k){};this._writeDebug._protected=true;this._wdCount=0;this._wdCount._protected=true;this._wD=this._writeDebug;this._debug=function(){for(var l=0,k=i.soundIDs.length;l<k;l++){i.sounds[i.soundIDs[l]]._debug()}};this._debugTS=function(m,j,k){if(typeof sm2Debugger!="undefined"){try{sm2Debugger.handleEvent(m,j,k)}catch(l){}}};this._debugTS._protected=true;this._mergeObjects=function(k,j){var n={};for(var l in k){if(k.hasOwnProperty(l)){n[l]=k[l]}}var m=(typeof j=="undefined"?i.defaultOptions:j);for(var p in m){if(m.hasOwnProperty(p)&&typeof n[p]=="undefined"){n[p]=m[p]}}return n};this.createMovie=function(j){if(j){i.url=j}i._initMovie()};this.go=this.createMovie;this._initMovie=function(){if(i.o){return false}i.o=i.getMovie(i.id);if(!i.o){if(!i.oRemoved){i._createMovie(i.id,i.url)}else{if(!i.isIE){i.oMC.appendChild(i.oRemoved)}else{i.oMC.innerHTML=i.oRemovedHTML}i.oRemoved=null;i._didAppend=true}i.o=i.getMovie(i.id)}if(i.o){if(i.flashLoadTimeout>0){}}if(typeof i.oninitmovie=="function"){setTimeout(i.oninitmovie,1)}};this.waitForExternalInterface=function(){if(i._waitingForEI){return false}i._waitingForEI=true;if(i._tryInitOnFocus&&!i._isFocused){return false}if(i.flashLoadTimeout>0){if(!i._didInit){var j=i.getMoviePercent()}setTimeout(function(){var k=i.getMoviePercent();if(!i._didInit){if(!i._overHTTP){if(!i.debugFlash){}}if(k===0){}i._debugTS("flashtojs",false,": Timed out"+(i._overHTTP)?" (Check flash security or flash blockers)":" (No plugin/missing SWF?)")}if(!i._didInit&&i._okToDisable){i._failSafely(true)}},i.flashLoadTimeout)}else{if(!i._didInit){}}};this.getMoviePercent=function(){return(i.o&&typeof i.o.PercentLoaded!="undefined"?i.o.PercentLoaded():null)};this.handleFocus=function(){if(i._isFocused||!i._tryInitOnFocus){return true}i._okToDisable=true;i._isFocused=true;if(i._tryInitOnFocus){window.removeEventListener("mousemove",i.handleFocus,false)}i._waitingForEI=false;setTimeout(i.waitForExternalInterface,500);if(window.removeEventListener){window.removeEventListener("focus",i.handleFocus,false)}else{if(window.detachEvent){window.detachEvent("onfocus",i.handleFocus)}}};this.initComplete=function(j){if(i._didInit){return false}i._didInit=true;if(i._disabled||j){i._processOnReady();i._debugTS("onload",false);i.onerror.apply(window);return false}else{i._debugTS("onload",true)}if(i.waitForWindowLoad&&!i._windowLoaded){if(window.addEventListener){window.addEventListener("load",i._initUserOnload,false)}else{if(window.attachEvent){window.attachEvent("onload",i._initUserOnload)}}return false}else{if(i.waitForWindowLoad&&i._windowLoaded){}i._initUserOnload()}};this._addOnReady=function(k,j){i._onready.push({method:k,scope:(j||null),fired:false})};this._processOnReady=function(){if(!i._didInit){return false}var l={success:(!i._disabled)};var k=[];for(var n=0,m=i._onready.length;n<m;n++){if(i._onready[n].fired!==true){k.push(i._onready[n])}}if(k.length){for(n=0,m=k.length;n<m;n++){if(k[n].scope){k[n].method.apply(k[n].scope,[l])}else{k[n].method(l)}k[n].fired=true}}};this._initUserOnload=function(){window.setTimeout(function(){i._processOnReady();i.onload.apply(window)})};this.init=function(){i._initMovie();if(i._didInit){return false}if(window.removeEventListener){window.removeEventListener("load",i.beginDelayedInit,false)}else{if(window.detachEvent){window.detachEvent("onload",i.beginDelayedInit)}}try{i.o._externalInterfaceTest(false);if(!i.allowPolling){}else{i._setPolling(true,i.useFastPolling?true:false)}if(!i.debugMode){i.o._disableDebug()}i.enabled=true;i._debugTS("jstoflash",true)}catch(j){i._debugTS("jstoflash",false);i._failSafely(true);i.initComplete();return false}i.initComplete()};this.beginDelayedInit=function(){i._windowLoaded=true;setTimeout(i.waitForExternalInterface,500);setTimeout(i.beginInit,20)};this.beginInit=function(){if(i._initPending){return false}i.createMovie();i._initMovie();i._initPending=true;return true};this.domContentLoaded=function(){if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",i.domContentLoaded,false)}i.go()};this._externalInterfaceOK=function(j){if(i.swfLoaded){return false}var k=new Date().getTime();i._debugTS("swf",true);i._debugTS("flashtojs",true);i.swfLoaded=true;i._tryInitOnFocus=false;if(i.isIE){setTimeout(i.init,100)}else{i.init()}};this._setSandboxType=function(j){var k=i.sandbox;k.type=j;k.description=k.types[(typeof k.types[j]!="undefined"?j:"unknown")];if(k.type=="localWithFile"){k.noRemote=true;k.noLocal=false}else{if(k.type=="localWithNetwork"){k.noRemote=false;k.noLocal=true}else{if(k.type=="localTrusted"){k.noRemote=false;k.noLocal=false}}}};this.reboot=function(){if(i.soundIDs.length){}for(var j=i.soundIDs.length;j--;){i.sounds[i.soundIDs[j]].destruct()}try{if(i.isIE){i.oRemovedHTML=i.o.innerHTML}i.oRemoved=i.o.parentNode.removeChild(i.o)}catch(k){}i.oRemovedHTML=null;i.oRemoved=null;i.enabled=false;i._didInit=false;i._waitingForEI=false;i._initPending=false;i._didAppend=false;i._appendSuccess=false;i._disabled=false;i._waitingforEI=true;i.swfLoaded=false;i.soundIDs={};i.sounds=[];i.o=null;for(j=i._onready.length;j--;){i._onready[j].fired=false}window.setTimeout(soundManager.beginDelayedInit,20)};this.destruct=function(){i.disable(true)};d=function(j){var k=this;this.sID=j.id;this.url=j.url;this.options=i._mergeObjects(j);this.instanceOptions=this.options;this._iO=this.instanceOptions;this.pan=this.options.pan;this.volume=this.options.volume;this._lastURL=null;this._debug=function(){};this._debug();this.id3={};this.resetProperties=function(l){k.bytesLoaded=null;k.bytesTotal=null;k.position=null;k.duration=null;k.durationEstimate=null;k.loaded=false;k.playState=0;k.paused=false;k.readyState=0;k.muted=false;k.didBeforeFinish=false;k.didJustBeforeFinish=false;k.isBuffering=false;k.instanceOptions={};k.instanceCount=0;k.peakData={left:0,right:0};k.waveformData={left:[],right:[]};k.eqData=[];k.eqData.left=[];k.eqData.right=[]};k.resetProperties();this.load=function(l){if(typeof l!="undefined"){k._iO=i._mergeObjects(l);k.instanceOptions=k._iO}else{l=k.options;k._iO=l;k.instanceOptions=k._iO;if(k._lastURL&&k._lastURL!=k.url){k._iO.url=k.url;k.url=null}}if(typeof k._iO.url=="undefined"){k._iO.url=k.url}if(k._iO.url==k.url&&k.readyState!==0&&k.readyState!=2){return false}k.url=k._iO.url;k._lastURL=k._iO.url;k.loaded=false;k.readyState=1;k.playState=0;try{if(i.flashVersion==8){i.o._load(k.sID,k._iO.url,k._iO.stream,k._iO.autoPlay,(k._iO.whileloading?1:0))}else{i.o._load(k.sID,k._iO.url,k._iO.stream?true:false,k._iO.autoPlay?true:false);if(k._iO.isMovieStar&&k._iO.autoLoad&&!k._iO.autoPlay){k.pause()}}}catch(m){i._debugTS("onload",false);i.onerror();i.disable()}};this.unload=function(){if(k.readyState!==0){if(k.readyState!=2){k.setPosition(0,true)}i.o._unload(k.sID,i.nullURL);k.resetProperties()}};this.destruct=function(){i.o._destroySound(k.sID);i.destroySound(k.sID,true)};this.play=function(m){if(!m){m={}}k._iO=i._mergeObjects(m,k._iO);k._iO=i._mergeObjects(k._iO,k.options);k.instanceOptions=k._iO;if(k.playState==1){var l=k._iO.multiShot;if(!l){return false}else{}}if(!k.loaded){if(k.readyState===0){k._iO.autoPlay=true;k.load(k._iO)}else{if(k.readyState==2){return false}else{}}}else{}if(k.paused){k.resume()}else{k.playState=1;if(!k.instanceCount||i.flashVersion>8){k.instanceCount++}k.position=(typeof k._iO.position!="undefined"&&!isNaN(k._iO.position)?k._iO.position:0);if(k._iO.onplay){k._iO.onplay.apply(k)}k.setVolume(k._iO.volume,true);k.setPan(k._iO.pan,true);i.o._start(k.sID,k._iO.loop||1,(i.flashVersion==9?k.position:k.position/1000))}};this.start=this.play;this.stop=function(l){if(k.playState==1){k.playState=0;k.paused=false;if(k._iO.onstop){k._iO.onstop.apply(k)}i.o._stop(k.sID,l);k.instanceCount=0;k._iO={}}};this.setPosition=function(m,l){if(typeof m=="undefined"){m=0}var n=Math.min(k.duration,Math.max(m,0));k._iO.position=n;if(!l){}i.o._setPosition(k.sID,(i.flashVersion==9?k._iO.position:k._iO.position/1000),(k.paused||!k.playState))};this.pause=function(){if(k.paused||k.playState===0){return false}k.paused=true;i.o._pause(k.sID);if(k._iO.onpause){k._iO.onpause.apply(k)}};this.resume=function(){if(!k.paused||k.playState===0){return false}k.paused=false;i.o._pause(k.sID);if(k._iO.onresume){k._iO.onresume.apply(k)}};this.togglePause=function(){if(k.playState===0){k.play({position:(i.flashVersion==9?k.position:k.position/1000)});return false}if(k.paused){k.resume()}else{k.pause()}};this.setPan=function(m,l){if(typeof m=="undefined"){m=0}if(typeof l=="undefined"){l=false}i.o._setPan(k.sID,m);k._iO.pan=m;if(!l){k.pan=m}};this.setVolume=function(l,m){if(typeof l=="undefined"){l=100}if(typeof m=="undefined"){m=false}i.o._setVolume(k.sID,(i.muted&&!k.muted)||k.muted?0:l);k._iO.volume=l;if(!m){k.volume=l}};this.mute=function(){k.muted=true;i.o._setVolume(k.sID,0)};this.unmute=function(){k.muted=false;var l=typeof k._iO.volume!="undefined";i.o._setVolume(k.sID,l?k._iO.volume:k.options.volume)};this.toggleMute=function(){if(k.muted){k.unmute()}else{k.mute()}};this._whileloading=function(l,m,n){if(!k._iO.isMovieStar){k.bytesLoaded=l;k.bytesTotal=m;k.duration=Math.floor(n);k.durationEstimate=parseInt((k.bytesTotal/k.bytesLoaded)*k.duration,10);if(k.durationEstimate===undefined){k.durationEstimate=k.duration}if(k.readyState!=3&&k._iO.whileloading){k._iO.whileloading.apply(k)}}else{k.bytesLoaded=l;k.bytesTotal=m;k.duration=Math.floor(n);k.durationEstimate=k.duration;if(k.readyState!=3&&k._iO.whileloading){k._iO.whileloading.apply(k)}}};this._onid3=function(o,l){var p=[];for(var n=0,m=o.length;n<m;n++){p[o[n]]=l[n]}k.id3=i._mergeObjects(k.id3,p);if(k._iO.onid3){k._iO.onid3.apply(k)}};this._whileplaying=function(n,o,q,m,p){if(isNaN(n)||n===null){return false}if(k.playState===0&&n>0){n=0}k.position=n;if(i.flashVersion>8){if(k._iO.usePeakData&&typeof o!="undefined"&&o){k.peakData={left:o.leftPeak,right:o.rightPeak}}if(k._iO.useWaveformData&&typeof q!="undefined"&&q){k.waveformData={left:q.split(","),right:m.split(",")}}if(k._iO.useEQData){if(typeof p!="undefined"&&p.leftEQ){var l=p.leftEQ.split(",");k.eqData=l;k.eqData.left=l;if(typeof p.rightEQ!="undefined"&&p.rightEQ){k.eqData.right=p.rightEQ.split(",")}}}}if(k.playState==1){if(k.isBuffering){k._onbufferchange(0)}if(k._iO.whileplaying){k._iO.whileplaying.apply(k)}if(k.loaded&&k._iO.onbeforefinish&&k._iO.onbeforefinishtime&&!k.didBeforeFinish&&k.duration-k.position<=k._iO.onbeforefinishtime){k._onbeforefinish()}}};this._onload=function(l){l=(l==1?true:false);if(!l){if(i.sandbox.noRemote===true){}if(i.sandbox.noLocal===true){}}k.loaded=l;k.readyState=l?3:2;if(k._iO.onload){k._iO.onload.apply(k)}};this._onbeforefinish=function(){if(!k.didBeforeFinish){k.didBeforeFinish=true;if(k._iO.onbeforefinish){k._iO.onbeforefinish.apply(k)}}};this._onjustbeforefinish=function(l){if(!k.didJustBeforeFinish){k.didJustBeforeFinish=true;if(k._iO.onjustbeforefinish){k._iO.onjustbeforefinish.apply(k)}}};this._onfinish=function(){if(k._iO.onbeforefinishcomplete){k._iO.onbeforefinishcomplete.apply(k)}k.didBeforeFinish=false;k.didJustBeforeFinish=false;if(k.instanceCount){k.instanceCount--;if(!k.instanceCount){k.playState=0;k.paused=false;k.instanceCount=0;k.instanceOptions={}}if(!k.instanceCount||k._iO.multiShotEvents){if(k._iO.onfinish){k._iO.onfinish.apply(k)}}}else{if(k.useVideo){}}};this._onmetadata=function(l){if(!l.width&&!l.height){l.width=320;l.height=240}k.metadata=l;k.width=l.width;k.height=l.height;if(k._iO.onmetadata){k._iO.onmetadata.apply(k)}};this._onbufferchange=function(l){if(k.playState===0){return false}if(l==k.isBuffering){return false}k.isBuffering=(l==1?true:false);if(k._iO.onbufferchange){k._iO.onbufferchange.apply(k)}};this._ondataerror=function(l){if(k.playState>0){if(k._iO.ondataerror){k._iO.ondataerror.apply(k)}}else{}}};this._onfullscreenchange=function(j){i.isFullScreen=(j==1?true:false);if(!i.isFullScreen){try{window.focus()}catch(k){}}};if(window.addEventListener){window.addEventListener("focus",i.handleFocus,false);window.addEventListener("load",i.beginDelayedInit,false);window.addEventListener("unload",i.destruct,false);if(i._tryInitOnFocus){window.addEventListener("mousemove",i.handleFocus,false)}}else{if(window.attachEvent){window.attachEvent("onfocus",i.handleFocus);window.attachEvent("onload",i.beginDelayedInit);window.attachEvent("unload",i.destruct)}else{i._debugTS("onload",false);soundManager.onerror();soundManager.disable()}}if(document.addEventListener){document.addEventListener("DOMContentLoaded",i.domContentLoaded,false)}}if(typeof SM2_DEFER=="undefined"||!SM2_DEFER){soundManager=new SoundManager()};
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}('5 1j(){9 d=2;9 f=2;9 g=I;2.J=\'1k-1l\';2.u=[];2.W=[];2.B=[];2.K=[];2.n=L;2.X=0;9 h=(1m.1n.C(/1o/i));2.M={Y:8,Z:8};2.q={10:\'1p\',1q:\'1r\',D:\'1s\',11:\'1t\'};2.12=5(o,a,b){k(N)==\'l\'?o.1u(a,b,8):o.N(\'13\'+a,b)};2.1v=5(o,a,b){k(N)==\'l\'?o.1w(a,b,8):o.1x(\'13\'+a,b)};2.v=5(o,a){7(k(o.4)!=\'l\'?o.4.C(14 15(\'(\\\\s|^)\'+a+\'(\\\\s|$)\')):8)};2.w=5(o,a){6(!o||!a||d.v(o,a))7 8;o.4=(o.4?o.4+\' \':\'\')+a};2.r=5(o,a){6(!o||!a||!d.v(o,a))7 8;o.4=o.4.1y(14 15(\'( \'+a+\')|(\'+a+\')\',\'g\'),\'\')};2.16=5(a){7(k d.B[a]!=\'l\'?d.B[a]:L)};2.17=5(o,a){6(!o||!o.O){7 8}a=a.E();1z{o=o.O}1A(o&&o.O&&o.P.E()!=a);7(o.P.E()==a?o:L)};2.t={Q:5(){f.r(2.3.m,2.3.4);2.3.4=f.q.D;f.w(2.3.m,2.3.4)},R:5(){f.r(2.3.m,2.3.4);2.3.4=\'\'},18:5(){f.r(2.3.m,2.3.4);2.3.4=f.q.11;f.w(2.3.m,2.3.4)},19:5(){f.r(2.3.m,2.3.4);2.3.4=f.q.D;f.w(2.3.m,2.3.4)},1a:5(){f.r(2.3.m,2.3.4);2.3.4=\'\';6(f.M.Y){9 a=(f.K[2.3.m.p]+1);6(a<f.u.1b){f.x({\'y\':f.u[a]})}}}};2.1B=5(e){6(k e!=\'l\'&&k e.z!=\'l\'){e.z()}F 6(k A!=\'l\'&&k A.S!=\'l\'){A.S=8}7 8};2.1c=(h)?5(e){7(e&&e.y?e.y:1C.A.1D)}:5(e){7 e.y};2.x=5(e){6(k e.1d!=\'l\'&&e.1d>1){7 T}9 o=d.1c(e);6(o.P.E()!=\'a\'){o=d.17(o,\'a\');6(!o)7 T}9 a=o.1E(\'p\');6(!o.p||!o.p.C(/\\.1e(\\\\?.*)$/i)||d.v(o,d.J)){6(h&&o.1F){7 8}7 T}g.G(\'x()\');9 b=(o.p);9 c=d.16(b);6(c){6(c==d.n){c.1f()}F{c.1f();g.G(\'1g 1G 1H 1I 1g: \'+d.n.U);6(d.n)d.V(d.n)}}F{c=g.1J({1K:\'1L\'+(d.X++),1M:b,1N:d.t.Q,1O:d.t.R,1P:d.t.18,1Q:d.t.19,1R:d.t.1a});c.3={m:o,4:d.q.D};d.B[b]=c;d.W.1S(c);6(d.n)d.V(d.n);c.Q()}d.n=c;6(k e!=\'l\'&&k e.z!=\'l\'){e.z()}F{A.S=8}7 8};2.V=5(a){I.R(a.U);I.1T(a.U)};2.H=5(){g.G(\'1h.H()\');9 a=1i.1U(\'a\');9 b=0;1V(9 i=0,j=a.1b;i<j;i++){6(a[i].p.C(/\\.1e/i)&&!d.v(a[i],d.J)){d.w(a[i],d.q.10);d.u[b]=(a[i]);d.K[a[i].p]=b;b++}}6(b>0){d.12(1i,\'1W\',d.x);6(d.M.Z){d.x({y:d.u[0],z:5(){}})}}g.G(\'1h.H(): 1X \'+b+\' 1Y 1Z.\')};2.H()}',62,124,'||this|_data|className|function|if|return|false|var|||||||||||typeof|undefined|oLink|lastSound||href|css|removeClass||events|links|classContains|addClass|handleClick|target|preventDefault|event|soundsByURL|match|sPlaying|toLowerCase|else|_writeDebug|init|soundManager|excludeClass|indexByURL|null|config|attachEvent|parentNode|nodeName|play|stop|returnValue|true|sID|stopSound|sounds|soundCount|playNext|autoPlay|sDefault|sPaused|addEventHandler|on|new|RegExp|getSoundByURL|isChildOfNode|pause|resume|finish|length|getTheDamnLink|button|mp3|togglePause|sound|inlinePlayer|document|InlinePlayer|inline|exclude|navigator|userAgent|msie|sm2_link|sLoading|sm2_loading|sm2_playing|sm2_paused|addEventListener|removeEventHandler|removeEventListener|detachEvent|replace|do|while|stopEvent|window|srcElement|getAttribute|onclick|different|than|last|createSound|id|inlineMP3Sound|url|onplay|onstop|onpause|onresume|onfinish|push|unload|getElementsByTagName|for|click|Found|relevant|items'.split('|'),0,{}))


//===================================//
//======= jQuery Form Plugin ========//
//===================================//
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}(';(5($){$.H.V=5(w){2(!4.J){K(\'V: 2R G 2S - 2T 2U 1g\');6 4}2(W w==\'5\')w={X:w};3 x=$.2V(4.1a(\'1h\'));2(x){x=(x.2W(/^([^#]+)/)||[])[1]}x=x||S.27.28||\'\';w=$.1r({1i:x,N:4.1a(\'1A\')||\'29\',1B:/^2X/i.2Y(S.27.28||\'\')?\'2Z:O\':\'30:31\'},w||{});3 y={};4.P(\'9-1C-2a\',[4,w,y]);2(y.2b){K(\'V: G 2c 1s 9-1C-2a P\');6 4}2(w.1D&&w.1D(4,w)===O){K(\'V: G 1j 1s 1D 1E\');6 4}3 a=4.1F(w.32);2(w.L){w.T=w.L;Q(3 n 1G w.L){2(w.L[n]33 1b){Q(3 k 1G w.L[n])a.E({7:n,8:w.L[n][k]})}F a.E({7:n,8:w.L[n]})}}2(w.1H&&w.1H(a,4,w)===O){K(\'V: G 1j 1s 1H 1E\');6 4}4.P(\'9-G-2d\',[a,4,w,y]);2(y.2b){K(\'V: G 2c 1s 9-G-2d P\');6 4}3 q=$.1I(a);2(w.N.34()==\'29\'){w.1i+=(w.1i.35(\'?\')>=0?\'&\':\'?\')+q;w.L=I}F w.L=q;3 z=4,11=[];2(w.1J)11.E(5(){z.1J()});2(w.1K)11.E(5(){z.1K()});2(!w.12&&w.13){3 A=w.X||5(){};11.E(5(a){3 b=w.36?\'37\':\'38\';$(w.13)[b](a).14(A,2e)})}F 2(w.X)11.E(w.X);w.X=5(a,b,c){Q(3 i=0,Y=11.J;i<Y;i++)11[i].39(w,[a,b,c||z,z])};3 B=$(\'U:3a\',4).1c();3 C=O;Q(3 j=0;j<B.J;j++)2(B[j])C=R;3 D=O;2((B.J&&w.1t!==O)||w.1t||C||D){2(w.2f)$.3b(w.2f,1L);F 1L()}F $.3c(w);4.P(\'9-G-3d\',[4,w]);6 4;5 1L(){3 j=z[0];2($(\':U[7=G]\',j).J){3e(\'3f: 3g 2g 3h 1M 3i 3j "G".\');6}3 k=$.1r({},$.2h,w);3 s=$.1r(R,{},$.1r(R,{},$.2h),k);3 l=\'3k\'+(1N 3l().3m());3 m=$(\'<1t 3n="\'+l+\'" 7="\'+l+\'" 2i="\'+k.1B+\'" 1u="(2j(4).L(\\\'9-15-1u\\\'))()" />\');3 o=m[0];m.3o({3p:\'3q\',2k:\'-2l\',2m:\'-2l\'});3 p={1j:0,1d:I,1k:I,3r:0,3s:\'n/a\',3t:5(){},2n:5(){},3u:5(){},3v:5(){4.1j=1;m.1a(\'2i\',k.1B)}};3 g=k.2o;2(g&&!$.1O++)$.1l.P("3w");2(g)$.1l.P("3x",[p,k]);2(s.2p&&s.2p(p,s)===O){s.2o&&$.1O--;6}2(p.1j)6;3 q=O;3 r=0;3 u=j.Z;2(u){3 n=u.7;2(n&&!u.1m){k.T=k.T||{};k.T[n]=u.8;2(u.N=="1e"){k.T[n+\'.x\']=j.16;k.T[n+\'.y\']=j.17}}}5 1P(){3 t=z.1a(\'13\'),a=z.1a(\'1h\');j.1n(\'13\',l);2(j.2q(\'1A\')!=\'2r\')j.1n(\'1A\',\'2r\');2(j.2q(\'1h\')!=k.1i)j.1n(\'1h\',k.1i);2(!k.3y){z.1a({3z:\'2s/9-L\',3A:\'2s/9-L\'})}2(k.1Q)1o(5(){r=R;1v()},k.1Q);3 b=[];2t{2(k.T)Q(3 n 1G k.T)b.E($(\'<U N="3B" 7="\'+n+\'" 8="\'+k.T[n]+\'" />\').2u(j)[0]);m.2u(\'1p\');m.L(\'9-15-1u\',1v);j.G()}3C{j.1n(\'1h\',a);t?j.1n(\'13\',t):z.3D(\'13\');$(b).2v()}};2(k.3E)1P();F 1o(1P,10);3 v=1w;5 1v(){2(q)6;3 c=R;2t{2(r)3F\'1Q\';3 d,M;M=o.2w?o.2w.2x:o.2y?o.2y:o.2x;3 f=k.12==\'1R\'||M.1S||$.3G(M);K(\'3H=\'+f);2(!f&&(M.1p==I||M.1p.1T==\'\')){2(--v){K(\'3I 3J 1E, 2z 1M 3K\');1o(1v,3L);6}K(\'3M 1M 3N 1t 2z 3O 1w 3P.\');6}K(\'3Q 3R\');q=R;p.1d=M.1p?M.1p.1T:I;p.1k=M.1S?M.1S:M;p.2n=5(a){3 b={\'3S-N\':k.12};6 b[a]};2(k.12==\'3T\'||k.12==\'3U\'){3 h=M.1U(\'1V\')[0];2(h)p.1d=h.8;F{3 i=M.1U(\'1C\')[0];2(i)p.1d=i.1T}}F 2(k.12==\'1R\'&&!p.1k&&p.1d!=I){p.1k=2A(p.1d)}d=$.3V(p,k.12)}3W(e){K(\'1x 3X:\',e);c=O;p.1x=e;$.3Y(k,p,\'1x\',e)}2(c){k.X(d,\'X\');2(g)$.1l.P("3Z",[p,k])}2(g)$.1l.P("40",[p,k]);2(g&&!--$.1O)$.1l.P("41");2(k.2B)k.2B(p,c?\'X\':\'1x\');1o(5(){m.42(\'9-15-1u\');m.2v();p.1k=I},1w)};5 2A(s,a){2(S.2C){a=1N 2C(\'43.44\');a.45=\'O\';a.46(s)}F a=(1N 47()).48(s,\'1W/1R\');6(a&&a.2D&&a.2D.1y!=\'49\')?a:I}}};$.H.4a=5(f){6 4.2E().2F(\'G.9-15\',5(e){e.4b();$(4).V(f)}).2F(\'2G.9-15\',5(e){3 a=e.13;3 b=$(a);2(!(b.4c(":G,U:1e"))){3 t=b.4d(\':G\');2(t.J==0)6;a=t[0]}3 c=4;c.Z=a;2(a.N==\'1e\'){2(e.2H!=18){c.16=e.2H;c.17=e.4e}F 2(W $.H.2I==\'5\'){3 d=b.2I();c.16=e.2J-d.2m;c.17=e.2K-d.2k}F{c.16=e.2J-a.4f;c.17=e.2K-a.4g}}1o(5(){c.Z=c.16=c.17=I},1w)})};$.H.2E=5(){6 4.4h(\'G.9-15 2G.9-15\')};$.H.1F=5(b){3 a=[];2(4.J==0)6 a;3 c=4[0];3 d=b?c.1U(\'*\'):c.2g;2(!d)6 a;Q(3 i=0,Y=d.J;i<Y;i++){3 e=d[i];3 n=e.7;2(!n)1X;2(b&&c.Z&&e.N=="1e"){2(!e.1m&&c.Z==e){a.E({7:n,8:$(e).2L()});a.E({7:n+\'.x\',8:c.16},{7:n+\'.y\',8:c.17})}1X}3 v=$.1c(e,R);2(v&&v.1z==1b){Q(3 j=0,2M=v.J;j<2M;j++)a.E({7:n,8:v[j]})}F 2(v!==I&&W v!=\'18\')a.E({7:n,8:v})}2(!b&&c.Z){3 f=$(c.Z),U=f[0],n=U.7;2(n&&!U.1m&&U.N==\'1e\'){a.E({7:n,8:f.2L()});a.E({7:n+\'.x\',8:c.16},{7:n+\'.y\',8:c.17})}}6 a};$.H.4i=5(a){6 $.1I(4.1F(a))};$.H.4j=5(b){3 a=[];4.14(5(){3 n=4.7;2(!n)6;3 v=$.1c(4,b);2(v&&v.1z==1b){Q(3 i=0,Y=v.J;i<Y;i++)a.E({7:n,8:v[i]})}F 2(v!==I&&W v!=\'18\')a.E({7:4.7,8:v})});6 $.1I(a)};$.H.1c=5(a){Q(3 b=[],i=0,Y=4.J;i<Y;i++){3 c=4[i];3 v=$.1c(c,a);2(v===I||W v==\'18\'||(v.1z==1b&&!v.J))1X;v.1z==1b?$.4k(b,v):b.E(v)}6 b};$.1c=5(b,c){3 n=b.7,t=b.N,1f=b.1y.1Y();2(W c==\'18\')c=R;2(c&&(!n||b.1m||t==\'1q\'||t==\'4l\'||(t==\'1Z\'||t==\'20\')&&!b.21||(t==\'G\'||t==\'1e\')&&b.9&&b.9.Z!=b||1f==\'19\'&&b.22==-1))6 I;2(1f==\'19\'){3 d=b.22;2(d<0)6 I;3 a=[],23=b.4m;3 e=(t==\'19-2N\');3 f=(e?d+1:23.J);Q(3 i=(e?d:0);i<f;i++){3 g=23[i];2(g.1g){3 v=g.8;2(!v)v=(g.24&&g.24[\'8\']&&!(g.24[\'8\'].4n))?g.1W:g.8;2(e)6 v;a.E(v)}}6 a}6 b.8};$.H.1K=5(){6 4.14(5(){$(\'U,19,1V\',4).2O()})};$.H.2O=$.H.4o=5(){6 4.14(5(){3 t=4.N,1f=4.1y.1Y();2(t==\'1W\'||t==\'4p\'||1f==\'1V\')4.8=\'\';F 2(t==\'1Z\'||t==\'20\')4.21=O;F 2(1f==\'19\')4.22=-1})};$.H.1J=5(){6 4.14(5(){2(W 4.1q==\'5\'||(W 4.1q==\'4q\'&&!4.1q.4r))4.1q()})};$.H.4s=5(b){2(b==18)b=R;6 4.14(5(){4.1m=!b})};$.H.1g=5(b){2(b==18)b=R;6 4.14(5(){3 t=4.N;2(t==\'1Z\'||t==\'20\')4.21=b;F 2(4.1y.1Y()==\'2P\'){3 a=$(4).4t(\'19\');2(b&&a[0]&&a[0].N==\'19-2N\'){a.4u(\'2P\').1g(O)}4.1g=b}})};5 K(){2($.H.V.4v){3 a=\'[4w.9] \'+1b.4x.4y.4z(2e,\'\');2(S.25&&S.25.K)S.25.K(a);F 2(S.26&&S.26.2Q)S.26.2Q(a)}}})(2j);',62,284,'||if|var|this|function|return|name|value|form|||||||||||||||||||||||||||||||push|else|submit|fn|null|length|log|data|doc|type|false|trigger|for|true|window|extraData|input|ajaxSubmit|typeof|success|max|clk||callbacks|dataType|target|each|plugin|clk_x|clk_y|undefined|select|attr|Array|fieldValue|responseText|image|tag|selected|action|url|aborted|responseXML|event|disabled|setAttribute|setTimeout|body|reset|extend|via|iframe|onload|cb|100|error|tagName|constructor|method|iframeSrc|pre|beforeSerialize|callback|formToArray|in|beforeSubmit|param|resetForm|clearForm|fileUpload|not|new|active|doSubmit|timeout|xml|XMLDocument|innerHTML|getElementsByTagName|textarea|text|continue|toLowerCase|checkbox|radio|checked|selectedIndex|ops|attributes|console|opera|location|href|GET|serialize|veto|vetoed|validate|arguments|closeKeepAlive|elements|ajaxSettings|src|jQuery|top|1000px|left|getResponseHeader|global|beforeSend|getAttribute|POST|multipart|try|appendTo|remove|contentWindow|document|contentDocument|DOM|toXml|complete|ActiveXObject|documentElement|ajaxFormUnbind|bind|click|offsetX|offset|pageX|pageY|val|jmax|one|clearFields|option|postError|skipping|process|no|element|trim|match|https|test|javascript|about|blank|semantic|instanceof|toUpperCase|indexOf|replaceTarget|replaceWith|html|apply|file|get|ajax|notify|alert|Error|Form|must|be|named|jqFormIO|Date|getTime|id|css|position|absolute|status|statusText|getAllResponseHeaders|setRequestHeader|abort|ajaxStart|ajaxSend|skipEncodingOverride|encoding|enctype|hidden|finally|removeAttr|forceSync|throw|isXMLDoc|isXml|requeing|onLoad|available|250|Could|access|after|tries|response|detected|content|json|script|httpData|catch|caught|handleError|ajaxSuccess|ajaxComplete|ajaxStop|removeData|Microsoft|XMLDOM|async|loadXML|DOMParser|parseFromString|parsererror|ajaxForm|preventDefault|is|closest|offsetY|offsetLeft|offsetTop|unbind|formSerialize|fieldSerialize|merge|button|options|specified|clearInputs|password|object|nodeType|enable|parent|find|debug|jquery|prototype|join|call'.split('|'),0,{}))


//===================================//
//====== jQuery Cookie Plugin =======//
//===================================//
jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options=$.extend({},options);options.expires=-1;}var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}expires='; expires='+date.toUTCString();}var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}return cookieValue;}};


//===================================//
//========== PHP utilities ==========//
//===================================//
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}('t W(j,k){5 l="",M=" ",N=4;5 m=t(a,b,c,d){7(b>0){b++}5 e=n(c*b,d);5 f=n(c*(b+1),d);5 g="";7(a E F||a E X){g+="F\\n"+e+"(\\n";O(5 h Y a){7(a[h]E F){g+=f+"["+h+"] => "+m(a[h],b+1,c,d)}9{g+=f+"["+h+"] => "+a[h]+"\\n"}}g+=e+")\\n"}9 7(a==Z||a==10){g=\'\'}9{g=a.11()}q g};5 n=t(a,b){5 c="";O(5 i=0;i<a;i++){c+=b}q c};l=m(j,0,N,M);7(k!==P){13.14("<Q>"+l+"</Q>");q P}9{q l}}t R(a){5 b=[],i=o=p=u=G=0;a+=\'\';S(i<a.T){p=a.y(i);7(p<17){b[o++]=r.s(p);i++}9 7((p>19)&&(p<1a)){u=a.y(i+1);b[o++]=r.s(((p&1b)<<6)|(u&H));i+=2}9{u=a.y(i+1);G=a.y(i+2);b[o++]=r.s(((p&15)<<12)|((u&H)<<6)|(G&H));i+=3}}q b.U(\'\')}t 1c(a){5 b="1d+/=";5 c,z,I,J,K,A,B,v,i=o=0,w="",x=[];7(!a){q a}a+=\'\';1e{J=b.C(a.D(i++));K=b.C(a.D(i++));A=b.C(a.D(i++));B=b.C(a.D(i++));v=J<<18|K<<12|A<<6|B;c=v>>16&L;z=v>>8&L;I=v&L;7(A==V){x[o++]=r.s(c)}9 7(B==V){x[o++]=r.s(c,z)}9{x[o++]=r.s(c,z,I)}}S(i<a.T);w=x.U(\'\');w=R(w);q w}',62,77,'|||||var||if||else|||||||||||||||ac|c1|return|String|fromCharCode|function|c2|bits|dec|tmp_arr|charCodeAt|o2|h3|h4|indexOf|charAt|instanceof|Array|c3|63|o3|h1|h2|0xff|pad_char|pad_val|for|true|pre|utf8_decode|while|length|join|64|print_r|Object|in|null|undefined|toString||document|write|||128||191|224|31|base64_decode|ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789|do'.split('|'),0,{}))
