/*!
  jQuery blockUI plugin
  Version 2.36 (16-NOV-2010)
  @requires jQuery v1.2.3 or later
 
  Examples at: http://malsup.com/jquery/block/
  Copyright (c) 2007-2008 M. Alsup
  Dual licensed under the MIT and GPL licenses:
  http://www.opensource.org/licenses/mit-license.php
  http://www.gnu.org/licenses/gpl.html
 
*/;(function($){if(/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery)||/^1.1/.test($.fn.jquery)){alert('blockUI requires jQuery v1.2.3 or later!  You are using v'+$.fn.jquery);return;}$.fn._fadeIn=$.fn.fadeIn;var noOp=function(){};var mode=document.documentMode||0;var setExpr=$.browser.msie&&(($.browser.version<8&&!mode)||mode<8);var ie6=$.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!mode;$.blockUI=function(opts){install(window,opts);};$.unblockUI=function(opts){remove(window,opts);};$.growlUI=function(title,message,timeout,onClose){var $m=$('<div class="growlUI"></div>');if(title)$m.append('<h1>'+title+'</h1>');if(message)$m.append('<h2>'+message+'</h2>');if(timeout==undefined)timeout=3000;$.blockUI({message:$m,fadeIn:700,fadeOut:1000,centerY:false,timeout:timeout,showOverlay:false,onUnblock:onClose,css:$.blockUI.defaults.growlCSS});};$.fn.block=function(opts){return this.unblock({fadeOut:0}).each(function(){if($.css(this,'position')=='static')this.style.position='relative';if($.browser.msie)this.style.zoom=1;install(this,opts);});};$.fn.unblock=function(opts){return this.each(function(){remove(this,opts);});};$.blockUI.version=2.35;$.blockUI.defaults={message:'<h1>Please wait...</h1>',title:null,draggable:true,theme:false,css:{padding:0,margin:0,width:'30%',top:'40%',left:'35%',textAlign:'center',color:'#000',border:'3px solid #aaa',backgroundColor:'#fff',cursor:'wait'},themedCSS:{width:'30%',top:'40%',left:'35%'},overlayCSS:{backgroundColor:'#000',opacity:0.6,cursor:'wait'},growlCSS:{width:'350px',top:'10px',left:'',right:'10px',border:'none',padding:'5px',opacity:0.6,cursor:'default',color:'#fff',backgroundColor:'#000','-webkit-border-radius':'10px','-moz-border-radius':'10px','border-radius':'10px'},iframeSrc:/^https/i.test(window.location.href||'')?'javascript:false':'about:blank',forceIframe:false,baseZ:1000,centerX:true,centerY:true,allowBodyStretch:true,bindEvents:true,constrainTabKey:true,fadeIn:200,fadeOut:400,timeout:0,showOverlay:true,focusInput:true,applyPlatformOpacityRules:true,onBlock:null,onUnblock:null,quirksmodeOffsetHack:4,blockMsgClass:'blockMsg'};var pageBlock=null;var pageBlockEls=[];function install(el,opts){var full=(el==window);var msg=opts&&opts.message!==undefined?opts.message:undefined;opts=$.extend({},$.blockUI.defaults,opts||{});opts.overlayCSS=$.extend({},$.blockUI.defaults.overlayCSS,opts.overlayCSS||{});var css=$.extend({},$.blockUI.defaults.css,opts.css||{});var themedCSS=$.extend({},$.blockUI.defaults.themedCSS,opts.themedCSS||{});msg=msg===undefined?opts.message:msg;if(full&&pageBlock)remove(window,{fadeOut:0});if(msg&&typeof msg!='string'&&(msg.parentNode||msg.jquery)){var node=msg.jquery?msg[0]:msg;var data={};$(el).data('blockUI.history',data);data.el=node;data.parent=node.parentNode;data.display=node.style.display;data.position=node.style.position;if(data.parent)data.parent.removeChild(node);}var z=opts.baseZ;var lyr1=($.browser.msie||opts.forceIframe)?$('<iframe class="blockUI" style="z-index:'+(z++)+';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>'):$('<div class="blockUI" style="display:none"></div>');var lyr2=$('<div class="blockUI blockOverlay" style="z-index:'+(z++)+';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');var lyr3,s;if(opts.theme&&full){s='<div class="blockUI '+opts.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+z+';display:none;position:fixed">'+'<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title||'&nbsp;')+'</div>'+'<div class="ui-widget-content ui-dialog-content"></div>'+'</div>';}else if(opts.theme){s='<div class="blockUI '+opts.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+z+';display:none;position:absolute">'+'<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title||'&nbsp;')+'</div>'+'<div class="ui-widget-content ui-dialog-content"></div>'+'</div>';}else if(full){s='<div class="blockUI '+opts.blockMsgClass+' blockPage" style="z-index:'+z+';display:none;position:fixed"></div>';}else{s='<div class="blockUI '+opts.blockMsgClass+' blockElement" style="z-index:'+z+';display:none;position:absolute"></div>';}lyr3=$(s);if(msg){if(opts.theme){lyr3.css(themedCSS);lyr3.addClass('ui-widget-content');}else
lyr3.css(css);}if(!opts.applyPlatformOpacityRules||!($.browser.mozilla&&/Linux/.test(navigator.platform)))lyr2.css(opts.overlayCSS);lyr2.css('position',full?'fixed':'absolute');if($.browser.msie||opts.forceIframe)lyr1.css('opacity',0.0);var layers=[lyr1,lyr2,lyr3],$par=full?$('body'):$(el);$.each(layers,function(){this.appendTo($par);});if(opts.theme&&opts.draggable&&$.fn.draggable){lyr3.draggable({handle:'.ui-dialog-titlebar',cancel:'li'});}var expr=setExpr&&(!$.boxModel||$('object,embed',full?null:el).length>0);if(ie6||expr){if(full&&opts.allowBodyStretch&&$.boxModel)$('html,body').css('height','100%');if((ie6||!$.boxModel)&&!full){var t=sz(el,'borderTopWidth'),l=sz(el,'borderLeftWidth');var fixT=t?'(0 - '+t+')':0;var fixL=l?'(0 - '+l+')':0;}$.each([lyr1,lyr2,lyr3],function(i,o){var s=o[0].style;s.position='absolute';if(i<2){full?s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"'):s.setExpression('height','this.parentNode.offsetHeight + "px"');full?s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):s.setExpression('width','this.parentNode.offsetWidth + "px"');if(fixL)s.setExpression('left',fixL);if(fixT)s.setExpression('top',fixT);}else if(opts.centerY){if(full)s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');s.marginTop=0;}else if(!opts.centerY&&full){var top=(opts.css&&opts.css.top)?parseInt(opts.css.top):0;var expression='((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';s.setExpression('top',expression);}});}if(msg){if(opts.theme)lyr3.find('.ui-widget-content').append(msg);else
lyr3.append(msg);if(msg.jquery||msg.nodeType)$(msg).show();}if(($.browser.msie||opts.forceIframe)&&opts.showOverlay)lyr1.show();if(opts.fadeIn){var cb=opts.onBlock?opts.onBlock:noOp;var cb1=(opts.showOverlay&&!msg)?cb:noOp;var cb2=msg?cb:noOp;if(opts.showOverlay)lyr2._fadeIn(opts.fadeIn,cb1);if(msg)lyr3._fadeIn(opts.fadeIn,cb2);}else{if(opts.showOverlay)lyr2.show();if(msg)lyr3.show();if(opts.onBlock)opts.onBlock();}bind(1,el,opts);if(full){pageBlock=lyr3[0];pageBlockEls=$(':input:enabled:visible',pageBlock);if(opts.focusInput)setTimeout(focus,20);}else
center(lyr3[0],opts.centerX,opts.centerY);if(opts.timeout){var to=setTimeout(function(){full?$.unblockUI(opts):$(el).unblock(opts);},opts.timeout);$(el).data('blockUI.timeout',to);}};function remove(el,opts){var full=(el==window);var $el=$(el);var data=$el.data('blockUI.history');var to=$el.data('blockUI.timeout');if(to){clearTimeout(to);$el.removeData('blockUI.timeout');}opts=$.extend({},$.blockUI.defaults,opts||{});bind(0,el,opts);var els;if(full)els=$('body').children().filter('.blockUI').add('body > .blockUI');else
els=$('.blockUI',el);if(full)pageBlock=pageBlockEls=null;if(opts.fadeOut){els.fadeOut(opts.fadeOut);setTimeout(function(){reset(els,data,opts,el);},opts.fadeOut);}else
reset(els,data,opts,el);};function reset(els,data,opts,el){els.each(function(i,o){if(this.parentNode)this.parentNode.removeChild(this);});if(data&&data.el){data.el.style.display=data.display;data.el.style.position=data.position;if(data.parent)data.parent.appendChild(data.el);$(el).removeData('blockUI.history');}if(typeof opts.onUnblock=='function')opts.onUnblock(el,opts);};function bind(b,el,opts){var full=el==window,$el=$(el);if(!b&&(full&&!pageBlock||!full&&!$el.data('blockUI.isBlocked')))return;if(!full)$el.data('blockUI.isBlocked',b);if(!opts.bindEvents||(b&&!opts.showOverlay))return;var events='mousedown mouseup keydown keypress';b?$(document).bind(events,opts,handler):$(document).unbind(events,handler);};function handler(e){if(e.keyCode&&e.keyCode==9){if(pageBlock&&e.data.constrainTabKey){var els=pageBlockEls;var fwd=!e.shiftKey&&e.target===els[els.length-1];var back=e.shiftKey&&e.target===els[0];if(fwd||back){setTimeout(function(){focus(back)},10);return false;}}}var opts=e.data;if($(e.target).parents('div.'+opts.blockMsgClass).length>0)return true;return $(e.target).parents().children().filter('div.blockUI').length==0;};function focus(back){if(!pageBlockEls)return;var e=pageBlockEls[back===true?pageBlockEls.length-1:0];if(e)e.focus();};function center(el,x,y){var p=el.parentNode,s=el.style;var l=((p.offsetWidth-el.offsetWidth)/2)-sz(p,'borderLeftWidth');var t=((p.offsetHeight-el.offsetHeight)/2)-sz(p,'borderTopWidth');if(x)s.left=l>0?(l+'px'):'0';if(y)s.top=t>0?(t+'px'):'0';};function sz(el,p){return parseInt($.css(el,p))||0;};})(jQuery);
;jQuery(function(){

	// Ajax Login
	jQuery('.widget_wp_sidebarlogin form').submit(function(){
		
		var thisform = this;
		
		jQuery(thisform).block({ message: null, overlayCSS: { 
	        backgroundColor: '#fff', 
	        opacity:         0.6 
	    } });
	    
	    var data = {
			action: 		'sidebar_login_process',
			security: 		sidebar_login_params.login_nonce,
			user_login: 	jQuery('input[name="log"]', thisform).val(),
			user_password: 	jQuery('input[name="pwd"]', thisform).val(),
			remember: 		jQuery('input[name="rememberme"]', thisform).val(),
			redirect_to:	jQuery('.redirect_to:eq(0)', thisform).val()
		};
		
		// Ajax action
		jQuery.post( sidebar_login_params.ajax_url, data, function(response) {
			jQuery('.login_error').remove();
			
			result = jQuery.parseJSON( response );
			
			if (result.success==1) {
				window.location = result.redirect;
			} else {
				jQuery(thisform).prepend('<p class="login_error">' + result.error + '</p>');
				jQuery(thisform).unblock();
			}
		});
		
		return false;
	});
	
});
;/*
	Quote Comments JS
*/


function jsEncode(str){

	// ugly hack
	str = " " + str;
	
	var aStr = str.split(''), i = aStr.length, aRet = [];

	while (--i) {
		var iC = aStr[i].charCodeAt();
		
		if (iC < 65 || iC > 127 || (iC>90 && iC<97)) {
			aRet.push('&#'+iC+';');
		} else {
			aRet.push(aStr[i]);
		}
	}
	
	return aRet.reverse().join('');
	
}



function quote(postid, author, commentarea, commentID, mce) {
	try {
		// If you don't want quotes begin with "<author>:", uncomment the next line
		//author = null;

		// begin code
		var posttext = '';

		if (window.getSelection){
			posttext = window.getSelection();
		}

		else if (document.getSelection){
			posttext = document.getSelection();
		}

		else if (document.selection){
			posttext = document.selection.createRange().text;
		}

		else {
			return true;
		}

		if (posttext=='') {		// quoting entire comment

			// quoteing the entire thing
			var selection = false;
			var commentID = commentID.split("div-comment-")[1];

			// quote entire comment as html
			var theQuote = "q-"+commentID;
			//var theQuote = "div-comment-"+commentID;
			var posttext = document.getElementById(theQuote).innerHTML;

			// remove nested divs
			var posttext = posttext.replace(/<div(.*?)>((.|\n)*?)(<\/div>)/ig, "");

			// remove nested blockquotes
			var posttext = posttext.replace(/<blockquote(.*?)>((.|\n)*?)(<\/blockquote>)/ig, "");
			var posttext = posttext.replace(/<blockquote(.*?)>((.|\n)*?)(<\/blockquote>)/ig, "");

			// remove superfluous linebreaks
			var posttext = posttext.replace(/\s\s/gm, "");

			// do basic cleanups
			var posttext = posttext.replace(/	/g, "");
			//var posttext = posttext.replace(/<p>/g, "\n");
			//var posttext = posttext.replace(/<\/\s*p>/g, "");
			var posttext = posttext.replace(/<p>/g, "");
			var posttext = posttext.replace(/<\/\s*p>/g, "\n\n");
			var posttext = posttext.replace(/<br>/g, "")

			// remove nonbreaking space
			var posttext = posttext.replace(/&nbsp;/g, " ");

			// remove nested spans
			var posttext = posttext.replace(/<span(.*?)>((.|\n)*?)(<\/span>)/ig, "");

			// remove nested blockquotes
			while (posttext != (posttext = posttext.replace(/<blockquote>[^>]*<\/\s*blockquote>/g, "")));

			// remove nested quote links
			var posttext = posttext.replace(/<a class="comment_quote_link"(.*?)>((.|\n)*?)(<\/a>)/ig, "");
			var posttext = posttext.replace(/<a class="comment_reply_link"(.*?)>((.|\n)*?)(<\/a>)/ig, "");

		}

		// build quote
		if (author) {
			
			// prevent xss stuff
			author = jsEncode(author);
			
			var quote='\n<blockquote cite="comment-'+postid+'">\n\n<strong><a href="#comment-'+postid+'">'+unescape(author)+'</a></strong>: '+posttext+'</blockquote>\n';

		} else {

			var quote='\n<blockquote cite="comment-'+postid+'">\n\n'+posttext+'</blockquote>\n';

		}

		// send quoted content
		if (mce == true) {		// TinyMCE detected

			//addQuoteMCE(comment,quote);
			insertHTML(quote);
			insertHTML("<p>&nbsp;</p>");

		} else {				// No TinyMCE detected

			var comment=document.getElementById(commentarea);
			addQuote(comment,quote);

		}

		return false;

	} catch (e) {

		alert("Quote Comments plugin is having some trouble! It could possibly be a problem with your Wordpress theme. Does it work if you use the default theme? Does it work if you disable all other plugins? If you look in the HTML source of a page with comments, can you find <div id='q-[id]'> where [id] is the ID of the comment?")

	}

	

}

function inlinereply(postid, author, commentarea, commentID, mce) {
	try {
		
		// prevent xss stuff
		author = jsEncode(author);

		// build quote
		var quote='\n<strong><a href="#comment-'+postid+'">'+unescape(author)+'</a></strong>, \n\n';


		// send quoted content
		if (mce == true) {		// TinyMCE detected

			//addQuoteMCE(comment,quote);
			insertHTML(quote);
			insertHTML("<p>&nbsp;</p>");

		} else {				// No TinyMCE detected

			var comment=document.getElementById(commentarea);
			addQuote(comment,quote);

		}

		return false;

	} catch (e) {

		alert("Quote Comments plugin is having some trouble! It could possibly be a problem with your Wordpress theme. Does it work if you use the default theme? Does it work if you disable all other plugins? If you look in the HTML source of a page with comments, can you find <div id='q-[id]'> where [id] is the ID of the comment?")

	}

	

}


function addQuote(comment,quote){

	/*
		Derived from Alex King's JS Quicktags code (http://www.alexking.org/)
		Released under LGPL license
	*/	

	

	// IE support
	if (document.selection) {
		comment.focus();
		sel = document.selection.createRange();
		sel.text = quote;
		comment.focus();
	}

	// Mozilla support

	else if (comment.selectionStart || comment.selectionStart == '0') {
		var startPos = comment.selectionStart;
		var endPos = comment.selectionEnd;
		var cursorPos = endPos;
		var scrollTop = comment.scrollTop;
		if (startPos != endPos) {

			comment.value = comment.value.substring(0, startPos)
						  + quote
						  + comment.value.substring(endPos, comment.value.length);
			cursorPos = startPos + quote.length

		}

		else {
			comment.value = comment.value.substring(0, startPos) 
							  + quote
							  + comment.value.substring(endPos, comment.value.length);
			cursorPos = startPos + quote.length;

		}

		comment.focus();
		comment.selectionStart = cursorPos;
		comment.selectionEnd = cursorPos;
		comment.scrollTop = scrollTop;

	}

	else {

		comment.value += quote;

	}

	// If Live Preview Plugin is installed, refresh preview
	try {
		ReloadTextDiv();
	}
	catch ( e ) {
	}

	

}




;var result;function sfjvalidatePMForm(theForm,editor,msg0,msg1,msg2,msg3,msg4,msg5){var reason="";var uid=document.getElementById('uid').value;if(uid==1){reason+="<strong>"+" - "+msg1+"</strong><br />"}else{found=false;for(i=uid;i>0;i--){var user=document.getElementById('userid'+i);if(user!=null){found=true;break}}if(!found)reason+="<strong>"+" - "+msg1+"</strong><br />"}reason+=sfjvalidateThis(theForm.pmtitle," - "+msg2);if(editor=='QT'){reason+=sfjvalidateThis(theForm.postitem," - "+msg3)}else{reason+=sfjvalidateTiny('postitem'," - "+msg3)}if(reason!=""){var target=document.getElementById('sfvalid');target.innerHTML="<br />"+msg0+":<br /><br />"+reason+"<br /><br />";var box=hs.htmlExpand(document.getElementById('sfsave'),{contentId:'my-content',preserveContent:true});return false}var saveBtn=document.getElementById('sfsave');saveBtn.value=msg4;var text='<div id="sfcomm" class="sfmessage"><img src="'+waitImage.src+'" alt="" />'+msg4+' - '+msg5+'</div>';jQuery("#sforum").before(text);jQuery('#sfcomm').show('fast');return true}function sfjvalidatePostForm(theForm,editor,msg0,msg1,msg2,msg3,msg4,msg5,msg6,msg7,msg8,waitIcon){var reason="";if(msg1!='')reason+=sfjvalidateThis(theForm.guestname," - "+msg1);if(msg2!='')reason+=sfjvalidateThis(theForm.guestemail," - "+msg2);if(msg3!='')reason+=sfjvalidateThis(theForm.newtopicname," - "+msg3);if(msg4!='')reason+=sfjvalidateThis(theForm.sfvalue1," - "+msg4);if(editor=='QT'){if(msg5!='')reason+=sfjvalidateThis(theForm.postitem," - "+msg5)}else{if(msg5!='')reason+=sfjvalidateTiny('postitem'," - "+msg5)}if(msg6!=''){if(editor=='QT'){var thisPost=theForm.postitem}else{var thisPost=tinyMCE.get('postitem').getContent()}var found=false;var checkWords=new Array();checkWords[0]='MsoPlainText';checkWords[1]='MsoNormal';checkWords[2]='mso-layout-grid-align';checkWords[3]='mso-pagination';checkWords[4]='white-space:';for(i=0;i<checkWords.length;i++){if(thisPost.match(checkWords[i])!=null){found=true}}if(found){reason+="<strong>"+msg6+"</strong><br />"}}if(reason!=""){var target=document.getElementById('sfvalid');target.innerHTML="<br />"+msg0+":<br /><br />"+reason+"<br /><br />";var box=hs.htmlExpand(document.getElementById('sfsave'),{contentId:'my-content',preserveContent:true});return false}var saveBtn=document.getElementById('sfsave');saveBtn.value=msg7;var text='<div id="sfcomm" class="sfmessage"><img src="'+waitImage.src+'" alt="" />'+msg7+' - '+msg8+'</div>';jQuery("#sforum").before(text);jQuery('#sfcomm').show('fast');return true}function sfjvalidateThis(theField,errorMsg){var error="";if(theField.value.length==0){error="<strong>"+errorMsg+"</strong><br />"}return error}function sfjvalidateTiny(thisField,errorMsg){var error="";var stuff=tinyMCE.get(thisField).getContent();if(stuff==''){error="<strong>"+errorMsg+"</strong><br />"}return error}function sfjOpenEditor(editorId,editorType,formType){sfjtoggleLayer(editorId);if(formType=='topic'){document.addtopic.topictitle.focus()}else{if(editorType==1){tinyMCE.activeEditor.focus()}else{document.addpost.postitem.focus()}}}function sfjCancelEditor(editorType){var tx=document.getElementById('postitem');tx.value='';if(editorType=='TM'){tinyMCE.activeEditor.setContent('')}sfjtoggleLayer('sfpostform')}function sfjshowUserMail(label,address,id){var param1='sfmail'+id;var param2='mail-content'+id;var param3='sfshowmail'+id;var target=document.getElementById(param1);target.innerHTML=label+"<br />"+address;var box=hs.htmlExpand(document.getElementById(param3),{contentId:param2})}function sfjshowPostLink(label,url,id){var param1='sfpostlink'+id;var param2='link-content'+id;var param3='sfshowlink'+id;var target=document.getElementById(param1);target.innerHTML=label+"<br /><p>"+url+"</p>";var box=hs.htmlExpand(document.getElementById(param3),{contentId:param2})}function sfjshowRelatedTags(url,$location,show,hide){var showButton=document.getElementById('showtags'+$location);var relatedTags=document.getElementById('relatedtags'+$location);var target='relatedtags'+$location;if(relatedTags.innerHTML==''){relatedTags.style.display='block';ahahRequest(url,target);showButton.value=hide}else if(relatedTags.style.display=='none'){relatedTags.style.display='block';showButton.value=hide}else{relatedTags.style.display='none';showButton.value=show}}function sfjtoggleLayer(whichLayer){jQuery('#'+whichLayer).toggle();var obj=document.getElementById(whichLayer);if(whichLayer=='sfpostform'||whichLayer=='sfsearchform'){obj.scrollIntoView()}}function sfjquotePost(postid,intro,editor,forumid,quoteUrl){quoteUrl+='&post='+postid+'&editor='+editor+'&forumid='+forumid;jQuery('#sfpostform').show(function(){jQuery('#postitem').load(quoteUrl,function(content,b){document.getElementById('sfpostform').scrollIntoView();if(editor==2||editor==4){document.addpost.postitem.value='<strong>'+intro+'</strong>\r\r'+'<blockquote>'+content+'</blockquote><br />\r\r';document.addpost.postitem.focus()}if(editor==3){document.addpost.postitem.value='[b]'+intro+'[/b]\r\r[quote]'+content+'[/quote]\r\r';document.addpost.postitem.focus()}if(editor==1){if(jQuery.browser.mozilla||jQuery.browser.opera){tinyMCE.activeEditor.selection.setContent('<strong>'+intro+'</strong><blockquote>'+content+'</blockquote><br />');tinyMCE.activeEditor.focus()}if(jQuery.browser.safari||jQuery.browser.webkit){tinyMCE.activeEditor.execCommand("InsertHTML",false,'<strong>'+intro+'</strong><blockquote>'+content+'</blockquote><br />')}if(jQuery.browser.msie){tinyMCE.activeEditor.execCommand("mceInsertRawHTML",false,'<strong>'+intro+'</strong><blockquote>'+content+'</blockquote><br />');tinyMCE.activeEditor.focus()}}})})}function sfjsetPostButton(result,val1,val2,gbuttontext,bbuttontext){var button=document.addpost.newpost;if(result.value==(val1+val2)){button.disabled=false;button.value=gbuttontext}else{button.disabled=true;button.value=bbuttontext}}function sfjsetTopicButton(result,val1,val2,gbuttontext,bbuttontext){var button=document.addtopic.newtopic;if(result.value==(val1+val2)){button.disabled=false;button.value=gbuttontext}else{button.disabled=true;button.value=bbuttontext}}function sfjtoggleRegister(cBox){var button=document.getElementById("regbutton");if(cBox.checked==true){button.disabled=false}else{button.disabled=true}}function sfjchangeURL(menuObj){var i=menuObj.selectedIndex;if(i>0){if(menuObj.options[i].value!='#'){window.location=menuObj.options[i].value}}}function sfjreDirect(url){window.location=url}function sfjRatePost(postid,url){var ratingpost='sfpostrating-'+postid;ahahRequest(url,ratingpost)}function sfjstarhover(postid,stars,img_src){for(i=stars;i>0;i--){var img_name='star-'+postid+'-'+i;document.getElementById(img_name).src=img_src}}function sfjstarunhover(postid,stars,img1_src,img2_src){for(i=5;i>stars;i--){var img_name='star-'+postid+'-'+i;document.getElementById(img_name).src=img2_src}for(i=stars;i>0;i--){var img_name='star-'+postid+'-'+i;document.getElementById(img_name).src=img1_src}}function sfjgetCategories(imageFile,url,checked){var cat=document.getElementById('sfcats');if(checked){cat.style.display="block";cat.innerHTML='<br /><br /><img src="'+imageFile+'" /><br />';ahahRequest(url,'sfcats')}else{cat.style.display="none"}}function sfjsetStatus(selectedStatus,url){if(selectedStatus.options[selectedStatus.selectedIndex].value!=0){var tsurl;var tsheader;var tstopic;var tsaddpform;var tsupheader;var tspform;tsheader=document.getElementById('ts-header');tstopic=document.getElementById('ts-topic');tsaddpform=document.getElementById('ts-addpform');tsupheader=document.getElementById('ts-upheader');tspform=document.getElementById('ts-pform');tsheader.style.display='block';tstopic.style.display='block';tsaddpform.style.display='block';tsurl=url+'&newtext='+selectedStatus.options[selectedStatus.selectedIndex].text+'&newvalue='+selectedStatus.selectedIndex;ahahRequest(tsurl,'ts-upinline');tsupheader.innerHTML=selectedStatus.options[selectedStatus.selectedIndex].text;tspform.innerHTML=selectedStatus.options[selectedStatus.selectedIndex].text}}function sfjremoveItem(url,rowid){var target=rowid;var row=document.getElementById(target);if(navigator.appName=="Microsoft Internet Explorer"){sfjopacity(row.style,9,0,10,function(){sfjremoveIt(row)})}else{sfjopacity(row.style,199,0,10,function(){sfjhideIt(row)})}ahahRequest(url,target)}function sfjmDisplay(){var d=document;var commDiv=d.getElementById('sfcomm');jQuery('#sfcomm').show('slow');if(navigator.appName=="Microsoft Internet Explorer"){sfjopacity(commDiv.style,99,0,10,function(){commDiv.parentNode.removeChild(commDiv)})}else{sfjopacity(commDiv.style,399,0,10,function(){commDiv.parentNode.removeChild(commDiv)})}}function sfjopacity(ss,s,e,m,f){if(s>e){s--}else if(s<e){s++}sfjsetOpacity(ss,s);if(s!=e){setTimeout(function(){sfjopacity(ss,s,e,m,f)},Math.round(m/10))}else if(s==e){if(typeof f=='function'){f()}}}function sfjsetOpacity(s,o){s.opacity=o/100;s.MozOpacity=o/100;s.KhtmlOpacity=o/100;s.filter='alpha(opacity='+o+')'}var oInterval;function sfjNewPostCheck(url,target,timer){var sfInterval=window.setInterval("ahahRequest('"+url+"', '"+target+"')",timer)}function sfjAutoUpdate(url,timer){var sfInterval=window.setInterval("sfjperformUpdates('"+url+"')",timer)}function sfjperformUpdates(url){var targetIDUser=document.getElementById("sfthisuser");if(targetIDUser!=null){var userid=targetIDUser.innerHTML;if(userid==null||userid==''){userid='0'}var userCheckUrl=url+"&target=checkuser&thisuser="+userid+"&rnd="+new Date().getTime();jQuery('#sflogininfo').load(userCheckUrl)}var targetIDInbox=document.getElementById("sfinboxcount");if(targetIDInbox!=null){var inBoxUrl=url+"&target=counts"+"&rnd="+new Date().getTime();jQuery('#sfinboxcount').load(inBoxUrl);var pmbox=document.getElementById('pmview');if(pmbox!=null){pmboxUrl=url+"&target=pmview&show="+pmbox.innerHTML;jQuery('#pmtoppane').load(pmboxUrl)}}var targetIDNewpost=document.getElementById("sfpostnumbers");if(targetIDNewpost!=null){var newPostsUrl=url+"&target=newposts"+"&rnd="+new Date().getTime();jQuery('#sfpostnumbers').load(newPostsUrl)}var targetIDQuicklinksTop=document.getElementById("sfqlposts");if(targetIDQuicklinksTop!=null){var quickLinksUrl=url+"&target=quicklinkstop"+"&rnd="+new Date().getTime();jQuery('#sfqlposts').load(quickLinksUrl,function(a,b){var targetIDQuicklinksBottom=document.getElementById("sfqlpostsbottom");if(targetIDQuicklinksBottom!=null){targetIDQuicklinksBottom.innerHTML=a}})}else{var targetIDQuicklinksBottom=document.getElementById("sfqlpostsbottom");if(targetIDQuicklinksBottom!=null){var quickLinksUrl=url+"&target=quicklinksbottom"+"&rnd="+new Date().getTime();jQuery('#sfqlpostsbottom').load(quickLinksUrl)}}}function sfjLoadSmiley(file,title,path,code,editor){if(editor==1){tinyMCE.execCommand('mceInsertContent',false,'<img src="'+path+file+'" title="'+title+'" alt="'+title+'" />')}else{var postField=document.getElementById("postitem");if(document.selection){postField.focus();sel=document.selection.createRange();sel.text=code;postField.focus()}else if(postField.selectionStart||postField.selectionStart=='0'){var startPos=postField.selectionStart;var endPos=postField.selectionEnd;postField.value=postField.value.substring(0,startPos)+code+postField.value.substring(endPos,postField.value.length);postField.focus();postField.selectionStart=startPos+code.length;postField.selectionEnd=startPos+code.length}else{postField.value+=code;postField.focus()}}}var jah_targets=new Array();function jah(url,target){if(window.XMLHttpRequest){var idx=jah_targets.length;jah_targets[idx]=new XMLHttpRequest();jah_targets[idx].onreadystatechange=function(){jahDone(target,idx)};jah_targets[idx].open("GET",url,true);jah_targets[idx].send(null)}else if(window.ActiveXObject){jah_targets[idx]=new ActiveXObject("Microsoft.XMLHTTP");if(jah_targets[idx]){jah_targets[idx].onreadystatechange=function(){jahDone(target)};jah_targets[idx].open("GET",url,true);jah_targets[idx].send()}}}function jahDone(target,idx){if(jah_targets[idx].readyState==4){if(jah_targets[idx].status==200){results=jah_targets[idx].responseText;document.getElementById(target).innerHTML=results}else{document.getElementById(target).innerHTML="Error:\n"+jah_targets[idx].statusText+" (status="+jah_targets[idx].status+", readyState="+jah_targets[idx].readyState+")"}}}function ahahRequest(url,target){if(window.XMLHttpRequest){req=new XMLHttpRequest();req.onreadystatechange=function(){ahahResponse(target)};req.open("GET",url,true);req.send(null)}else if(window.ActiveXObject){req=new ActiveXObject("Microsoft.XMLHTTP");if(req){req.onreadystatechange=function(){ahahResponse(target)};req.open("GET",url,true);req.send()}}}function ahahResponse(target){if(req.readyState==4){if(req.status==200||req.status==304){results=req.responseText;document.getElementById(target).innerHTML=results}else{document.getElementById(target).innerHTML="ahah error:\n"+req.status+' '+req.statusText}}}function sfjgetNewPostList(url,numbersurl,fixed){jQuery('#sfbarspinner').show();var targetID=document.getElementById("sfpostnumbers");if(targetID!=null){var newPostsUrl=numbersurl+"&target=newposts"+'&rnd='+new Date().getTime();jQuery('#sfpostnumbers').load(newPostsUrl)}if(fixed=='0'){var targetdiv='sfadminpostlist'}else{var targetdiv='sfadminpostlistfixed'}var dropdown=document.getElementById(targetdiv);if(dropdown.style.display=='block'){jQuery('#'+targetdiv).hide('normal',function(){dropdown.style.display="none"})}else{url=url+'&rnd='+new Date().getTime();jQuery('#'+targetdiv).load(url,function(){if(fixed){if(navigator.appName=="Microsoft Internet Explorer"){height=document.body.offsetHeight-80}else{height=window.outerHeight-80}jQuery('#'+targetdiv).css("max-height",height)}jQuery('#'+targetdiv).show('normal');dropdown.style.display="block"})}}function sfjmoderatePost(loadMsg,posturl,url,canRemove,postid,forumid,topicid,poststatus,action,refreshUrl){var spot=document.getElementById('sfmsgspot');spot.innerHTML='';jQuery('#sfmsgspot').fadeIn('fast');var thistopic='thistopic'+topicid;var topicrow='topicrow'+topicid;var modpostrowid='modpostrow'+topicid;var topics='tcount'+forumid;var posts='pcount'+topicid;var postsmod='pcountmod'+topicid;var postsord='pcountord'+topicid;var forumrow='forumrow'+forumid;var thispost='thispost'+postid;var thispostcon='thispostcon'+postid;var topicCount=document.getElementById(topics);var postcount=document.getElementById(posts);var postcountMod=document.getElementById(postsmod);var postcountOrd=document.getElementById(postsord);if((action!=2)||(action==2&&postcount.value==1)){topicCount.value--}if(action==2&&postcount.value!=1){var target1=document.getElementById(thispost);var target2=document.getElementById(thispostcon)}else{var target1=document.getElementById(modpostrowid);var target2=document.getElementById(topicrow)}var targetf=document.getElementById(forumrow);if(navigator.appName=="Microsoft Internet Explorer"){sfjopacity(target1.style,9,0,10,function(){sfjremoveIt(target1)});sfjopacity(target2.style,9,0,10,function(){sfjremoveIt(target2)});if(topicCount.value==0){sfjopacity(targetf.style,9,0,10,function(){sfjremoveIt(targetf)})}}else{sfjopacity(target1.style,199,0,10,function(){sfjhideIt(target1)});sfjopacity(target2.style,199,0,10,function(){sfjhideIt(target2)});if(topicCount.value==0){sfjopacity(targetf.style,99,0,10,function(){sfjhideIt(targetf)})}}url=url+'&rnd='+new Date().getTime();jQuery('#sfmsgspot').load(url,function(){var removeMod=new Number(0);var removeOrd=new Number(0);if(action==2){postcount.value--;if(poststatus==1){action=0;postcountMod.value--;removeMod=1}else{action=1;postcountOrd.value--;removeOrd=1}}else{removeMod=postcountMod.value;removeOrd=postcountOrd.value}if(canRemove){if(action==1||removeOrd!=0){var counter=document.getElementById('sfunread');var mastercount=parseInt(counter.innerHTML);if(isNaN(mastercount)){mastercount=0}else{mastercount=(mastercount-removeOrd)}counter.style.color='#ffffff';counter.innerHTML=mastercount}if(action==0||action==9||removeMod!=0){var counter=document.getElementById('sfmod');var mastercount=parseInt(counter.innerHTML);if(isNaN(mastercount)){mastercount=0}else{mastercount=(mastercount-removeMod)}counter.style.color='#ffffff';counter.innerHTML=mastercount}}if(document.getElementById('sfunread').innerHTML=='0'&&document.getElementById('sfmod').innerHTML=='0'){var mainDiv='#sfadminpostlist';var targetdiv=document.getElementById('sfadminpostlist');if(targetdiv==null){mainDiv='#sfadminpostlistfixed'}jQuery(mainDiv).fadeOut(3000)}var spot=document.getElementById('sfmsgspot');if(posturl!=''){spot.innerHTML=loadMsg;if(posturl==window.location){window.location.reload()}else{window.location=posturl}}else{jQuery('#sfmsgspot').fadeOut(6000,function(){})}})}function sfjsaveQuickReply(theForm,saveurl,modurl,postid,forumid,topicid,poststatus,action,refreshUrl,btnChange){var saveBtn=document.getElementById('sfsave'+topicid);saveBtn.value=btnChange;var mText=theForm.elements['postitem'+topicid].value;var cText=mText.replace(/\n/g,"<br />");cText=encodeURIComponent(cText);url=saveurl+"&status="+theForm.elements['statvalue'].value+"&watch="+theForm.elements['watchtopic'+topicid].checked+"&postitem="+cText;jQuery('#sfmsgspot').load(url,function(){sfjmoderatePost('','',modurl,'1',postid,forumid,topicid,poststatus,action,refreshUrl)});return false}function sfjremoveIt(target){target.style.height="0px";target.style.borderStyle="none";target.style.display="none"}function sfjhideIt(target){target.style.visibility="collapse";target.style.borderStyle="none";target.style.display="none"}function sfjcloseIt(target){target.style.display="none"}function sfjSelectCode(codeBlock){var e=document.getElementById(codeBlock);if(window.getSelection){var s=window.getSelection();if(s.setBaseAndExtent){s.setBaseAndExtent(e,0,e,e.innerText.length-1)}else{var r=document.createRange();r.selectNodeContents(e);s.removeAllRanges();s.addRange(r)}}else if(document.getSelection){var s=document.getSelection();var r=document.createRange();r.selectNodeContents(e);s.removeAllRanges();s.addRange(r)}else if(document.selection){var r=document.body.createTextRange();r.moveToElementText(e);r.select()}}function sfjSwitchProfile(active){jQuery('#sfprofilepersonal').hide();jQuery('#sftabpersonal').removeClass("sftbaron");jQuery('#sfprofileonline').hide();jQuery('#sftabonline').removeClass("sftbaron");jQuery('#sfprofileadditional').hide();jQuery('#sftabadditional').removeClass("sftbaron");jQuery('#sfprofileoptions').hide();jQuery('#sftaboptions').removeClass("sftbaron");jQuery('#sfprofilepassword').hide();jQuery('#sftabpassword').removeClass("sftbaron");jQuery('#sfprofileavatar').hide();jQuery('#sftabavatar').removeClass("sftbaron");jQuery('#sfprofilesignature').hide();jQuery('#sftabsignature').removeClass("sftbaron");jQuery('#sfprofilephotos').hide();jQuery('#sftabphotos').removeClass("sftbaron");jQuery('#sfprofile'+active).show();jQuery('#sftab'+active).addClass("sftbaron")}function sfjRemoveAvatar(ahahURL,avatarTarget,spinner){jQuery('#'+avatarTarget).html('<img src="'+spinner+'" />');jQuery('#'+avatarTarget).load(ahahURL);jQuery('#delavatar').hide();return}function sfjRemovePool(ahahURL,avatarTarget,spinner){jQuery('#'+avatarTarget).html('<img src="'+spinner+'" />');jQuery('#'+avatarTarget).load(ahahURL);jQuery('#delpool').hide();return}function sfjSelAvatar($file,$msg){document.getElementById('sfpoolavatar').value=$file;jQuery('#sf-pool-status').html('<p class="sf-upload-status-success">'+$msg+'</p>');return}function sfjTestExt(ext){extCheck=true;if(!(ext&&/^(jpg|png|jpeg|gif|JPG|PNG|JPEG|GIF)$/.test(ext)))extCheck=false;return extCheck}
;function sack(file){this.xmlhttp=null;this.resetData=function(){this.method="POST";this.queryStringSeparator="?";this.argumentSeparator="&";this.URLString="";this.encodeURIString=true;this.execute=false;this.element=null;this.elementObj=null;this.requestFile=file;this.vars=new Object();this.responseStatus=new Array(2)};this.resetFunctions=function(){this.onLoading=function(){};this.onLoaded=function(){};this.onInteractive=function(){};this.onCompletion=function(){};this.onError=function(){};this.onFail=function(){}};this.reset=function(){this.resetFunctions();this.resetData()};this.createAJAX=function(){try{this.xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(e1){try{this.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(e2){this.xmlhttp=null}}if(!this.xmlhttp){if(typeof XMLHttpRequest!="undefined"){this.xmlhttp=new XMLHttpRequest()}else{this.failed=true}}};this.setVar=function(name,value){this.vars[name]=Array(value,false)};this.encVar=function(name,value,returnvars){if(true==returnvars){return Array(encodeURIComponent(name),encodeURIComponent(value))}else{this.vars[encodeURIComponent(name)]=Array(encodeURIComponent(value),true)}};this.processURLString=function(string,encode){encoded=encodeURIComponent(this.argumentSeparator);regexp=new RegExp(this.argumentSeparator+"|"+encoded);varArray=string.split(regexp);for(i=0;i<varArray.length;i++){urlVars=varArray[i].split("=");if(true==encode){this.encVar(urlVars[0],urlVars[1])}else{this.setVar(urlVars[0],urlVars[1])}}};this.createURLString=function(urlstring){if(this.encodeURIString&&this.URLString.length){this.processURLString(this.URLString,true)}if(urlstring){if(this.URLString.length){this.URLString+=this.argumentSeparator+urlstring}else{this.URLString=urlstring}}this.setVar("rndval",new Date().getTime());urlstringtemp=new Array();for(key in this.vars){if(false==this.vars[key][1]&&true==this.encodeURIString){encoded=this.encVar(key,this.vars[key][0],true);delete this.vars[key];this.vars[encoded[0]]=Array(encoded[1],true);key=encoded[0]}urlstringtemp[urlstringtemp.length]=key+"="+this.vars[key][0]}if(urlstring){this.URLString+=this.argumentSeparator+urlstringtemp.join(this.argumentSeparator)}else{this.URLString+=urlstringtemp.join(this.argumentSeparator)}};this.runResponse=function(){eval(this.response)};this.runAJAX=function(urlstring){if(this.failed){this.onFail()}else{this.createURLString(urlstring);if(this.element){this.elementObj=document.getElementById(this.element)}if(this.xmlhttp){var self=this;if(this.method=="GET"){totalurlstring=this.requestFile+this.queryStringSeparator+this.URLString;this.xmlhttp.open(this.method,totalurlstring,true)}else{this.xmlhttp.open(this.method,this.requestFile,true);try{this.xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(e){}}this.xmlhttp.onreadystatechange=function(){switch(self.xmlhttp.readyState){case 1:self.onLoading();break;case 2:self.onLoaded();break;case 3:self.onInteractive();break;case 4:self.response=self.xmlhttp.responseText;self.responseXML=self.xmlhttp.responseXML;self.responseStatus[0]=self.xmlhttp.status;self.responseStatus[1]=self.xmlhttp.statusText;if(self.execute){self.runResponse()}if(self.elementObj){elemNodeName=self.elementObj.nodeName;elemNodeName.toLowerCase();if(elemNodeName=="input"||elemNodeName=="select"||elemNodeName=="option"||elemNodeName=="textarea"){self.elementObj.value=self.response}else{self.elementObj.innerHTML=self.response}}if(self.responseStatus[0]=="200"){self.onCompletion()}else{self.onError()}self.URLString="";break}};this.xmlhttp.send(this.URLString)}}};this.reset();this.createAJAX()};
;/*

 SoundManager 2: Javascript Sound for the Web
 --------------------------------------------
 http://schillmania.com/projects/soundmanager2/

 Copyright (c) 2007, Scott Schiller. All rights reserved.
 Code provided under the BSD License:
 http://schillmania.com/projects/soundmanager2/license.txt

 V2.96a.20100822
*/
(function(j){function ga(xa,ya){function ha(){if(b.debugURLParam.test(N))b.debugMode=true}this.flashVersion=8;this.debugFlash=this.debugMode=false;this.useConsole=true;this.waitForWindowLoad=this.consoleOnly=false;this.nullURL="about:blank";this.allowPolling=true;this.useFastPolling=false;this.useMovieStar=true;this.bgColor="#ffffff";this.useHighPerformance=false;this.flashLoadTimeout=1E3;this.wmode=null;this.allowFullScreen=true;this.allowScriptAccess="always";this.useHTML5Audio=this.useFlashBlock=
false;this.html5Test=/^probably$/i;this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:true},mp4:{related:["aac","m4a"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:true},ogg:{type:["audio/ogg; codecs=vorbis"],required:false},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:false}};this.defaultOptions={autoLoad:false,stream:true,
autoPlay:false,loops:1,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5E3,onbeforefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:200,multiShot:true,multiShotEvents:false,position:null,pan:0,type:null,volume:100};this.flash9Options={isMovieStar:null,usePeakData:false,useWaveformData:false,useEQData:false,onbufferchange:null,ondataerror:null};this.movieStarOptions=
{onmetadata:null,useVideo:false,bufferTime:3,serverURL:null,onconnect:null};this.version=null;this.versionNumber="V2.96a.20100822";this.movieURL=null;this.url=xa||null;this.altURL=null;this.enabled=this.swfLoaded=false;this.o=null;this.movieID="sm2-container";this.id=ya||"sm2movie";this.swfCSS={swfDefault:"movieContainer",swfError:"swf_error",swfTimedout:"swf_timedout",swfUnblocked:"swf_unblocked",sm2Debug:"sm2_debug",highPerf:"high_performance",flashDebug:"flash_debug"};this.oMC=null;this.sounds=
{};this.soundIDs=[];this.isFullScreen=this.muted=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.didFlashBlock=this.specialWmodeCase=false;this.filePattern=null;this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.baseMimeTypes=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.netStreamMimeTypes=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.netStreamTypes=
["aac","flv","mov","mp4","m4v","f4v","m4a","mp4v","3gp","3g2"];this.netStreamPattern=RegExp("\\.("+this.netStreamTypes.join("|")+")(\\?.*)?$","i");this.mimePattern=this.baseMimeTypes;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.hasHTML5=null;this.html5={usingFlash:null};this.ignoreFlash=false;var W,b=this,y,t=navigator.userAgent,N=j.location.href.toString(),k=this.flashVersion,ia,O,z=[],E=false,F=false,p=false,v=false,ja=false,G,q,ka,A,B,la,X,Y,w,ma,P,Q,H,Z,na,R,$,oa,pa,I,qa,J=null,aa=null,K,ba,L,S,ca,n,T=false,da=false,ra,sa,C=null,ta,U,x=false,M,u,ea,ua,va=t.match(/pre\//i),za=t.match(/(ipad|iphone)/i);t.match(/mobile/i);var fa=typeof document.hasFocus!=="undefined"?document.hasFocus():
null,D=typeof document.hasFocus==="undefined"&&this.isSafari,wa=!D;this._use_maybe=N.match(/sm2\-useHTML5Maybe\=1/i);this._overHTTP=document.location?document.location.protocol.match(/http/i):null;this.useAltURL=!this._overHTTP;if(za||va){b.useHTML5Audio=true;b.ignoreFlash=true}if(va||this._use_maybe)b.html5Test=/^(probably|maybe)$/i;this.supported=function(){return C?p&&!v:b.useHTML5Audio&&b.hasHTML5};this.getMovie=function(c){return b.isIE?j[c]:b.isSafari?y(c)||document[c]:y(c)};this.loadFromXML=
function(c){try{b.o._loadFromXML(c)}catch(a){I();return true}};this.createSound=function(c){function a(){f=S(f);b.sounds[e.id]=new W(e);b.soundIDs.push(e.id);return b.sounds[e.id]}var f=null,g=null,e=null;if(!p)throw ca("soundManager.createSound(): "+K("notReady"),arguments.callee.caller);if(arguments.length===2)c={id:arguments[0],url:arguments[1]};e=f=q(c);if(n(e.id,true))return b.sounds[e.id];if(U(e)){g=a();g._setup_html5(e)}else{if(k>8&&b.useMovieStar){if(e.isMovieStar===null)e.isMovieStar=e.serverURL||
(e.type?e.type.match(b.netStreamPattern):false)||e.url.match(b.netStreamPattern)?true:false;if(e.isMovieStar)if(e.usePeakData)e.usePeakData=false}g=a();if(k===8)b.o._createSound(e.id,e.onjustbeforefinishtime,e.loops||1);else{b.o._createSound(e.id,e.url,e.onjustbeforefinishtime,e.usePeakData,e.useWaveformData,e.useEQData,e.isMovieStar,e.isMovieStar?e.useVideo:false,e.isMovieStar?e.bufferTime:false,e.loops||1,e.serverURL,e.duration||null,e.totalBytes||null,e.autoPlay,true);if(!e.serverURL){g.connected=
true;e.onconnect&&e.onconnect.apply(g)}}}if(e.autoLoad||e.autoPlay)if(g)if(b.isHTML5){g.autobuffer="auto";g.preload="auto"}else g.load(e);e.autoPlay&&g.play();return g};this.createVideo=function(c){if(arguments.length===2)c={id:arguments[0],url:arguments[1]};if(k>=9){c.isMovieStar=true;c.useVideo=true}else return false;return b.createSound(c)};this.destroyVideo=this.destroySound=function(c,a){if(!n(c))return false;for(var f=0;f<b.soundIDs.length;f++)b.soundIDs[f]===c&&b.soundIDs.splice(f,1);b.sounds[c].unload();
a||b.sounds[c].destruct();delete b.sounds[c]};this.load=function(c,a){if(!n(c))return false;return b.sounds[c].load(a)};this.unload=function(c){if(!n(c))return false;return b.sounds[c].unload()};this.start=this.play=function(c,a){if(!p)throw ca("soundManager.play(): "+K("notReady"),arguments.callee.caller);if(!n(c)){a instanceof Object||(a={url:a});if(a&&a.url){a.id=c;return b.createSound(a).play()}else return false}return b.sounds[c].play(a)};this.setPosition=function(c,a){if(!n(c))return false;
return b.sounds[c].setPosition(a)};this.stop=function(c){if(!n(c))return false;return b.sounds[c].stop()};this.stopAll=function(){for(var c in b.sounds)b.sounds[c]instanceof W&&b.sounds[c].stop()};this.pause=function(c){if(!n(c))return false;return b.sounds[c].pause()};this.pauseAll=function(){for(var c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].pause()};this.resume=function(c){if(!n(c))return false;return b.sounds[c].resume()};this.resumeAll=function(){for(var c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].resume()};
this.togglePause=function(c){if(!n(c))return false;return b.sounds[c].togglePause()};this.setPan=function(c,a){if(!n(c))return false;return b.sounds[c].setPan(a)};this.setVolume=function(c,a){if(!n(c))return false;return b.sounds[c].setVolume(a)};this.mute=function(c){var a=0;if(typeof c!=="string")c=null;if(c){if(!n(c))return false;return b.sounds[c].mute()}else{for(a=b.soundIDs.length;a--;)b.sounds[b.soundIDs[a]].mute();b.muted=true}};this.muteAll=function(){b.mute()};this.unmute=function(c){if(typeof c!==
"string")c=null;if(c){if(!n(c))return false;return b.sounds[c].unmute()}else{for(c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].unmute();b.muted=false}};this.unmuteAll=function(){b.unmute()};this.toggleMute=function(c){if(!n(c))return false;return b.sounds[c].toggleMute()};this.getMemoryUse=function(){if(k===8)return 0;if(b.o)return parseInt(b.o._getMemoryUse(),10)};this.disable=function(c){if(typeof c==="undefined")c=false;if(v)return false;v=true;for(var a=b.soundIDs.length;a--;)pa(b.sounds[b.soundIDs[a]]);
G(c);j.removeEventListener&&j.removeEventListener("load",B,false)};this.canPlayMIME=function(c){var a;if(b.hasHTML5)a=M({type:c});return!C||a?a:c?c.match(b.mimePattern)?true:false:null};this.canPlayURL=function(c){var a;if(b.hasHTML5)a=M(c);return!C||a?a:c?c.match(b.filePattern)?true:false:null};this.canPlayLink=function(c){if(typeof c.type!=="undefined"&&c.type)if(b.canPlayMIME(c.type))return true;return b.canPlayURL(c.href)};this.getSoundById=function(c){if(!c)throw Error("SoundManager.getSoundById(): sID is null/undefined");
return b.sounds[c]};this.onready=function(c,a){if(c&&c instanceof Function){a||(a=j);ka(c,a);A();return true}else throw K("needFunction");};this.oninitmovie=function(){};this.onload=function(){};this.onerror=function(){};this.getMoviePercent=function(){return b.o&&typeof b.o.PercentLoaded!=="undefined"?b.o.PercentLoaded():null};this._wD=this._writeDebug=function(){};this._debug=function(){};this.reboot=function(){for(var c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].destruct();try{if(b.isIE)aa=
b.o.innerHTML;J=b.o.parentNode.removeChild(b.o)}catch(a){}J=aa=null;v=F=E=da=T=p=b.enabled=false;b.swfLoaded=false;b.soundIDs=[];b.sounds=[];b.o=null;for(c=z.length;c--;)z[c].fired=false;j.setTimeout(function(){b.beginDelayedInit()},20)};this.destruct=function(){b.disable(true)};this.beginDelayedInit=function(){ja=true;H();setTimeout(X,500);setTimeout(ma,20)};U=function(c){return(c.type?M({type:c.type}):false)||M(c.url)};M=function(c){if(!b.useHTML5Audio||!b.hasHTML5)return false;var a,f=b.audioFormats;
if(!u){u=[];for(a in f)if(f.hasOwnProperty(a)){u.push(a);if(f[a].related)u=u.concat(f[a].related)}u=RegExp("\\.("+u.join("|")+")","i")}a=typeof c.type!=="undefined"?c.type:null;c=typeof c==="string"?c.toLowerCase().match(u):null;if(!c||!c.length){if(!a)return false}else c=c[0].substr(1);if(c&&typeof b.html5[c]!=="undefined")return b.html5[c];else{if(!a)if(c&&b.html5[c])return b.html5[c];else a="audio/"+c;a=b.html5.canPlayType(a);return b.html5[c]=a}};ua=function(){function c(l){var h,d,i=false;if(!a||
typeof a.canPlayType!=="function")return false;if(l instanceof Array){h=0;for(d=l.length;h<d&&!i;h++)if(b.html5[l[h]]||a.canPlayType(l[h]).match(b.html5Test)){i=true;b.html5[l[h]]=true}return i}else return(l=a&&typeof a.canPlayType==="function"?a.canPlayType(l):false)&&(l.match(b.html5Test)?true:false)}if(!b.useHTML5Audio||typeof Audio==="undefined")return false;var a=typeof Audio!=="undefined"?new Audio:null,f,g={},e,o;e=b.audioFormats;for(f in e)if(e.hasOwnProperty(f)){g[f]=c(e[f].type);if(e[f]&&
e[f].related)for(o=0;o<e[f].related.length;o++)b.html5[e[f].related[o]]=g[f]}g.canPlayType=a?c:null;b.html5=q(b.html5,g)};P={};y=function(c){return document.getElementById(c)};K=function(){var c=Array.prototype.slice.call(arguments),a=c.shift();a=P&&P[a]?P[a]:"";var f,g;if(a&&c&&c.length){f=0;for(g=c.length;f<g;f++)a=a.replace("%s",c[f])}return a};S=function(c){if(k===8&&c.loops>1&&c.stream)c.stream=false;return c};ca=function(c,a){var f;if(!a)return Error("Error: "+c);typeof console!=="undefined"&&
typeof console.trace!=="undefined"&&console.trace();f="Error: "+c+". \nCaller: "+a.toString();return Error(f)};ia=function(){return false};pa=function(c){for(var a in c)if(c.hasOwnProperty(a)&&typeof c[a]==="function")c[a]=ia};I=function(c){if(typeof c==="undefined")c=false;if(v||c)b.disable(c)};qa=function(c){var a=null;if(c)if(c.match(/\.swf(\?\.*)?$/i)){if(a=c.substr(c.toLowerCase().lastIndexOf(".swf?")+4))return c}else if(c.lastIndexOf("/")!==c.length-1)c+="/";return(c&&c.lastIndexOf("/")!==-1?
c.substr(0,c.lastIndexOf("/")+1):"./")+b.movieURL};Y=function(){if(k!==8&&k!==9)b.flashVersion=8;var c=b.debugMode||b.debugFlash?"_debug.swf":".swf";if(b.flashVersion<9&&b.useHTML5Audio&&b.audioFormats.mp4.required)b.flashVersion=9;k=b.flashVersion;b.version=b.versionNumber+(x?" (HTML5-only mode)":k===9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(k>8){b.defaultOptions=q(b.defaultOptions,b.flash9Options);b.features.buffering=true}if(k>8&&b.useMovieStar){b.defaultOptions=q(b.defaultOptions,b.movieStarOptions);
b.filePatterns.flash9=RegExp("\\.(mp3|"+b.netStreamTypes.join("|")+")(\\?.*)?$","i");b.mimePattern=b.netStreamMimeTypes;b.features.movieStar=true}else b.features.movieStar=false;b.filePattern=b.filePatterns[k!==8?"flash9":"flash8"];b.movieURL=(k===8?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",c);b.features.peakData=b.features.waveformData=b.features.eqData=k>8};na=function(){return document.body?document.body:document.documentElement?document.documentElement:document.getElementsByTagName("div")[0]};
oa=function(c,a){if(!b.o||!b.allowPolling)return false;b.o._setPolling(c,a)};$=function(){function c(){f.left=j.scrollX+"px";f.top=j.scrollY+"px"}function a(g){g=j[(g?"add":"remove")+"EventListener"];g("resize",c,false);g("scroll",c,false)}var f=null;return{check:function(g){f=b.oMC.style;if(t.match(/android/i)){if(g){if(b.flashLoadTimeout)b._s.flashLoadTimeout=0;return false}f.position="absolute";f.left=f.top="0px";a(true);b.onready(function(){a(false);if(f)f.left=f.top="-9999px"});c()}}}}();R=function(c,
a){var f=a?a:b.url,g=b.altURL?b.altURL:f,e,o,l,h;c=typeof c==="undefined"?b.id:c;if(E&&F)return false;if(x){Y();b.oMC=y(b.movieID);O();F=E=true;return false}E=true;Y();b.url=qa(this._overHTTP?f:g);a=b.url;if(b.useHighPerformance&&b.useMovieStar&&b.defaultOptions.useVideo===true)b.useHighPerformance=false;b.wmode=!b.wmode&&b.useHighPerformance&&!b.useMovieStar?"transparent":b.wmode;if(b.wmode!==null&&!b.isIE&&!b.useHighPerformance&&navigator.platform.match(/win32/i)){b.specialWmodeCase=true;b.wmode=
null}if(k===8)b.allowFullScreen=false;g={name:c,id:c,src:a,width:"100%",height:"100%",quality:"high",allowScriptAccess:b.allowScriptAccess,bgcolor:b.bgColor,pluginspage:"http://www.macromedia.com/go/getflashplayer",type:"application/x-shockwave-flash",wmode:b.wmode,allowFullScreen:b.allowFullScreen?"true":"false"};if(b.debugFlash)g.FlashVars="debug=1";b.wmode||delete g.wmode;if(b.isIE){f=document.createElement("div");o='<object id="'+c+'" data="'+a+'" type="'+g.type+'" width="'+g.width+'" height="'+
g.height+'"><param name="movie" value="'+a+'" /><param name="AllowScriptAccess" value="'+b.allowScriptAccess+'" /><param name="quality" value="'+g.quality+'" />'+(b.wmode?'<param name="wmode" value="'+b.wmode+'" /> ':"")+'<param name="bgcolor" value="'+b.bgColor+'" /><param name="allowFullScreen" value="'+g.allowFullScreen+'" />'+(b.debugFlash?'<param name="FlashVars" value="'+g.FlashVars+'" />':"")+"<!-- --\></object>"}else{f=document.createElement("embed");for(e in g)g.hasOwnProperty(e)&&f.setAttribute(e,
g[e])}ha();g=L();if(e=na()){b.oMC=y(b.movieID)?y(b.movieID):document.createElement("div");if(b.oMC.id){e=b.oMC.className;b.oMC.className=(e?e+" ":b.swfCSS.swfDefault)+(g?" "+g:"");b.oMC.appendChild(f);if(b.isIE){g=b.oMC.appendChild(document.createElement("div"));g.className="sm2-object-box";g.innerHTML=o}F=true;$.check(true)}else{b.oMC.id=b.movieID;b.oMC.className=b.swfCSS.swfDefault+" "+g;g=l=null;b.useFlashBlock||(l=b.useHighPerformance?{position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",
overflow:"hidden"}:{position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"});if(t.match(/webkit/i))b.oMC.style.zIndex=1E4;h=null;if(!b.debugFlash)for(h in l)if(l.hasOwnProperty(h))b.oMC.style[h]=l[h];try{b.isIE||b.oMC.appendChild(f);e.appendChild(b.oMC);if(b.isIE){g=b.oMC.appendChild(document.createElement("div"));g.className="sm2-object-box";g.innerHTML=o}F=true}catch(d){throw Error(K("appXHTML"));}$.check()}}};n=this.getSoundById;q=function(c,a){var f={},g,e;for(g in c)if(c.hasOwnProperty(g))f[g]=
c[g];g=typeof a==="undefined"?b.defaultOptions:a;for(e in g)if(g.hasOwnProperty(e)&&typeof f[e]==="undefined")f[e]=g[e];return f};Q=function(){if(x){R();return false}if(b.o)return false;b.o=b.getMovie(b.id);if(!b.o){if(J){if(b.isIE)b.oMC.innerHTML=aa;else b.oMC.appendChild(J);J=null;E=true}else R(b.id,b.url);b.o=b.getMovie(b.id)}typeof b.oninitmovie==="function"&&setTimeout(b.oninitmovie,1)};la=function(c){if(c)b.url=c;Q()};X=function(){if(T)return false;T=true;if(D&&!fa)return false;var c;p||(c=
b.getMoviePercent());setTimeout(function(){c=b.getMoviePercent();if(!p&&wa)if(c===null)if(b.useFlashBlock||b.flashLoadTimeout===0)b.useFlashBlock&&ba();else I(true);else b.flashLoadTimeout!==0&&I(true)},b.flashLoadTimeout)};L=function(){var c=[];b.debugMode&&c.push(b.swfCSS.sm2Debug);b.debugFlash&&c.push(b.swfCSS.flashDebug);b.useHighPerformance&&c.push(b.swfCSS.highPerf);return c.join(" ")};ba=function(){var c=b.getMoviePercent();if(b.supported()){if(b.oMC)b.oMC.className=L()+" "+b.swfCSS.swfDefault+
(" "+b.swfCSS.swfUnblocked)}else{if(C)b.oMC.className=L()+" "+b.swfCSS.swfDefault+" "+(c===null?b.swfCSS.swfTimedout:b.swfCSS.swfError);b.didFlashBlock=true;A(true);b.onerror instanceof Function&&b.onerror.apply(j)}};w=function(){if(fa||!D)return true;fa=wa=true;D&&j.removeEventListener("mousemove",w,false);T=false;setTimeout(X,500);if(j.removeEventListener)j.removeEventListener("focus",w,false);else j.detachEvent&&j.detachEvent("onfocus",w)};G=function(c){if(p)return false;if(x){p=true;A();B();return true}b.useFlashBlock&&
b.flashLoadTimeout&&!b.getMoviePercent()||(p=true);if(v||c){if(b.useFlashBlock)b.oMC.className=L()+" "+(b.getMoviePercent()===null?b.swfCSS.swfTimedout:b.swfCSS.swfError);A();b.onerror instanceof Function&&b.onerror.apply(j);return false}if(b.waitForWindowLoad&&!ja){if(j.addEventListener)j.addEventListener("load",B,false);else j.attachEvent&&j.attachEvent("onload",B);return false}else B()};ka=function(c,a){z.push({method:c,scope:a||null,fired:false})};A=function(c){if(!p&&!c)return false;c={success:c?
b.supported():!v};var a=[],f,g,e=!b.useFlashBlock||b.useFlashBlock&&!b.supported();f=0;for(g=z.length;f<g;f++)z[f].fired!==true&&a.push(z[f]);if(a.length){f=0;for(g=a.length;f<g;f++){a[f].scope?a[f].method.apply(a[f].scope,[c]):a[f].method(c);if(!e)a[f].fired=true}}};B=function(){j.setTimeout(function(){b.useFlashBlock&&ba();A();b.onload.apply(j)},1)};ta=function(){var c,a,f=!N.match(/usehtml5audio/i)&&!N.match(/sm2\-ignorebadua/i)&&b.isSafari&&t.match(/OS X 10_6_(3|4)/i)&&t.match(/(531\.22\.7|533\.16|533\.17\.8)/i);
if(t.match(/iphone os (1|2|3_0|3_1)/i)?true:false){b.hasHTML5=false;x=true;if(b.oMC)b.oMC.style.display="none";return false}if(b.useHTML5Audio){if(!b.html5||!b.html5.canPlayType){b.hasHTML5=false;return true}else b.hasHTML5=true;if(f){b.useHTML5Audio=false;b.hasHTML5=false;return true}}else return true;for(a in b.audioFormats)if(b.audioFormats.hasOwnProperty(a))if(b.audioFormats[a].required&&!b.html5.canPlayType(b.audioFormats[a].type))c=true;if(b.ignoreFlash)c=false;x=b.useHTML5Audio&&b.hasHTML5&&
!c;return c};O=function(){function c(){if(j.removeEventListener)j.removeEventListener("load",b.beginDelayedInit,false);else j.detachEvent&&j.detachEvent("onload",b.beginDelayedInit)}var a,f=[];if(p)return false;if(b.hasHTML5)for(a in b.audioFormats)b.audioFormats.hasOwnProperty(a)&&f.push(a+": "+b.html5[a]);if(x){if(!p){c();b.enabled=true;G()}return true}Q();try{b.o._externalInterfaceTest(false);if(b.allowPolling)oa(true,b.useFastPolling?true:false);b.debugMode||b.o._disableDebug();b.enabled=true}catch(g){I(true);
G();return false}G();c()};ma=function(){if(da)return false;R();Q();return da=true};H=function(){if(Z)return false;Z=true;ha();ua();b.html5.usingFlash=ta();C=b.html5.usingFlash;Z=true;la()};ra=function(c){if(!c._hasTimer)c._hasTimer=true};sa=function(c){if(c._hasTimer)c._hasTimer=false};this._setSandboxType=function(c){var a=b.sandbox;a.type=c;a.description=a.types[typeof a.types[c]!=="undefined"?c:"unknown"];if(a.type==="localWithFile"){a.noRemote=true;a.noLocal=false}else if(a.type==="localWithNetwork"){a.noRemote=
false;a.noLocal=true}else if(a.type==="localTrusted"){a.noRemote=false;a.noLocal=false}};this._externalInterfaceOK=function(){if(b.swfLoaded)return false;(new Date).getTime();b.swfLoaded=true;D=false;b.isIE?setTimeout(O,100):O()};this._onfullscreenchange=function(c){b.isFullScreen=c===1?true:false;if(!b.isFullScreen)try{j.focus()}catch(a){}};W=function(c){var a=this,f,g,e,o,l,h;this.sID=c.id;this.url=c.url;this._iO=this.instanceOptions=this.options=q(c);this.pan=this.options.pan;this.volume=this.options.volume;
this._lastURL=null;this.isHTML5=false;this.id3={};this._debug=function(){};this._debug();this.load=function(d){var i=null;if(typeof d!=="undefined"){a._iO=q(d);a.instanceOptions=a._iO}else{d=a.options;a._iO=d;a.instanceOptions=a._iO;if(a._lastURL&&a._lastURL!==a.url){a._iO.url=a.url;a.url=null}}if(a._iO.url===a.url&&a.readyState!==0&&a.readyState!==2)return a;a._lastURL=a.url;a.loaded=false;a.readyState=1;a.playState=0;if(U(a._iO)){i=a._setup_html5(a._iO);i.load();a._iO.autoPlay&&a.play()}else try{a.isHTML5=
false;a._iO=S(a._iO);if(k===8)b.o._load(a.sID,a._iO.url,a._iO.stream,a._iO.autoPlay,a._iO.whileloading?1:0,a._iO.loops||1);else{b.o._load(a.sID,a._iO.url,a._iO.stream?true:false,a._iO.autoPlay?true:false,a._iO.loops||1);a._iO.isMovieStar&&a._iO.autoLoad&&!a._iO.autoPlay&&a.pause()}}catch(m){b.onerror();b.disable()}return a};this.unload=function(){if(a.readyState!==0){a.readyState!==2&&a.setPosition(0,true);if(a.isHTML5){e();if(h){h.pause();h.src=b.nullURL;h.load();h=a._audio=null}}else if(k===8)b.o._unload(a.sID,
b.nullURL);else{a.setAutoPlay(false);b.o._unload(a.sID)}f()}return a};this.destruct=function(){if(a.isHTML5){e();if(h){h.pause();h.src="about:blank";h.load();h=a._audio=null}}else{a._iO.onfailure=null;b.o._destroySound(a.sID)}b.destroySound(a.sID,true)};this.start=this.play=function(d){d||(d={});a._iO=q(d,a._iO);a._iO=q(a._iO,a.options);a.instanceOptions=a._iO;if(a._iO.serverURL)if(!a.connected){a.setAutoPlay(true);return a}if(U(a._iO)){a._setup_html5(a._iO);o()}if(a.playState===1)if(d=a._iO.multiShot)a.isHTML5&&
a.setPosition(a._iO.position);else return a;if(!a.loaded)if(a.readyState===0)if(a.isHTML5){a.load(a._iO);a.readyState=1}else{if(!a._iO.serverURL){a._iO.autoPlay=true;a.load(a._iO)}}else if(a.readyState===2)return a;if(a.paused&&a.position!==null)a.resume();else{a.playState=1;a.paused=false;if(!a.instanceCount||k>8&&!a.isHTML5)a.instanceCount++;a.position=typeof a._iO.position!=="undefined"&&!isNaN(a._iO.position)?a._iO.position:0;a._iO=S(a._iO);a._iO.onplay&&a._iO.onplay.apply(a);a.setVolume(a._iO.volume,
true);a.setPan(a._iO.pan,true);if(a.isHTML5){o();a._setup_html5().play()}else{k===9&&a._iO.serverURL&&a.setAutoPlay(true);b.o._start(a.sID,a._iO.loops||1,k===9?a.position:a.position/1E3)}}return a};this.stop=function(d){if(a.playState===1){a._onbufferchange(0);a.resetOnPosition(0);if(!a.isHTML5)a.playState=0;a.paused=false;a._iO.onstop&&a._iO.onstop.apply(a);if(a.isHTML5){if(h){a.setPosition(0);h.pause();a.playState=0;a._onTimer();e();a.unload()}}else{b.o._stop(a.sID,d);a._iO.serverURL&&a.unload()}a.instanceCount=
0;a._iO={}}return a};this.setAutoPlay=function(d){a._iO.autoPlay=d;b.o._setAutoPlay(a.sID,d);if(d)a.instanceCount||a.instanceCount++};this.setPosition=function(d){if(typeof d==="undefined")d=0;a._iO.position=a.isHTML5?Math.max(d,0):Math.min(a.duration,Math.max(d,0));a.resetOnPosition(a._iO.position);if(a.isHTML5){if(h){if(a.playState)try{h.currentTime=a._iO.position/1E3}catch(i){}if(a.paused){a._onTimer(true);a._iO.useMovieStar&&a.resume()}}}else b.o._setPosition(a.sID,k===9?a._iO.position:a._iO.position/
1E3,a.paused||!a.playState);return a};this.pause=function(d){if(a.paused||a.playState===0&&a.readyState!==1)return a;a.paused=true;if(a.isHTML5){a._setup_html5().pause();e()}else if(d||d===undefined)b.o._pause(a.sID);a._iO.onpause&&a._iO.onpause.apply(a);return a};this.resume=function(){if(!a.paused||a.playState===0)return a;a.paused=false;a.playState=1;if(a.isHTML5){a._setup_html5().play();o()}else b.o._pause(a.sID);a._iO.onresume&&a._iO.onresume.apply(a);return a};this.togglePause=function(){if(a.playState===
0){a.play({position:k===9&&!a.isHTML5?a.position:a.position/1E3});return a}a.paused?a.resume():a.pause();return a};this.setPan=function(d,i){if(typeof d==="undefined")d=0;if(typeof i==="undefined")i=false;a.isHTML5||b.o._setPan(a.sID,d);a._iO.pan=d;if(!i)a.pan=d;return a};this.setVolume=function(d,i){if(typeof d==="undefined")d=100;if(typeof i==="undefined")i=false;if(a.isHTML5){if(h)h.volume=d/100}else b.o._setVolume(a.sID,b.muted&&!a.muted||a.muted?0:d);a._iO.volume=d;if(!i)a.volume=d;return a};
this.mute=function(){a.muted=true;if(a.isHTML5){if(h)h.muted=true}else b.o._setVolume(a.sID,0);return a};this.unmute=function(){a.muted=false;var d=typeof a._iO.volume!=="undefined";if(a.isHTML5){if(h)h.muted=false}else b.o._setVolume(a.sID,d?a._iO.volume:a.options.volume);return a};this.toggleMute=function(){return a.muted?a.unmute():a.mute()};this.onposition=function(d,i,m){a._onPositionItems.push({position:d,method:i,scope:typeof m!=="undefined"?m:a,fired:false});return a};this.processOnPosition=
function(){var d,i;d=a._onPositionItems.length;if(!d||!a.playState||a._onPositionFired>=d)return false;for(d=d;d--;){i=a._onPositionItems[d];if(!i.fired&&a.position>=i.position){i.method.apply(i.scope,[i.position]);i.fired=true;b._onPositionFired++}}};this.resetOnPosition=function(d){var i,m;i=a._onPositionItems.length;if(!i)return false;for(i=i;i--;){m=a._onPositionItems[i];if(m.fired&&d<=m.position){m.fired=false;b._onPositionFired--}}};this._onTimer=function(d){if(a._hasTimer||d)if(h&&(d||(a.playState>
0||a.readyState===1)&&!a.paused)){a.duration=l();a.durationEstimate=a.duration;d=h.currentTime?h.currentTime*1E3:0;a._whileplaying(d,{},{},{},{});return true}else return false};l=function(){var d=h?h.duration*1E3:undefined;if(d)return!isNaN(d)?d:null};o=function(){a.isHTML5&&ra(a)};e=function(){a.isHTML5&&sa(a)};f=function(){a._onPositionItems=[];a._onPositionFired=0;a._hasTimer=null;a._added_events=null;h=a._audio=null;a.bytesLoaded=null;a.bytesTotal=null;a.position=null;a.duration=null;a.durationEstimate=
null;a.failures=0;a.loaded=false;a.playState=0;a.paused=false;a.readyState=0;a.muted=false;a.didBeforeFinish=false;a.didJustBeforeFinish=false;a.isBuffering=false;a.instanceOptions={};a.instanceCount=0;a.peakData={left:0,right:0};a.waveformData={left:[],right:[]};a.eqData=[];a.eqData.left=[];a.eqData.right=[]};f();this._setup_html5=function(d){d=q(a._iO,d);if(h){if(a.url!==d.url)h.src=d.url}else{a._audio=new Audio(d.url);h=a._audio;a.isHTML5=true;g()}h.loop=d.loops>1?"loop":"";return a._audio};g=
function(){function d(i,m,r){return h?h.addEventListener(i,m,r||false):null}if(a._added_events)return false;a._added_events=true;d("load",function(){if(h){a._onbufferchange(0);a._whileloading(a.bytesTotal,a.bytesTotal,l());a._onload(1)}},false);d("canplay",function(){a._onbufferchange(0)},false);d("waiting",function(){a._onbufferchange(1)},false);d("progress",function(i){if(!a.loaded&&h){a._onbufferchange(0);a._whileloading(i.loaded||0,i.total||1,l())}},false);d("error",function(){h&&a._onload(0)},
false);d("loadstart",function(){a._onbufferchange(1)},false);d("play",function(){a._onbufferchange(0)},false);d("playing",function(){a._onbufferchange(0)},false);d("timeupdate",function(){a._onTimer()},false);setTimeout(function(){a&&h&&d("ended",function(){a._onfinish()},false)},250)};this._whileloading=function(d,i,m,r){a.bytesLoaded=d;a.bytesTotal=i;a.duration=Math.floor(m);if(a._iO.isMovieStar){a.durationEstimate=a.duration;a.readyState!==3&&a._iO.whileloading&&a._iO.whileloading.apply(a)}else{a.durationEstimate=
parseInt(a.bytesTotal/a.bytesLoaded*a.duration,10);if(a.durationEstimate===undefined)a.durationEstimate=a.duration;a.bufferLength=r;if((a._iO.isMovieStar||a.readyState!==3)&&a._iO.whileloading)a._iO.whileloading.apply(a)}};this._onid3=function(d,i){var m=[],r,s;r=0;for(s=d.length;r<s;r++)m[d[r]]=i[r];a.id3=q(a.id3,m);a._iO.onid3&&a._iO.onid3.apply(a)};this._whileplaying=function(d,i,m,r,s){if(isNaN(d)||d===null)return false;if(a.playState===0&&d>0)d=0;a.position=d;a.processOnPosition();if(k>8&&!a.isHTML5){if(a._iO.usePeakData&&
typeof i!=="undefined"&&i)a.peakData={left:i.leftPeak,right:i.rightPeak};if(a._iO.useWaveformData&&typeof m!=="undefined"&&m)a.waveformData={left:m.split(","),right:r.split(",")};if(a._iO.useEQData)if(typeof s!=="undefined"&&s&&s.leftEQ){d=s.leftEQ.split(",");a.eqData=d;a.eqData.left=d;if(typeof s.rightEQ!=="undefined"&&s.rightEQ)a.eqData.right=s.rightEQ.split(",")}}if(a.playState===1){!a.isHTML5&&a.isBuffering&&a._onbufferchange(0);a._iO.whileplaying&&a._iO.whileplaying.apply(a);if((a.loaded||!a.loaded&&
a._iO.isMovieStar)&&a._iO.onbeforefinish&&a._iO.onbeforefinishtime&&!a.didBeforeFinish&&a.duration-a.position<=a._iO.onbeforefinishtime)a._onbeforefinish()}};this._onconnect=function(d){d=d===1;if(a.connected=d){a.failures=0;if(a._iO.autoLoad||a._iO.autoPlay)a.load(a._iO);a._iO.autoPlay&&a.play();a._iO.onconnect&&a._iO.onconnect.apply(a,[d])}};this._onload=function(d){d=d===1?true:false;a.loaded=d;a.readyState=d?3:2;a._iO.onload&&a._iO.onload.apply(a)};this._onfailure=function(d){a.failures++;a._iO.onfailure&&
a.failures===1&&a._iO.onfailure(a,d)};this._onbeforefinish=function(){if(!a.didBeforeFinish){a.didBeforeFinish=true;a._iO.onbeforefinish&&a._iO.onbeforefinish.apply(a)}};this._onjustbeforefinish=function(){if(!a.didJustBeforeFinish){a.didJustBeforeFinish=true;a._iO.onjustbeforefinish&&a._iO.onjustbeforefinish.apply(a)}};this._onfinish=function(){a._onbufferchange(0);a.resetOnPosition(0);a._iO.onbeforefinishcomplete&&a._iO.onbeforefinishcomplete.apply(a);a.didBeforeFinish=false;a.didJustBeforeFinish=
false;if(a.instanceCount){a.instanceCount--;if(!a.instanceCount){a.playState=0;a.paused=false;a.instanceCount=0;a.instanceOptions={};e()}if(!a.instanceCount||a._iO.multiShotEvents)if(a._iO.onfinish)a._iO.onfinish.apply(a);else a.isHTML5&&a.unload()}};this._onmetadata=function(d){if(!d.width&&!d.height){d.width=320;d.height=240}a.metadata=d;a.width=d.width;a.height=d.height;a._iO.onmetadata&&a._iO.onmetadata.apply(a)};this._onbufferchange=function(d){if(a.playState===0)return false;if(d&&a.isBuffering||
!d&&!a.isBuffering)return false;a.isBuffering=d===1?true:false;a._iO.onbufferchange&&a._iO.onbufferchange.apply(a)};this._ondataerror=function(){a.playState>0&&a._iO.ondataerror&&a._iO.ondataerror.apply(a)}};if(!b.hasHTML5||C)if(j.addEventListener){j.addEventListener("focus",w,false);j.addEventListener("load",b.beginDelayedInit,false);j.addEventListener("unload",b.destruct,false);D&&j.addEventListener("mousemove",w,false)}else if(j.attachEvent){j.attachEvent("onfocus",w);j.attachEvent("onload",b.beginDelayedInit);
j.attachEvent("unload",b.destruct)}else{V.onerror();V.disable()}ea=function(){if(document.readyState==="complete"){H();document.detachEvent("onreadystatechange",ea)}};if(document.addEventListener)document.addEventListener("DOMContentLoaded",H,false);else document.attachEvent&&document.attachEvent("onreadystatechange",ea);document.readyState==="complete"&&setTimeout(H,100)}var V=null;if(typeof SM2_DEFER==="undefined"||!SM2_DEFER)V=new ga;j.SoundManager=ga;j.soundManager=V})(window);

;//General functions for a lot of plugins
//Returns true if the email is well formed
function check_email( cadena ) {
	var answer=false;
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/;
	if (filter.test(cadena)) {
		answer=true;
	}
	return answer;
}

//Returns true if there is an email is in the text	
function email_intext ( cadena ) {
	var answer=false;
	var emailsArray = cadena.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi);
	if (emailsArray)
		answer=true;
	return answer;
}

;Encoder = {

	// When encoding do we convert characters into html or numerical entities
	EncodeType : "entity",  // entity OR numerical

	isEmpty : function(val){
		if(val){
			return ((val===null) || val.length==0 || /^\s+$/.test(val));
		}else{
			return true;
		}
	},
	// Convert HTML entities into numerical entities
	HTML2Numerical : function(s){
		var arr1 = new Array('&nbsp;','&iexcl;','&cent;','&pound;','&curren;','&yen;','&brvbar;','&sect;','&uml;','&copy;','&ordf;','&laquo;','&not;','&shy;','&reg;','&macr;','&deg;','&plusmn;','&sup2;','&sup3;','&acute;','&micro;','&para;','&middot;','&cedil;','&sup1;','&ordm;','&raquo;','&frac14;','&frac12;','&frac34;','&iquest;','&agrave;','&aacute;','&acirc;','&atilde;','&Auml;','&aring;','&aelig;','&ccedil;','&egrave;','&eacute;','&ecirc;','&euml;','&igrave;','&iacute;','&icirc;','&iuml;','&eth;','&ntilde;','&ograve;','&oacute;','&ocirc;','&otilde;','&Ouml;','&times;','&Oslash;','&ugrave;','&uacute;','&ucirc;','&Uuml;','&yacute;','&thorn;','&szlig;','&agrave;','&aacute;','&acirc;','&atilde;','&auml;','&aring;','&aelig;','&ccedil;','&egrave;','&eacute;','&ecirc;','&euml;','&igrave;','&iacute;','&icirc;','&iuml;','&eth;','&ntilde;','&ograve;','&oacute;','&ocirc;','&otilde;','&ouml;','&divide;','&oslash;','&ugrave;','&uacute;','&ucirc;','&uuml;','&yacute;','&thorn;','&yuml;','&quot;','&amp;','&lt;','&gt;','&oelig;','&oelig;','&scaron;','&scaron;','&yuml;','&circ;','&tilde;','&ensp;','&emsp;','&thinsp;','&zwnj;','&zwj;','&lrm;','&rlm;','&ndash;','&mdash;','&lsquo;','&rsquo;','&sbquo;','&ldquo;','&rdquo;','&bdquo;','&dagger;','&dagger;','&permil;','&lsaquo;','&rsaquo;','&euro;','&fnof;','&alpha;','&beta;','&gamma;','&delta;','&epsilon;','&zeta;','&eta;','&theta;','&iota;','&kappa;','&lambda;','&mu;','&nu;','&xi;','&omicron;','&pi;','&rho;','&sigma;','&tau;','&upsilon;','&phi;','&chi;','&psi;','&omega;','&alpha;','&beta;','&gamma;','&delta;','&epsilon;','&zeta;','&eta;','&theta;','&iota;','&kappa;','&lambda;','&mu;','&nu;','&xi;','&omicron;','&pi;','&rho;','&sigmaf;','&sigma;','&tau;','&upsilon;','&phi;','&chi;','&psi;','&omega;','&thetasym;','&upsih;','&piv;','&bull;','&hellip;','&prime;','&prime;','&oline;','&frasl;','&weierp;','&image;','&real;','&trade;','&alefsym;','&larr;','&uarr;','&rarr;','&darr;','&harr;','&crarr;','&larr;','&uarr;','&rarr;','&darr;','&harr;','&forall;','&part;','&exist;','&empty;','&nabla;','&isin;','&notin;','&ni;','&prod;','&sum;','&minus;','&lowast;','&radic;','&prop;','&infin;','&ang;','&and;','&or;','&cap;','&cup;','&int;','&there4;','&sim;','&cong;','&asymp;','&ne;','&equiv;','&le;','&ge;','&sub;','&sup;','&nsub;','&sube;','&supe;','&oplus;','&otimes;','&perp;','&sdot;','&lceil;','&rceil;','&lfloor;','&rfloor;','&lang;','&rang;','&loz;','&spades;','&clubs;','&hearts;','&diams;');
		var arr2 = new Array('&#160;','&#161;','&#162;','&#163;','&#164;','&#165;','&#166;','&#167;','&#168;','&#169;','&#170;','&#171;','&#172;','&#173;','&#174;','&#175;','&#176;','&#177;','&#178;','&#179;','&#180;','&#181;','&#182;','&#183;','&#184;','&#185;','&#186;','&#187;','&#188;','&#189;','&#190;','&#191;','&#192;','&#193;','&#194;','&#195;','&#196;','&#197;','&#198;','&#199;','&#200;','&#201;','&#202;','&#203;','&#204;','&#205;','&#206;','&#207;','&#208;','&#209;','&#210;','&#211;','&#212;','&#213;','&#214;','&#215;','&#216;','&#217;','&#218;','&#219;','&#220;','&#221;','&#222;','&#223;','&#224;','&#225;','&#226;','&#227;','&#228;','&#229;','&#230;','&#231;','&#232;','&#233;','&#234;','&#235;','&#236;','&#237;','&#238;','&#239;','&#240;','&#241;','&#242;','&#243;','&#244;','&#245;','&#246;','&#247;','&#248;','&#249;','&#250;','&#251;','&#252;','&#253;','&#254;','&#255;','&#34;','&#38;','&#60;','&#62;','&#338;','&#339;','&#352;','&#353;','&#376;','&#710;','&#732;','&#8194;','&#8195;','&#8201;','&#8204;','&#8205;','&#8206;','&#8207;','&#8211;','&#8212;','&#8216;','&#8217;','&#8218;','&#8220;','&#8221;','&#8222;','&#8224;','&#8225;','&#8240;','&#8249;','&#8250;','&#8364;','&#402;','&#913;','&#914;','&#915;','&#916;','&#917;','&#918;','&#919;','&#920;','&#921;','&#922;','&#923;','&#924;','&#925;','&#926;','&#927;','&#928;','&#929;','&#931;','&#932;','&#933;','&#934;','&#935;','&#936;','&#937;','&#945;','&#946;','&#947;','&#948;','&#949;','&#950;','&#951;','&#952;','&#953;','&#954;','&#955;','&#956;','&#957;','&#958;','&#959;','&#960;','&#961;','&#962;','&#963;','&#964;','&#965;','&#966;','&#967;','&#968;','&#969;','&#977;','&#978;','&#982;','&#8226;','&#8230;','&#8242;','&#8243;','&#8254;','&#8260;','&#8472;','&#8465;','&#8476;','&#8482;','&#8501;','&#8592;','&#8593;','&#8594;','&#8595;','&#8596;','&#8629;','&#8656;','&#8657;','&#8658;','&#8659;','&#8660;','&#8704;','&#8706;','&#8707;','&#8709;','&#8711;','&#8712;','&#8713;','&#8715;','&#8719;','&#8721;','&#8722;','&#8727;','&#8730;','&#8733;','&#8734;','&#8736;','&#8743;','&#8744;','&#8745;','&#8746;','&#8747;','&#8756;','&#8764;','&#8773;','&#8776;','&#8800;','&#8801;','&#8804;','&#8805;','&#8834;','&#8835;','&#8836;','&#8838;','&#8839;','&#8853;','&#8855;','&#8869;','&#8901;','&#8968;','&#8969;','&#8970;','&#8971;','&#9001;','&#9002;','&#9674;','&#9824;','&#9827;','&#9829;','&#9830;');
		return this.swapArrayVals(s,arr1,arr2);
	},	

	// Convert Numerical entities into HTML entities
	NumericalToHTML : function(s){
		var arr1 = new Array('&#160;','&#161;','&#162;','&#163;','&#164;','&#165;','&#166;','&#167;','&#168;','&#169;','&#170;','&#171;','&#172;','&#173;','&#174;','&#175;','&#176;','&#177;','&#178;','&#179;','&#180;','&#181;','&#182;','&#183;','&#184;','&#185;','&#186;','&#187;','&#188;','&#189;','&#190;','&#191;','&#192;','&#193;','&#194;','&#195;','&#196;','&#197;','&#198;','&#199;','&#200;','&#201;','&#202;','&#203;','&#204;','&#205;','&#206;','&#207;','&#208;','&#209;','&#210;','&#211;','&#212;','&#213;','&#214;','&#215;','&#216;','&#217;','&#218;','&#219;','&#220;','&#221;','&#222;','&#223;','&#224;','&#225;','&#226;','&#227;','&#228;','&#229;','&#230;','&#231;','&#232;','&#233;','&#234;','&#235;','&#236;','&#237;','&#238;','&#239;','&#240;','&#241;','&#242;','&#243;','&#244;','&#245;','&#246;','&#247;','&#248;','&#249;','&#250;','&#251;','&#252;','&#253;','&#254;','&#255;','&#34;','&#38;','&#60;','&#62;','&#338;','&#339;','&#352;','&#353;','&#376;','&#710;','&#732;','&#8194;','&#8195;','&#8201;','&#8204;','&#8205;','&#8206;','&#8207;','&#8211;','&#8212;','&#8216;','&#8217;','&#8218;','&#8220;','&#8221;','&#8222;','&#8224;','&#8225;','&#8240;','&#8249;','&#8250;','&#8364;','&#402;','&#913;','&#914;','&#915;','&#916;','&#917;','&#918;','&#919;','&#920;','&#921;','&#922;','&#923;','&#924;','&#925;','&#926;','&#927;','&#928;','&#929;','&#931;','&#932;','&#933;','&#934;','&#935;','&#936;','&#937;','&#945;','&#946;','&#947;','&#948;','&#949;','&#950;','&#951;','&#952;','&#953;','&#954;','&#955;','&#956;','&#957;','&#958;','&#959;','&#960;','&#961;','&#962;','&#963;','&#964;','&#965;','&#966;','&#967;','&#968;','&#969;','&#977;','&#978;','&#982;','&#8226;','&#8230;','&#8242;','&#8243;','&#8254;','&#8260;','&#8472;','&#8465;','&#8476;','&#8482;','&#8501;','&#8592;','&#8593;','&#8594;','&#8595;','&#8596;','&#8629;','&#8656;','&#8657;','&#8658;','&#8659;','&#8660;','&#8704;','&#8706;','&#8707;','&#8709;','&#8711;','&#8712;','&#8713;','&#8715;','&#8719;','&#8721;','&#8722;','&#8727;','&#8730;','&#8733;','&#8734;','&#8736;','&#8743;','&#8744;','&#8745;','&#8746;','&#8747;','&#8756;','&#8764;','&#8773;','&#8776;','&#8800;','&#8801;','&#8804;','&#8805;','&#8834;','&#8835;','&#8836;','&#8838;','&#8839;','&#8853;','&#8855;','&#8869;','&#8901;','&#8968;','&#8969;','&#8970;','&#8971;','&#9001;','&#9002;','&#9674;','&#9824;','&#9827;','&#9829;','&#9830;');
		var arr2 = new Array('&nbsp;','&iexcl;','&cent;','&pound;','&curren;','&yen;','&brvbar;','&sect;','&uml;','&copy;','&ordf;','&laquo;','&not;','&shy;','&reg;','&macr;','&deg;','&plusmn;','&sup2;','&sup3;','&acute;','&micro;','&para;','&middot;','&cedil;','&sup1;','&ordm;','&raquo;','&frac14;','&frac12;','&frac34;','&iquest;','&agrave;','&aacute;','&acirc;','&atilde;','&Auml;','&aring;','&aelig;','&ccedil;','&egrave;','&eacute;','&ecirc;','&euml;','&igrave;','&iacute;','&icirc;','&iuml;','&eth;','&ntilde;','&ograve;','&oacute;','&ocirc;','&otilde;','&Ouml;','&times;','&Oslash;','&ugrave;','&uacute;','&ucirc;','&Uuml;','&yacute;','&thorn;','&szlig;','&agrave;','&aacute;','&acirc;','&atilde;','&auml;','&aring;','&aelig;','&ccedil;','&egrave;','&eacute;','&ecirc;','&euml;','&igrave;','&iacute;','&icirc;','&iuml;','&eth;','&ntilde;','&ograve;','&oacute;','&ocirc;','&otilde;','&ouml;','&divide;','&oslash;','&ugrave;','&uacute;','&ucirc;','&uuml;','&yacute;','&thorn;','&yuml;','&quot;','&amp;','&lt;','&gt;','&oelig;','&oelig;','&scaron;','&scaron;','&yuml;','&circ;','&tilde;','&ensp;','&emsp;','&thinsp;','&zwnj;','&zwj;','&lrm;','&rlm;','&ndash;','&mdash;','&lsquo;','&rsquo;','&sbquo;','&ldquo;','&rdquo;','&bdquo;','&dagger;','&dagger;','&permil;','&lsaquo;','&rsaquo;','&euro;','&fnof;','&alpha;','&beta;','&gamma;','&delta;','&epsilon;','&zeta;','&eta;','&theta;','&iota;','&kappa;','&lambda;','&mu;','&nu;','&xi;','&omicron;','&pi;','&rho;','&sigma;','&tau;','&upsilon;','&phi;','&chi;','&psi;','&omega;','&alpha;','&beta;','&gamma;','&delta;','&epsilon;','&zeta;','&eta;','&theta;','&iota;','&kappa;','&lambda;','&mu;','&nu;','&xi;','&omicron;','&pi;','&rho;','&sigmaf;','&sigma;','&tau;','&upsilon;','&phi;','&chi;','&psi;','&omega;','&thetasym;','&upsih;','&piv;','&bull;','&hellip;','&prime;','&prime;','&oline;','&frasl;','&weierp;','&image;','&real;','&trade;','&alefsym;','&larr;','&uarr;','&rarr;','&darr;','&harr;','&crarr;','&larr;','&uarr;','&rarr;','&darr;','&harr;','&forall;','&part;','&exist;','&empty;','&nabla;','&isin;','&notin;','&ni;','&prod;','&sum;','&minus;','&lowast;','&radic;','&prop;','&infin;','&ang;','&and;','&or;','&cap;','&cup;','&int;','&there4;','&sim;','&cong;','&asymp;','&ne;','&equiv;','&le;','&ge;','&sub;','&sup;','&nsub;','&sube;','&supe;','&oplus;','&otimes;','&perp;','&sdot;','&lceil;','&rceil;','&lfloor;','&rfloor;','&lang;','&rang;','&loz;','&spades;','&clubs;','&hearts;','&diams;');
		return this.swapArrayVals(s,arr1,arr2);
	},


	// Numerically encodes all unicode characters
	numEncode : function(s){
		
		if(this.isEmpty(s)) return "";

		var e = "";
		for (var i = 0; i < s.length; i++)
		{
			var c = s.charAt(i);
			if ((c < " " || c > "~") && c.charCodeAt()!=10)
			{
				c = "&#" + c.charCodeAt() + ";";
			}
			e += c;
		}
		return e;
	},
	
	// HTML Decode numerical and HTML entities back to original values
	htmlDecode : function(s){

		var c,m,d = s;
		
		if(this.isEmpty(d)) return "";

		// convert HTML entites back to numerical entites first
		d = this.HTML2Numerical(d);
		
		// look for numerical entities &#34;
		arr=d.match(/&#[0-9]{1,5};/g);
		
		// if no matches found in string then skip
		if(arr!=null){
			for(var x=0;x<arr.length;x++){
				m = arr[x];
				c = m.substring(2,m.length-1); //get numeric part which is refernce to unicode character
				// if its a valid number we can decode
				if(c >= -32768 && c <= 65535){
					// decode every single match within string
					d = d.replace(m, String.fromCharCode(c));
				}else{
					d = d.replace(m, ""); //invalid so replace with nada
				}
			}			
		}

		return d;
	},		

	// encode an input string into either numerical or HTML entities
	htmlEncode : function(s,dbl){
			
		if(this.isEmpty(s)) return "";

		// do we allow double encoding? E.g will &amp; be turned into &amp;amp;
		dbl = dbl | false; //default to prevent double encoding
		
		// if allowing double encoding we do ampersands first
		if(dbl){
			if(this.EncodeType=="numerical"){
				s = s.replace(/&/g, "&#38;");
			}else{
				s = s.replace(/&/g, "&amp;");
			}
		}

		// convert the xss chars to numerical entities ' " < >
		s = this.XSSEncode(s,false);
		
		if(this.EncodeType=="numerical" || !dbl){
			// Now call function that will convert any HTML entities to numerical codes
			s = this.HTML2Numerical(s);
		}

		// Now encode all chars above 127 e.g unicode
		s = this.numEncode(s);

		// now we know anything that needs to be encoded has been converted to numerical entities we
		// can encode any ampersands & that are not part of encoded entities
		// to handle the fact that I need to do a negative check and handle multiple ampersands &&&
		// I am going to use a placeholder

		// if we don't want double encoded entities we ignore the & in existing entities
		if(!dbl){
			s = s.replace(/&#/g,"##AMPHASH##");
		
			if(this.EncodeType=="numerical"){
				s = s.replace(/&/g, "&#38;");
			}else{
				s = s.replace(/&/g, "&amp;");
			}

			s = s.replace(/##AMPHASH##/g,"&#");
		}
		
		// replace any malformed entities
		s = s.replace(/&#\d*([^\d;]|$)/g, "$1");

		if(!dbl){
			// safety check to correct any double encoded &amp;
			s = this.correctEncoding(s);
		}

		// now do we need to convert our numerical encoded string into entities
		if(this.EncodeType=="entity"){
			s = this.NumericalToHTML(s);
		}

		return s;					
	},

	// Encodes the basic 4 characters used to malform HTML in XSS hacks
	XSSEncode : function(s,en){
		if(!this.isEmpty(s)){
			en = en || true;
			// do we convert to numerical or html entity?
			if(en){
				s = s.replace(/\'/g,"&#39;"); //no HTML equivalent as &apos is not cross browser supported
				s = s.replace(/\"/g,"&quot;");
				s = s.replace(/</g,"&lt;");
				s = s.replace(/>/g,"&gt;");
			}else{
				s = s.replace(/\'/g,"&#39;"); //no HTML equivalent as &apos is not cross browser supported
				s = s.replace(/\"/g,"&#34;");
				s = s.replace(/</g,"&#60;");
				s = s.replace(/>/g,"&#62;");
			}
			return s;
		}else{
			return "";
		}
	},

	// returns true if a string contains html or numerical encoded entities
	hasEncoded : function(s){
		if(/&#[0-9]{1,5};/g.test(s)){
			return true;
		}else if(/&[A-Z]{2,6};/gi.test(s)){
			return true;
		}else{
			return false;
		}
	},

	// will remove any unicode characters
	stripUnicode : function(s){
		return s.replace(/[^\x20-\x7E]/g,"");
		
	},

	// corrects any double encoded &amp; entities e.g &amp;amp;
	correctEncoding : function(s){
		return s.replace(/(&amp;)(amp;)+/,"$1");
	},


	// Function to loop through an array swaping each item with the value from another array e.g swap HTML entities with Numericals
	swapArrayVals : function(s,arr1,arr2){
		if(this.isEmpty(s)) return "";
		var re;
		if(arr1 && arr2){
			//ShowDebug("in swapArrayVals arr1.length = " + arr1.length + " arr2.length = " + arr2.length)
			// array lengths must match
			if(arr1.length == arr2.length){
				for(var x=0,i=arr1.length;x<i;x++){
					re = new RegExp(arr1[x], 'g');
					s = s.replace(re,arr2[x]); //swap arr1 item with matching item from arr2	
				}
			}
		}
		return s;
	},

	inArray : function( item, arr ) {
		for ( var i = 0, x = arr.length; i < x; i++ ){
			if ( arr[i] === item ){
				return i;
			}
		}
		return -1;
	}

}

;//Soundmanager
soundManager.url = sk_url+'/wp-content/plugins/schreikasten/libs/';
	soundManager.useFlashBlock = false;
	soundManager.debugMode = false;
	soundManager.onready(function() {
		if (soundManager.supported()) {
			skSound = soundManager.createSound({
				id: 'aSound',
				url: sk_url+'/wp-content/plugins/schreikasten/img/drop.mp3',
				volume: 70
			});
		}
	});


//Change title
function sk_alternateTitle(title1, title2) {
	if(!sk_hasFocus) {
		document.title = title1;
		setTimeout( 'sk_alternateTitle(\''+title2+'\', \''+title1+'\');' , 1500 );
	} else {
		document.title = sk_old_title;
	}
}

skBeep = function() {
	skSound.play();
}


//Semaphore class
	function sk_Semaphore() {
		var me = this; //Just to use me instead of this if a recursived function is used
		
		var status = true; //The green or red light
		me.using = 0;
	
		//Function to set green
		me.setGreen = function() { status = true; };
	
		//Is green?
		me.isGreen = function() { return status; };
	
		//Function to set red
		me.setRed = function() { status = false; };
	
		//Is red?
		me.isRed = function() { return !status; };
		
	}
	
	var loading_sk_img = new Image(); 
	loading_sk_img.src = sk_url+'/wp-content/plugins/schreikasten/img/loading.gif';
	var sk_sack = new sack(sk_url+'/wp-admin/admin-ajax.php' );
	var sk_sack_action = new sack(sk_url+'/wp-admin/admin-ajax.php' );
	
	function sk_feed( page, rand, semaphore, force, timer )
	{
		var force = (force == null) ? false : force;
		var timer = (timer == null) ? false : timer;
		if( semaphore.isGreen() ) {
			
			semaphore.setRed();
			
			//Our plugin sack configuration
			sk_sack.execute = 0;
			sk_sack.method = 'POST';
			sk_sack.setVar( 'action', 'sk_ajax' );
			//sk_sack.element = 'sk_content'+rand;
			
			//The ajax call data
			sk_sack.setVar( 'page', page );
			sk_sack.setVar( 'rand', rand );
			sk_sack.setVar( 'force', force );
			sk_sack.setVar( 'size' , document.getElementById('sk_size'+rand).value );
			sk_sack.setVar( 'count', document.getElementById('sk_count'+rand).value );
			
			sk_sack.onCompletion = function() {
				if(sk_sack.response=='none') {
					semaphore.setGreen();
				} else {
					var page = sk_sack.vars['page'][0];
					var rand = sk_sack.vars['rand'][0];
					var doc = document.getElementById('sk_content'+rand);
					doc.innerHTML = sk_sack.response;
					semaphore.setGreen();
					if(timer) {
						var count = document.getElementById('sk_count'+rand).value;
						var int_count = document.getElementById('sk_int_count'+rand).value;
						var last = document.getElementById('sk_int_last'+rand).value;
						if(count != int_count) {
							if(int_count > count) {
								if(!sk_hasFocus) sk_alternateTitle(sk_title_message + last, document.title);
								skBeep();
							}
							document.getElementById('sk_count'+rand).value = int_count;
						}
					}
					if(document.getElementById('sk_page'+rand).value!=page) {
						var aux = document.getElementById('throbber-page'+rand);
						aux.setAttribute('class', 'throbber-page-on');
						aux.setAttribute('className', 'throbber-page-on'); //IE sucks
					} else {
						sk_sack.xmlhttp.abort();
						sk_sack.reset();
					}
					var sk_submit=document.getElementById('sk_submit_text'+rand);
					var sk_button=document.getElementById('sk_button'+rand);
					sk_button.value = sk_submit.value; 
				}
			};
			
			sk_sack.runAJAX();
			
		} else {
			setTimeout(function (){ sk_feed( page, rand, semaphore, force, timer ); }, 300);
		}
		return true;
	}
	// end of JavaScript function sk_feed
	
	function sk_add( alias, email, text, skfor, rand, semaphore)
	{
		sk_sack.xmlhttp.abort();
		sk_sack.reset();
		semaphore.setRed();
		
		//Our plugin sack configuration
		sk_sack_action.execute = 0;
		sk_sack_action.method = 'POST';
		sk_sack_action.setVar( 'action', 'sk_ajax_add' );
		sk_sack_action.element = 'sk_content'+rand;
		
		//Encode text
		//Encoder.EncodeType = "numeric";
		alias = Encoder.htmlEncode(alias);
		email = Encoder.htmlEncode(email);
		text = Encoder.htmlEncode(text);
		
		//The ajax call data
		sk_sack_action.setVar( 'alias', alias );
		sk_sack_action.setVar( 'email', email );
		sk_sack_action.setVar( 'text', text );
		sk_sack_action.setVar( 'skfor', skfor );
		sk_sack_action.setVar( 'rand', rand );
		sk_sack_action.setVar( 'size' , document.getElementById('sk_size'+rand).value );
		
		sk_sack_action.onCompletion = function() {
			var rand = sk_sack_action.vars['rand'][0];
			var doc = document.getElementById('sk_content'+rand);
			doc.innerHTML = sk_sack_action.response;
			sk_sack.xmlhttp.abort();
			sk_sack.reset();
			semaphore.setGreen();
			document.getElementById('sk_count'+rand).value = document.getElementById('sk_int_count'+rand).value;
			
			var sk_submit=document.getElementById('sk_submit_text'+rand);
			var sk_button=document.getElementById('sk_button'+rand);
			sk_button.disabled = false;
			sk_button.value = sk_submit.value; 
		
		};
		
		sk_sack_action.runAJAX();
			
		return true;
		
	}
	
	function sk_action( id, sk_action, rand, semaphore)
	{
		sk_sack.xmlhttp.abort();
		sk_sack.reset();
		semaphore.setRed();
		
		//Our plugin sack configuration
		sk_sack_action.execute = 0;
		sk_sack_action.method = 'POST';
		sk_sack_action.setVar( 'action', 'sk_ajax_action' );
		sk_sack_action.element = 'sk_content'+rand;
		
		//The ajax call data
		sk_sack_action.setVar( 'id', id );
		sk_sack_action.setVar( 'sk_action', sk_action );
		sk_sack_action.setVar( 'rand', rand );
		sk_sack_action.setVar( 'page', document.getElementById('sk_page'+rand).value );
		sk_sack_action.setVar( 'size', document.getElementById('sk_size'+rand).value );
		
		sk_sack_action.onCompletion = function() {
			var rand = sk_sack_action.vars['rand'][0];
			var doc = document.getElementById('sk_content'+rand);
			doc.innerHTML = sk_sack_action.response;
			sk_sack.xmlhttp.abort();
			sk_sack.reset();
			semaphore.setGreen();
			document.getElementById('sk_count'+rand).value = document.getElementById('sk_int_count'+rand).value;
			
			var sk_submit=document.getElementById('sk_submit_text'+rand);
			var sk_button=document.getElementById('sk_button'+rand);
			sk_button.value = sk_submit.value; 
		};
		
		sk_sack_action.runAJAX();
			
		return true;
		
	}
	
	function sk_confirm_action(action, rand, id, semaphore) {
		var aux = document.getElementById('sk-'+rand+'-'+id);
		aux.setAttribute('class', 'sk-comment-spam sk-user-admin');
		aux.setAttribute('className', 'sk-comment-spam sk-user-admin');
		text = false;
		if(action == 'delete') text = sk_text_del;
		if(action == 'set_black') text = sk_text_blk;
		if(action == 'set_spam') text = sk_text_spm;
		if(text && confirm(text)) {
			sk_action(id, action, rand, semaphore);
		} else {
			aux.setAttribute('class', 'sk-comment sk-user-admin');
			aux.setAttribute('className', 'sk-comment sk-user-admin'); //IE sucks
		}
	}
	

;WPGroHo = jQuery.extend( {
	my_hash: '',
	data: {},
	renderers: {},
	syncProfileData: function( hash, id ) {
		if ( !WPGroHo.data[hash] ) {
			WPGroHo.data[hash] = {};
			a = jQuery( 'div.grofile-hash-map-' + hash + ' span' ).each( function() {
				WPGroHo.data[hash][this.className] = jQuery( this ).text();
			} );
		}

		WPGroHo.appendProfileData( WPGroHo.data[hash], hash, id );
	},
	appendProfileData: function( data, hash, id ) {
		for ( var key in data ) {
			if ( jQuery.isFunction( WPGroHo.renderers[key] ) ) {
				return WPGroHo.renderers[key]( data[key], hash, id, key );
			}

			jQuery( '#' + id ).find( 'h4' ).after( jQuery( '<p class="grav-extra ' + key + '" />' ).html( data[key] ) );
		}
	}
}, WPGroHo );

jQuery( document ).ready( function( $ ) {
	Gravatar.profile_cb = function( h, d ) {
		WPGroHo.syncProfileData( h, d );
	};

	Gravatar.my_hash = WPGroHo.my_hash;
	Gravatar.init( 'body', '#wpadminbar' );
} );

;/*!
 * jQuery Form Plugin
 * version: 2.87 (20-OCT-2011)
 * @requires jQuery v1.3.2 or later
 *
 * Examples and documentation at: http://malsup.com/jquery/form/
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
;(function($) {

/*
	Usage Note:
	-----------
	Do not use both ajaxSubmit and ajaxForm on the same form.  These
	functions are intended to be exclusive.  Use ajaxSubmit if you want
	to bind your own submit handler to the form.  For example,

	$(document).ready(function() {
		$('#myForm').bind('submit', function(e) {
			e.preventDefault(); // <-- important
			$(this).ajaxSubmit({
				target: '#output'
			});
		});
	});

	Use ajaxForm when you want the plugin to manage all the event binding
	for you.  For example,

	$(document).ready(function() {
		$('#myForm').ajaxForm({
			target: '#output'
		});
	});

	When using ajaxForm, the ajaxSubmit function will be invoked for you
	at the appropriate time.
*/

/**
 * ajaxSubmit() provides a mechanism for immediately submitting
 * an HTML form using AJAX.
 */
$.fn.ajaxSubmit = function(options) {
	// fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
	if (!this.length) {
		log('ajaxSubmit: skipping submit process - no element selected');
		return this;
	}
	
	var method, action, url, $form = this;

	if (typeof options == 'function') {
		options = { success: options };
	}

	method = this.attr('method');
	action = this.attr('action');
	url = (typeof action === 'string') ? $.trim(action) : '';
	url = url || window.location.href || '';
	if (url) {
		// clean url (don't include hash vaue)
		url = (url.match(/^([^#]+)/)||[])[1];
	}

	options = $.extend(true, {
		url:  url,
		success: $.ajaxSettings.success,
		type: method || 'GET',
		iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
	}, options);

	// hook for manipulating the form data before it is extracted;
	// convenient for use with rich editors like tinyMCE or FCKEditor
	var veto = {};
	this.trigger('form-pre-serialize', [this, options, veto]);
	if (veto.veto) {
		log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
		return this;
	}

	// provide opportunity to alter form data before it is serialized
	if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
		log('ajaxSubmit: submit aborted via beforeSerialize callback');
		return this;
	}

   var traditional = options.traditional;
   if ( traditional === undefined ) {
      traditional = $.ajaxSettings.traditional;
   }
   
	var qx,n,v,a = this.formToArray(options.semantic);
	if (options.data) {
		options.extraData = options.data;
      qx = $.param(options.data, traditional);
	}

	// give pre-submit callback an opportunity to abort the submit
	if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
		log('ajaxSubmit: submit aborted via beforeSubmit callback');
		return this;
	}

	// fire vetoable 'validate' event
	this.trigger('form-submit-validate', [a, this, options, veto]);
	if (veto.veto) {
		log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
		return this;
	}

	var q = $.param(a, traditional);
   if (qx)
      q = ( q ? (q + '&' + qx) : qx );

	if (options.type.toUpperCase() == 'GET') {
		options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
		options.data = null;  // data is null for 'get'
	}
	else {
		options.data = q; // data is the query string for 'post'
	}

	var callbacks = [];
	if (options.resetForm) {
		callbacks.push(function() { $form.resetForm(); });
	}
	if (options.clearForm) {
		callbacks.push(function() { $form.clearForm(options.includeHidden); });
	}

	// perform a load on the target only if dataType is not provided
	if (!options.dataType && options.target) {
		var oldSuccess = options.success || function(){};
		callbacks.push(function(data) {
			var fn = options.replaceTarget ? 'replaceWith' : 'html';
			$(options.target)[fn](data).each(oldSuccess, arguments);
		});
	}
	else if (options.success) {
		callbacks.push(options.success);
	}

	options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
		var context = options.context || options;   // jQuery 1.4+ supports scope context 
		for (var i=0, max=callbacks.length; i < max; i++) {
			callbacks[i].apply(context, [data, status, xhr || $form, $form]);
		}
	};

	// are there files to upload?
	var fileInputs = $('input:file', this).length > 0;
	var mp = 'multipart/form-data';
	var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);

	// options.iframe allows user to force iframe mode
	// 06-NOV-09: now defaulting to iframe mode if file input is detected
   if (options.iframe !== false && (fileInputs || options.iframe || multipart)) {
	   // hack to fix Safari hang (thanks to Tim Molendijk for this)
	   // see:  http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
	   if (options.closeKeepAlive) {
		   $.get(options.closeKeepAlive, function() { fileUpload(a); });
		}
	   else {
		   fileUpload(a);
		}
   }
   else {
		// IE7 massage (see issue 57)
		if ($.browser.msie && method == 'get' && typeof options.type === "undefined") {
			var ieMeth = $form[0].getAttribute('method');
			if (typeof ieMeth === 'string')
				options.type = ieMeth;
		}
		$.ajax(options);
   }

	// fire 'notify' event
	this.trigger('form-submit-notify', [this, options]);
	return this;


	// private function for handling file uploads (hat tip to YAHOO!)
	function fileUpload(a) {
		var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
        var useProp = !!$.fn.prop;

        if (a) {
            if ( useProp ) {
            	// ensure that every serialized input is still enabled
              	for (i=0; i < a.length; i++) {
                    el = $(form[a[i].name]);
                    el.prop('disabled', false);
              	}
            } else {
              	for (i=0; i < a.length; i++) {
                    el = $(form[a[i].name]);
                    el.removeAttr('disabled');
              	}
            };
        }

		if ($(':input[name=submit],:input[id=submit]', form).length) {
			// if there is an input with a name or id of 'submit' then we won't be
			// able to invoke the submit fn on the form (at least not x-browser)
			alert('Error: Form elements must not have name or id of "submit".');
			return;
		}
		
		s = $.extend(true, {}, $.ajaxSettings, options);
		s.context = s.context || s;
		id = 'jqFormIO' + (new Date().getTime());
		if (s.iframeTarget) {
			$io = $(s.iframeTarget);
			n = $io.attr('name');
			if (n == null)
			 	$io.attr('name', id);
			else
				id = n;
		}
		else {
			$io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />');
			$io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
		}
		io = $io[0];


		xhr = { // mock object
			aborted: 0,
			responseText: null,
			responseXML: null,
			status: 0,
			statusText: 'n/a',
			getAllResponseHeaders: function() {},
			getResponseHeader: function() {},
			setRequestHeader: function() {},
			abort: function(status) {
				var e = (status === 'timeout' ? 'timeout' : 'aborted');
				log('aborting upload... ' + e);
				this.aborted = 1;
				$io.attr('src', s.iframeSrc); // abort op in progress
				xhr.error = e;
				s.error && s.error.call(s.context, xhr, e, status);
				g && $.event.trigger("ajaxError", [xhr, s, e]);
				s.complete && s.complete.call(s.context, xhr, e);
			}
		};

		g = s.global;
		// trigger ajax global events so that activity/block indicators work like normal
		if (g && ! $.active++) {
			$.event.trigger("ajaxStart");
		}
		if (g) {
			$.event.trigger("ajaxSend", [xhr, s]);
		}

		if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
			if (s.global) {
				$.active--;
			}
			return;
		}
		if (xhr.aborted) {
			return;
		}

		// add submitting element to data if we know it
		sub = form.clk;
		if (sub) {
			n = sub.name;
			if (n && !sub.disabled) {
				s.extraData = s.extraData || {};
				s.extraData[n] = sub.value;
				if (sub.type == "image") {
					s.extraData[n+'.x'] = form.clk_x;
					s.extraData[n+'.y'] = form.clk_y;
				}
			}
		}
		
		var CLIENT_TIMEOUT_ABORT = 1;
		var SERVER_ABORT = 2;

		function getDoc(frame) {
			var doc = frame.contentWindow ? frame.contentWindow.document : frame.contentDocument ? frame.contentDocument : frame.document;
			return doc;
		}
		
		// take a breath so that pending repaints get some cpu time before the upload starts
		function doSubmit() {
			// make sure form attrs are set
			var t = $form.attr('target'), a = $form.attr('action');

			// update form attrs in IE friendly way
			form.setAttribute('target',id);
			if (!method) {
				form.setAttribute('method', 'POST');
			}
			if (a != s.url) {
				form.setAttribute('action', s.url);
			}

			// ie borks in some cases when setting encoding
			if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {
				$form.attr({
					encoding: 'multipart/form-data',
					enctype:  'multipart/form-data'
				});
			}

			// support timout
			if (s.timeout) {
				timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);
			}
			
			// look for server aborts
			function checkState() {
				try {
					var state = getDoc(io).readyState;
					log('state = ' + state);
					if (state.toLowerCase() == 'uninitialized')
						setTimeout(checkState,50);
				}
				catch(e) {
					log('Server abort: ' , e, ' (', e.name, ')');
					cb(SERVER_ABORT);
					timeoutHandle && clearTimeout(timeoutHandle);
					timeoutHandle = undefined;
				}
			}

			// add "extra" data to form if provided in options
			var extraInputs = [];
			try {
				if (s.extraData) {
					for (var n in s.extraData) {
						extraInputs.push(
							$('<input type="hidden" name="'+n+'" />').attr('value',s.extraData[n])
								.appendTo(form)[0]);
					}
				}

				if (!s.iframeTarget) {
					// add iframe to doc and submit the form
					$io.appendTo('body');
	                io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
				}
				setTimeout(checkState,15);
				form.submit();
			}
			finally {
				// reset attrs and remove "extra" input elements
				form.setAttribute('action',a);
				if(t) {
					form.setAttribute('target', t);
				} else {
					$form.removeAttr('target');
				}
				$(extraInputs).remove();
			}
		}

		if (s.forceSync) {
			doSubmit();
		}
		else {
			setTimeout(doSubmit, 10); // this lets dom updates render
		}

		var data, doc, domCheckCount = 50, callbackProcessed;

		function cb(e) {
			if (xhr.aborted || callbackProcessed) {
				return;
			}
			try {
				doc = getDoc(io);
			}
			catch(ex) {
				log('cannot access response document: ', ex);
				e = SERVER_ABORT;
			}
			if (e === CLIENT_TIMEOUT_ABORT && xhr) {
				xhr.abort('timeout');
				return;
			}
			else if (e == SERVER_ABORT && xhr) {
				xhr.abort('server abort');
				return;
			}

			if (!doc || doc.location.href == s.iframeSrc) {
				// response not received yet
				if (!timedOut)
					return;
			}
            io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);

			var status = 'success', errMsg;
			try {
				if (timedOut) {
					throw 'timeout';
				}

				var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
				log('isXml='+isXml);
				if (!isXml && window.opera && (doc.body == null || doc.body.innerHTML == '')) {
					if (--domCheckCount) {
						// in some browsers (Opera) the iframe DOM is not always traversable when
						// the onload callback fires, so we loop a bit to accommodate
						log('requeing onLoad callback, DOM not available');
						setTimeout(cb, 250);
						return;
					}
					// let this fall through because server response could be an empty document
					//log('Could not access iframe DOM after mutiple tries.');
					//throw 'DOMException: not available';
				}

				//log('response detected');
                var docRoot = doc.body ? doc.body : doc.documentElement;
                xhr.responseText = docRoot ? docRoot.innerHTML : null;
				xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
				if (isXml)
					s.dataType = 'xml';
				xhr.getResponseHeader = function(header){
					var headers = {'content-type': s.dataType};
					return headers[header];
				};
                // support for XHR 'status' & 'statusText' emulation :
                if (docRoot) {
                    xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;
                    xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
                }

				var dt = (s.dataType || '').toLowerCase();
				var scr = /(json|script|text)/.test(dt);
				if (scr || s.textarea) {
					// see if user embedded response in textarea
					var ta = doc.getElementsByTagName('textarea')[0];
					if (ta) {
						xhr.responseText = ta.value;
                        // support for XHR 'status' & 'statusText' emulation :
                        xhr.status = Number( ta.getAttribute('status') ) || xhr.status;
                        xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
					}
					else if (scr) {
						// account for browsers injecting pre around json response
						var pre = doc.getElementsByTagName('pre')[0];
						var b = doc.getElementsByTagName('body')[0];
						if (pre) {
							xhr.responseText = pre.textContent ? pre.textContent : pre.innerText;
						}
						else if (b) {
							xhr.responseText = b.textContent ? b.textContent : b.innerText;
						}
					}
				}
				else if (dt == 'xml' && !xhr.responseXML && xhr.responseText != null) {
					xhr.responseXML = toXml(xhr.responseText);
				}

                try {
                    data = httpData(xhr, dt, s);
                }
                catch (e) {
                    status = 'parsererror';
                    xhr.error = errMsg = (e || status);
                }
			}
			catch (e) {
				log('error caught: ',e);
				status = 'error';
                xhr.error = errMsg = (e || status);
			}

			if (xhr.aborted) {
				log('upload aborted');
				status = null;
			}

            if (xhr.status) { // we've set xhr.status
                status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';
            }

			// ordering of these callbacks/triggers is odd, but that's how $.ajax does it
			if (status === 'success') {
				s.success && s.success.call(s.context, data, 'success', xhr);
				g && $.event.trigger("ajaxSuccess", [xhr, s]);
			}
            else if (status) {
				if (errMsg == undefined)
					errMsg = xhr.statusText;
				s.error && s.error.call(s.context, xhr, status, errMsg);
				g && $.event.trigger("ajaxError", [xhr, s, errMsg]);
            }

			g && $.event.trigger("ajaxComplete", [xhr, s]);

			if (g && ! --$.active) {
				$.event.trigger("ajaxStop");
			}

			s.complete && s.complete.call(s.context, xhr, status);

			callbackProcessed = true;
			if (s.timeout)
				clearTimeout(timeoutHandle);

			// clean up
			setTimeout(function() {
				if (!s.iframeTarget)
					$io.remove();
				xhr.responseXML = null;
			}, 100);
		}

		var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
			if (window.ActiveXObject) {
				doc = new ActiveXObject('Microsoft.XMLDOM');
				doc.async = 'false';
				doc.loadXML(s);
			}
			else {
				doc = (new DOMParser()).parseFromString(s, 'text/xml');
			}
			return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
		};
		var parseJSON = $.parseJSON || function(s) {
			return window['eval']('(' + s + ')');
		};

		var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4

			var ct = xhr.getResponseHeader('content-type') || '',
				xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
				data = xml ? xhr.responseXML : xhr.responseText;

			if (xml && data.documentElement.nodeName === 'parsererror') {
				$.error && $.error('parsererror');
			}
			if (s && s.dataFilter) {
				data = s.dataFilter(data, type);
			}
			if (typeof data === 'string') {
				if (type === 'json' || !type && ct.indexOf('json') >= 0) {
					data = parseJSON(data);
				} else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
					$.globalEval(data);
				}
			}
			return data;
		};
	}
};

/**
 * ajaxForm() provides a mechanism for fully automating form submission.
 *
 * The advantages of using this method instead of ajaxSubmit() are:
 *
 * 1: This method will include coordinates for <input type="image" /> elements (if the element
 *	is used to submit the form).
 * 2. This method will include the submit element's name/value data (for the element that was
 *	used to submit the form).
 * 3. This method binds the submit() method to the form for you.
 *
 * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
 * passes the options argument along after properly binding events for submit elements and
 * the form itself.
 */
$.fn.ajaxForm = function(options) {
	// in jQuery 1.3+ we can fix mistakes with the ready state
	if (this.length === 0) {
		var o = { s: this.selector, c: this.context };
		if (!$.isReady && o.s) {
			log('DOM not ready, queuing ajaxForm');
			$(function() {
				$(o.s,o.c).ajaxForm(options);
			});
			return this;
		}
		// is your DOM ready?  http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
		log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
		return this;
	}

	return this.ajaxFormUnbind().bind('submit.form-plugin', function(e) {
		if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
			e.preventDefault();
			$(this).ajaxSubmit(options);
		}
	}).bind('click.form-plugin', function(e) {
		var target = e.target;
		var $el = $(target);
		if (!($el.is(":submit,input:image"))) {
			// is this a child element of the submit el?  (ex: a span within a button)
			var t = $el.closest(':submit');
			if (t.length == 0) {
				return;
			}
			target = t[0];
		}
		var form = this;
		form.clk = target;
		if (target.type == 'image') {
			if (e.offsetX != undefined) {
				form.clk_x = e.offsetX;
				form.clk_y = e.offsetY;
			} else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
				var offset = $el.offset();
				form.clk_x = e.pageX - offset.left;
				form.clk_y = e.pageY - offset.top;
			} else {
				form.clk_x = e.pageX - target.offsetLeft;
				form.clk_y = e.pageY - target.offsetTop;
			}
		}
		// clear form vars
		setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
	});
};

// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
$.fn.ajaxFormUnbind = function() {
	return this.unbind('submit.form-plugin click.form-plugin');
};

/**
 * formToArray() gathers form element data into an array of objects that can
 * be passed to any of the following ajax functions: $.get, $.post, or load.
 * Each object in the array has both a 'name' and 'value' property.  An example of
 * an array for a simple login form might be:
 *
 * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
 *
 * It is this array that is passed to pre-submit callback functions provided to the
 * ajaxSubmit() and ajaxForm() methods.
 */
$.fn.formToArray = function(semantic) {
	var a = [];
	if (this.length === 0) {
		return a;
	}

	var form = this[0];
	var els = semantic ? form.getElementsByTagName('*') : form.elements;
	if (!els) {
		return a;
	}

	var i,j,n,v,el,max,jmax;
	for(i=0, max=els.length; i < max; i++) {
		el = els[i];
		n = el.name;
		if (!n) {
			continue;
		}

		if (semantic && form.clk && el.type == "image") {
			// handle image inputs on the fly when semantic == true
			if(!el.disabled && form.clk == el) {
				a.push({name: n, value: $(el).val()});
				a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
			}
			continue;
		}

		v = $.fieldValue(el, true);
		if (v && v.constructor == Array) {
			for(j=0, jmax=v.length; j < jmax; j++) {
				a.push({name: n, value: v[j]});
			}
		}
		else if (v !== null && typeof v != 'undefined') {
			a.push({name: n, value: v});
		}
	}

	if (!semantic && form.clk) {
		// input type=='image' are not found in elements array! handle it here
		var $input = $(form.clk), input = $input[0];
		n = input.name;
		if (n && !input.disabled && input.type == 'image') {
			a.push({name: n, value: $input.val()});
			a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
		}
	}
	return a;
};

/**
 * Serializes form data into a 'submittable' string. This method will return a string
 * in the format: name1=value1&amp;name2=value2
 */
$.fn.formSerialize = function(semantic) {
	//hand off to jQuery.param for proper encoding
	return $.param(this.formToArray(semantic));
};

/**
 * Serializes all field elements in the jQuery object into a query string.
 * This method will return a string in the format: name1=value1&amp;name2=value2
 */
$.fn.fieldSerialize = function(successful) {
	var a = [];
	this.each(function() {
		var n = this.name;
		if (!n) {
			return;
		}
		var v = $.fieldValue(this, successful);
		if (v && v.constructor == Array) {
			for (var i=0,max=v.length; i < max; i++) {
				a.push({name: n, value: v[i]});
			}
		}
		else if (v !== null && typeof v != 'undefined') {
			a.push({name: this.name, value: v});
		}
	});
	//hand off to jQuery.param for proper encoding
	return $.param(a);
};

/**
 * Returns the value(s) of the element in the matched set.  For example, consider the following form:
 *
 *  <form><fieldset>
 *	  <input name="A" type="text" />
 *	  <input name="A" type="text" />
 *	  <input name="B" type="checkbox" value="B1" />
 *	  <input name="B" type="checkbox" value="B2"/>
 *	  <input name="C" type="radio" value="C1" />
 *	  <input name="C" type="radio" value="C2" />
 *  </fieldset></form>
 *
 *  var v = $(':text').fieldValue();
 *  // if no values are entered into the text inputs
 *  v == ['','']
 *  // if values entered into the text inputs are 'foo' and 'bar'
 *  v == ['foo','bar']
 *
 *  var v = $(':checkbox').fieldValue();
 *  // if neither checkbox is checked
 *  v === undefined
 *  // if both checkboxes are checked
 *  v == ['B1', 'B2']
 *
 *  var v = $(':radio').fieldValue();
 *  // if neither radio is checked
 *  v === undefined
 *  // if first radio is checked
 *  v == ['C1']
 *
 * The successful argument controls whether or not the field element must be 'successful'
 * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
 * The default value of the successful argument is true.  If this value is false the value(s)
 * for each element is returned.
 *
 * Note: This method *always* returns an array.  If no valid value can be determined the
 *	   array will be empty, otherwise it will contain one or more values.
 */
$.fn.fieldValue = function(successful) {
	for (var val=[], i=0, max=this.length; i < max; i++) {
		var el = this[i];
		var v = $.fieldValue(el, successful);
		if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
			continue;
		}
		v.constructor == Array ? $.merge(val, v) : val.push(v);
	}
	return val;
};

/**
 * Returns the value of the field element.
 */
$.fieldValue = function(el, successful) {
	var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
	if (successful === undefined) {
		successful = true;
	}

	if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
		(t == 'checkbox' || t == 'radio') && !el.checked ||
		(t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
		tag == 'select' && el.selectedIndex == -1)) {
			return null;
	}

	if (tag == 'select') {
		var index = el.selectedIndex;
		if (index < 0) {
			return null;
		}
		var a = [], ops = el.options;
		var one = (t == 'select-one');
		var max = (one ? index+1 : ops.length);
		for(var i=(one ? index : 0); i < max; i++) {
			var op = ops[i];
			if (op.selected) {
				var v = op.value;
				if (!v) { // extra pain for IE...
					v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;
				}
				if (one) {
					return v;
				}
				a.push(v);
			}
		}
		return a;
	}
	return $(el).val();
};

/**
 * Clears the form data.  Takes the following actions on the form's input fields:
 *  - input text fields will have their 'value' property set to the empty string
 *  - select elements will have their 'selectedIndex' property set to -1
 *  - checkbox and radio inputs will have their 'checked' property set to false
 *  - inputs of type submit, button, reset, and hidden will *not* be effected
 *  - button elements will *not* be effected
 */
$.fn.clearForm = function(includeHidden) {
	return this.each(function() {
		$('input,select,textarea', this).clearFields(includeHidden);
	});
};

/**
 * Clears the selected form elements.
 */
$.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
	var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list
	return this.each(function() {
		var t = this.type, tag = this.tagName.toLowerCase();
		if (re.test(t) || tag == 'textarea' || (includeHidden && /hidden/.test(t)) ) {
			this.value = '';
		}
		else if (t == 'checkbox' || t == 'radio') {
			this.checked = false;
		}
		else if (tag == 'select') {
			this.selectedIndex = -1;
		}
	});
};

/**
 * Resets the form data.  Causes all form elements to be reset to their original value.
 */
$.fn.resetForm = function() {
	return this.each(function() {
		// guard against an input with the name of 'reset'
		// note that IE reports the reset function as an 'object'
		if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
			this.reset();
		}
	});
};

/**
 * Enables or disables any matching elements.
 */
$.fn.enable = function(b) {
	if (b === undefined) {
		b = true;
	}
	return this.each(function() {
		this.disabled = !b;
	});
};

/**
 * Checks/unchecks any matching checkboxes or radio buttons and
 * selects/deselects and matching option elements.
 */
$.fn.selected = function(select) {
	if (select === undefined) {
		select = true;
	}
	return this.each(function() {
		var t = this.type;
		if (t == 'checkbox' || t == 'radio') {
			this.checked = select;
		}
		else if (this.tagName.toLowerCase() == 'option') {
			var $sel = $(this).parent('select');
			if (select && $sel[0] && $sel[0].type == 'select-one') {
				// deselect all other options
				$sel.find('option').selected(false);
			}
			this.selected = select;
		}
	});
};

// expose debug var
$.fn.ajaxSubmit.debug = false;

// helper fn for console logging
function log() {
	if (!$.fn.ajaxSubmit.debug) 
		return;
	var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
	if (window.console && window.console.log) {
		window.console.log(msg);
	}
	else if (window.opera && window.opera.postError) {
		window.opera.postError(msg);
	}
};

})(jQuery);

;(function($) {

	$(function() {
		try {
			if (typeof _wpcf7 == 'undefined' || _wpcf7 === null)
				_wpcf7 = {};

			_wpcf7 = $.extend({ cached: 0 }, _wpcf7);

			$('div.wpcf7 > form').ajaxForm({
				beforeSubmit: function(formData, jqForm, options) {
					jqForm.wpcf7ClearResponseOutput();
					jqForm.find('img.ajax-loader').css({ visibility: 'visible' });
					return true;
				},
				beforeSerialize: function(jqForm, options) {
					jqForm.find('.wpcf7-use-title-as-watermark.watermark').each(function(i, n) {
						$(n).val('');
					});
					return true;
				},
				data: { '_wpcf7_is_ajax_call': 1 },
				dataType: 'json',
				success: function(data) {
					var ro = $(data.into).find('div.wpcf7-response-output');
					$(data.into).wpcf7ClearResponseOutput();

					if (data.invalids) {
						$.each(data.invalids, function(i, n) {
							$(data.into).find(n.into).wpcf7NotValidTip(n.message);
						});
						ro.addClass('wpcf7-validation-errors');
					}

					if (data.captcha)
						$(data.into).wpcf7RefillCaptcha(data.captcha);

					if (data.quiz)
						$(data.into).wpcf7RefillQuiz(data.quiz);

					if (1 == data.spam)
						ro.addClass('wpcf7-spam-blocked');

					if (1 == data.mailSent) {
						$(data.into).find('form').resetForm().clearForm();
						ro.addClass('wpcf7-mail-sent-ok');

						if (data.onSentOk)
							$.each(data.onSentOk, function(i, n) { eval(n) });
					} else {
						ro.addClass('wpcf7-mail-sent-ng');
					}

					if (data.onSubmit)
						$.each(data.onSubmit, function(i, n) { eval(n) });

					$(data.into).find('.wpcf7-use-title-as-watermark.watermark').each(function(i, n) {
						$(n).val($(n).attr('title'));
					});

					ro.append(data.message).slideDown('fast');
				}
			});

			$('div.wpcf7 > form').each(function(i, n) {
				if (_wpcf7.cached)
					$(n).wpcf7OnloadRefill();

				$(n).wpcf7ToggleSubmit();

				$(n).find('.wpcf7-acceptance').click(function() {
					$(n).wpcf7ToggleSubmit();
				});

				$(n).find('.wpcf7-exclusive-checkbox').each(function(i, n) {
					$(n).find('input:checkbox').click(function() {
						$(n).find('input:checkbox').not(this).removeAttr('checked');
					});
				});

				$(n).find('.wpcf7-use-title-as-watermark').each(function(i, n) {
					var input = $(n);
					input.val(input.attr('title'));
					input.addClass('watermark');

					input.focus(function() {
						if ($(this).hasClass('watermark'))
							$(this).val('').removeClass('watermark');
					});

					input.blur(function() {
						if ('' == $(this).val())
							$(this).val($(this).attr('title')).addClass('watermark');
					});
				});
			});

		} catch (e) {
		}
	});

	$.fn.wpcf7ToggleSubmit = function() {
		return this.each(function() {
			var form = $(this);
			if (this.tagName.toLowerCase() != 'form')
				form = $(this).find('form').first();

			if (form.hasClass('wpcf7-acceptance-as-validation'))
				return;

			var submit = form.find('input:submit');
			if (! submit.length) return;

			var acceptances = form.find('input:checkbox.wpcf7-acceptance');
			if (! acceptances.length) return;

			submit.removeAttr('disabled');
			acceptances.each(function(i, n) {
				n = $(n);
				if (n.hasClass('wpcf7-invert') && n.is(':checked')
				|| ! n.hasClass('wpcf7-invert') && ! n.is(':checked'))
					submit.attr('disabled', 'disabled');
			});
		});
	};

	$.fn.wpcf7NotValidTip = function(message) {
		return this.each(function() {
			var into = $(this);
			into.append('<span class="wpcf7-not-valid-tip">' + message + '</span>');
			$('span.wpcf7-not-valid-tip').mouseover(function() {
				$(this).fadeOut('fast');
			});
			into.find(':input').mouseover(function() {
				into.find('.wpcf7-not-valid-tip').not(':hidden').fadeOut('fast');
			});
			into.find(':input').focus(function() {
				into.find('.wpcf7-not-valid-tip').not(':hidden').fadeOut('fast');
			});
		});
	};

	$.fn.wpcf7OnloadRefill = function() {
		return this.each(function() {
			var url = $(this).attr('action');
			if (0 < url.indexOf('#'))
				url = url.substr(0, url.indexOf('#'));

			var id = $(this).find('input[name="_wpcf7"]').val();
			var unitTag = $(this).find('input[name="_wpcf7_unit_tag"]').val();

			$.getJSON(url,
				{ _wpcf7_is_ajax_call: 1, _wpcf7: id },
				function(data) {
					if (data && data.captcha)
						$('#' + unitTag).wpcf7RefillCaptcha(data.captcha);

					if (data && data.quiz)
						$('#' + unitTag).wpcf7RefillQuiz(data.quiz);
				}
			);
		});
	};

	$.fn.wpcf7RefillCaptcha = function(captcha) {
		return this.each(function() {
			var form = $(this);

			$.each(captcha, function(i, n) {
				form.find(':input[name="' + i + '"]').clearFields();
				form.find('img.wpcf7-captcha-' + i).attr('src', n);
				var match = /([0-9]+)\.(png|gif|jpeg)$/.exec(n);
				form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[1]);
			});
		});
	};

	$.fn.wpcf7RefillQuiz = function(quiz) {
		return this.each(function() {
			var form = $(this);

			$.each(quiz, function(i, n) {
				form.find(':input[name="' + i + '"]').clearFields();
				form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[0]);
				form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[1]);
			});
		});
	};

	$.fn.wpcf7ClearResponseOutput = function() {
		return this.each(function() {
			$(this).find('div.wpcf7-response-output').hide().empty().removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked');
			$(this).find('span.wpcf7-not-valid-tip').remove();
			$(this).find('img.ajax-loader').css({ visibility: 'hidden' });
		});
	};

})(jQuery);
;var poll_id=0,poll_answer_id="",is_being_voted=false;pollsL10n.show_loading=parseInt(pollsL10n.show_loading);pollsL10n.show_fading=parseInt(pollsL10n.show_fading);
function poll_vote(a){if(is_being_voted)alert(pollsL10n.text_wait);else{set_is_being_voted(true);poll_id=a;poll_answer_id="";poll_multiple_ans_count=poll_multiple_ans=0;if(jQuery("#poll_multiple_ans_"+poll_id).length)poll_multiple_ans=parseInt(jQuery("#poll_multiple_ans_"+poll_id).val());jQuery("#polls_form_"+poll_id+" input:checkbox, #polls_form_"+poll_id+" input:radio").each(function(){if(jQuery(this).is(":checked"))if(poll_multiple_ans>0){poll_answer_id=jQuery(this).val()+","+poll_answer_id;poll_multiple_ans_count++}else poll_answer_id=
parseInt(jQuery(this).val())});if(poll_multiple_ans>0)if(poll_multiple_ans_count>0&&poll_multiple_ans_count<=poll_multiple_ans){poll_answer_id=poll_answer_id.substring(0,poll_answer_id.length-1);poll_process()}else if(poll_multiple_ans_count==0){set_is_being_voted(false);alert(pollsL10n.text_valid)}else{set_is_being_voted(false);alert(pollsL10n.text_multiple+" "+poll_multiple_ans)}else if(poll_answer_id>0)poll_process();else{set_is_being_voted(false);alert(pollsL10n.text_valid)}}}
function poll_process(){if(pollsL10n.show_fading)jQuery("#polls-"+poll_id).fadeTo("def",0,function(){pollsL10n.show_loading&&jQuery("#polls-"+poll_id+"-loading").show();jQuery.ajax({type:"POST",url:pollsL10n.ajax_url,data:"vote=true&poll_id="+poll_id+"&poll_"+poll_id+"="+poll_answer_id,cache:false,success:poll_process_success})});else{pollsL10n.show_loading&&jQuery("#polls-"+poll_id+"-loading").show();jQuery.ajax({type:"POST",url:pollsL10n.ajax_url,data:"vote=true&poll_id="+poll_id+"&poll_"+poll_id+
"="+poll_answer_id,cache:false,success:poll_process_success})}}
function poll_result(a){if(is_being_voted)alert(pollsL10n.text_wait);else{set_is_being_voted(true);poll_id=a;if(pollsL10n.show_fading)jQuery("#polls-"+poll_id).fadeTo("def",0,function(){pollsL10n.show_loading&&jQuery("#polls-"+poll_id+"-loading").show();jQuery.ajax({type:"GET",url:pollsL10n.ajax_url,data:"pollresult="+poll_id,cache:false,success:poll_process_success})});else{pollsL10n.show_loading&&jQuery("#polls-"+poll_id+"-loading").show();jQuery.ajax({type:"GET",url:pollsL10n.ajax_url,data:"pollresult="+
poll_id,cache:false,success:poll_process_success})}}}
function poll_booth(a){if(is_being_voted)alert(pollsL10n.text_wait);else{set_is_being_voted(true);poll_id=a;if(pollsL10n.show_fading)jQuery("#polls-"+poll_id).fadeTo("def",0,function(){pollsL10n.show_loading&&jQuery("#polls-"+poll_id+"-loading").show();jQuery.ajax({type:"GET",url:pollsL10n.ajax_url,data:"pollbooth="+poll_id,cache:false,success:poll_process_success})});else{pollsL10n.show_loading&&jQuery("#polls-"+poll_id+"-loading").show();jQuery.ajax({type:"GET",url:pollsL10n.ajax_url,data:"pollbooth="+
poll_id,cache:false,success:poll_process_success})}}}function poll_process_success(a){jQuery("#polls-"+poll_id).replaceWith(a);pollsL10n.show_loading&&jQuery("#polls-"+poll_id+"-loading").hide();pollsL10n.show_fading?jQuery("#polls-"+poll_id).fadeTo("def",1,function(){set_is_being_voted(false)}):set_is_being_voted(false)}function set_is_being_voted(a){is_being_voted=a};
