/** Version 2.0 **/
function emobascript(email, ename, id, eclass, estyle, hover) {
	var cleanName = ename.replace(/&lt;/g, '<');
  var mailtoString = 'mailto:';
  var mailNode = document.getElementById(id);
  var linkNode = document.createElement('a');
  linkNode.className = eclass+'emoba-link';
  linkNode.title = 'Send email';
  linkNode.id = id;
  if (estyle) {linkNode.setAttribute('style', estyle);}
  var mailtolink = mailtoString + email;
  linkNode.href = mailtolink;
	if (hover == 1) {
		var spanNode = document.createElement('span');
		spanNode.className = 'emoba-hover';
		spanNode.innerHTML = 'Click to email ';
		linkNode.appendChild(spanNode);
		linkNode.className = 'emoba-pop';
	}
  var tNode = document.createElement('span');
  tNode.className = 'emoba-realname';
  tNode.innerHTML = cleanName;
  linkNode.appendChild(tNode);
  mailNode.parentNode.replaceChild(linkNode, mailNode);
}
;/*
	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 ) {
	}

	

}




;// commentluv 2.90.9.1
jQuery(document).ready(function(){
    // get the form object and fields
    var formObj = jQuery('#cl_post_title').parents('form');
    var urlObj = cl_settings['urlObj'] = jQuery("input[name='" + cl_settings['url'] + "']",formObj);
    var comObj = cl_settings['comObj'] = jQuery("textarea[name='" + cl_settings['comment'] + "']",formObj);
    var autObj = jQuery("input[name='" + cl_settings['name'] + "']",formObj);
    var emaObj = jQuery("input[name='" + cl_settings['email'] + "']",formObj);
    // setup localized object with temporary vars
    cl_settings['url_value'] = urlObj.val();
    cl_settings['fired'] = 'no';
    // set event listener for textarea focus
    comObj.focus(function(){
        cl_dostuff();
    });
    // set the event listener for the click of the checkbox
    jQuery('#doluv').click(function(){
        jQuery('#lastposts').hide();
        if(jQuery(this).is(":checked")){
            // was unchecked, now is checked
            jQuery('#mylastpost').fadeTo("fast",1);
            cl_settings['fired'] = 'no';
            cl_dostuff();
        } else {
            // was checked, user unchecked it so empty hidden fields in form
            jQuery('input[name="cl_post_title"]').val("");
            jQuery('input[name="cl_post_url"]').val("");
            jQuery('#mylastpost').fadeTo("slow",0.3);
            jQuery('#lastposts').empty();
        }
    });
    // click event for last blog post link
    jQuery('.cluv a').click(function(){
        var data = jQuery(this).attr('class').split(' ');
        // store click count
        jQuery.ajax({
            url: cl_settings['api_url'],
            type: 'POST',
            data: {'action': 'cl_ajax','cid': data[1],'nonce':data[0],'cl_prem':jQuery(this).hasClass('p'),'url': jQuery(this).attr('href'),'do':'click'} 
        });
        jQuery(this).attr('target','_blank');
        return true;
    });
    // hover event on heart
    if(cl_settings['infopanel'] == "on"){
        jQuery('.heart_tip_box').mouseenter(heart_big);
    }
    // hide/show showmore
    jQuery(document.body).click(function(){
        if(cl_settings['lastposts'] == 'showing'){
            jQuery('#lastposts').slideUp('',function(){cl_settings['lastposts'] = 'not'}); 
        }
    });
    jQuery('#showmorespan img').click(function(){
        if(cl_settings['lastposts'] == 'not'){
            jQuery('#lastposts').slideDown('',function(){cl_settings['lastposts'] = 'showing'}); 
        } 
    });
    // clear hidden inputs on load
    jQuery('#cl_post_title,#cl_post_url,#cl_prem').val('');
    // set click on anywhere closes info box 
    jQuery(document).click(heart_small);
    // add info panel to page
    jQuery("body").append('<span id="heart_tip_big" style="display: none;position:absolute; z-index: 1001; background-color: ' + cl_settings['infoback'] + '; color: ' + cl_settings['infotext'] + '; width: 62px;"></span>');

});

/**
* checks everything is in place for doing stuff
* returns string 'ok' if, um, ok
*/
function cl_docheck(){
    // checkbox check
    if(!jQuery('#doluv').is(':checked')){
        return 'not checked';
    }
    var url = cl_settings['urlObj'];
    var msg = jQuery('#cl_messages');
    msg.empty();
    url.removeClass('cl_error');
    // logged in user?
    var nourlmessage = cl_settings['no_url_message'];
    if(cl_settings['logged_in'] == '1'){
        nourlmessage = cl_settings['no_url_logged_in_message'];
    } else {
        // check if fb connect is active
        if(!cl_settings['urlObj'].is(':visible') && typeof FB != 'undefined'){
            var invisurl = cl_settings['urlObj'].remove();
            var invismsg = jQuery('#cl_messages').remove();
            cl_settings['comObj'].after('<br><span id="invisurl">').after(invismsg);
            jQuery('#invisurl').append('URL ').after(invisurl).append('</span>');
        }

    }
    // check that there is a value in the url field
    if(url.val().length > 1){
        // is value just http:// ?
        if(url.val().toLowerCase() == 'http://'){
            url.addClass('cl_error');
            cl_message(nourlmessage);
            return;
        }
        // is the http:// missing?
        if(url.val().toLowerCase().substring(0,7) != 'http://'){
            url.addClass('cl_error');
            cl_message(cl_settings['no_http_message']);
            return;
        }
    } else {
        // there is no value
        url.addClass('cl_error');
        cl_message(nourlmessage);
        return;
    }
    // if we are here, all is cool mon
    return 'ok';
} 
/**
* tries to fetch last blog posts for a url
*/
function cl_dostuff(){
    if(cl_docheck() != 'ok'){
        return;
    }
    var url = cl_settings['urlObj'];
    if(cl_settings['fired'] == 'yes'){
        // already fired, fire again if current url is different to last fired
        if(url.val() == cl_settings['url_value']){
            return;
        }          
        jQuery('#lastposts,#mylastpost').empty();
    }
    // fire the request to admin
    jQuery('#cl_messages').append('<img src="' + cl_settings['images'] + 'loader.gif' + '"/>').show();
    jQuery.ajax({
        url: cl_settings['api_url'],
        type: 'post',
        dataType: 'json',
        data: {'url':url.val(),'action':'cl_ajax','do':'fetch','_ajax_nonce':cl_settings._fetch},
        success: function(data){
            if(data.error == ''){
                // no error, fill up lastposts div with items returned
                jQuery('#cl_messages').empty().hide();
                jQuery.each(data.items,function(j,item){
                    var title = item.title;
                    var link = item.link;
                    var count = '';
                    jQuery('#lastposts').append('<span id="' + item.link + '" class="choosepost ' + item.type + '">' + title + '</span>');
                });
                // setup first link and hidden fields
                jQuery('#mylastpost').html('<a href="' + data.items[0].link +'"> ' + data.items[0]['title'] + '</a>').fadeIn(1000);
                jQuery('#cl_post_title').val(data.items[0].title);
                jQuery('#cl_post_url').val(data.items[0].link);
                jQuery('#cl_prem').val(data.items[0].p);
                // setup look and show dropdown
                jQuery('span.message').css({'backgroundColor':'#efefef','color':'black'});
                jQuery('#showmorespan img').show();
                if(cl_settings['comObj'].width() > jQuery('#commentluv').width()){
                    var dropdownwidth = jQuery('#commentluv').width();
                } else {
                    var dropdownwidth = jQuery(cl_settings['comObj']).width();
                }
                jQuery('#lastposts').css('width',dropdownwidth).slideDown('',function(){ cl_settings['lastposts'] = 'showing'});
                // bind click action
                jQuery('.choosepost:not(.message)').click(function(){
                    jQuery('#cl_post_title').val(jQuery(this).text());
                    jQuery('#cl_post_url').val(jQuery(this).attr('id'));
                    jQuery('#mylastpost').html('<a href="' + jQuery(this).attr('id') +'"> ' + jQuery(this).text() + '</a>').fadeIn(1000); 
                });
            } else {
                cl_message(data.error);
            }
        },
        error: function(x,e){
            jQuery('#cl_messages img').remove();
            if(x.status==0){
                if(cl_settings['api_url'].indexOf('https') == 0){
                    cl_message('This blog has set the api url to use https , the commentluv technical settings need to be changed for the API url to use http');
                } else {
                    cl_message('It appears that you are offline or another error occured contacting the API url, have you set it to use www or missed the www off the api url?? check the technical settings and add or remove www from the api url.');
                }
                
            }else if(x.status==404){
                cl_message('API URL not found.');
            }else if(x.status==500){
                cl_message('Internal Server Error.' + x.responseText);
            }else if(e=='parsererror'){
                cl_message('Error.\nParsing JSON Request failed.' + x.responseText);
            }else if(e=='timeout'){
                cl_message('Request Time out.');
            }else {
                cl_message('Unknow Error. ' + x.statusText + ' ' + x.responseText);
            }
        }
    });
    // save what url used and that we checked already
    cl_settings['fired'] = 'yes';
    cl_settings['url_value'] = url.val();
    
}
/**
* adds a message to tell the user something in the cl_message div and then slides it down
* @param string message - the message to show
*/
function cl_message(message){
    jQuery('#cl_messages').empty().hide().text(message).slideDown();
}
function heart_big(e){
    // get url and data from link
    linkspan = jQuery(this).parents(".cluv");
    var link = jQuery(linkspan).find("a:first").attr("href");
    var linkdata = jQuery('img',this).attr('class').split(' ');

    // prepare call to admin
    var url = cl_settings['api_url'];
    var data = {'action':'cl_ajax','cid':linkdata[2],'cl_prem':linkdata[1],'link': link,'do':'info','_ajax_nonce':cl_settings._info};
    cl_prem = linkdata[1];
    // set up position
    var position = jQuery(this).offset();
    var windowwidth = jQuery(window).width();
    windowheight = jQuery(window).height();
    var xpos = position.left;
    ypos = position.top;                   
    if(xpos + 350 > windowwidth){
        xpos = windowwidth - 370;
        if(xpos < 0) xpos = 0;
    }

    // setup panel and show with loading background image
    jQuery('#heart_tip_big').empty().css({'left':xpos + "px", 'top' :ypos + "px" });
    jQuery('#heart_tip_big').css("width","350px");
    jQuery('#heart_tip_big').addClass("finalbig").show().addClass('cl_ajax');
    // has this been shown before on this page?
    if(typeof cl_settings[linkdata[2]] != 'undefined'){
        fill_panel(cl_settings[linkdata[2]]);
        return;
    }
    // execute call to admin
    jQuery.ajax({
        url: cl_settings['api_url'],
        type: 'post',
        data: data,
        dataType: 'json',
        success : function(data){
            if(typeof(data) == 'object' && jQuery('#heart_tip_big').is(':visible')){
                // acceptable response, populate panel
                cl_settings[linkdata[2]] = data.panel;
                fill_panel(data.panel);
            } else {
                jQuery('#heart_tip_big').removeClass('cl_ajax').html(cl_settings['no_info_message']);
            }
            jQuery('#heart_tip_big').mouseleave(heart_small);
        }   
    });
}

function fill_panel(html){
    jQuery('#heart_tip_big').removeClass('cl_ajax').html(html).show();
    if(cl_prem == 'p'){
        jQuery('#heart_tip_big p.cl_title').css('backgroundColor',cl_settings['infoback']);
    }
    // move panel if it extends below window
    var ely = ypos - jQuery(document).scrollTop();
    var poph = jQuery('#heart_tip_big').height() + 20;
    if(ely + poph > windowheight){
        var invis = poph - (windowheight - ely);
        ypos -= invis;
        if(ypos < 0) ypos = 0;
        jQuery('#heart_tip_big').css('top',ypos);
    }
    return;
}

function heart_small(){
    if(!jQuery('body').find('.cl_ajax').is(':visible')){
        jQuery("body").find("#heart_tip_big").empty().hide();
    }

}
function do_nowt(){
    return;
}

;if(typeof(nRelate)=='undefined'){var nRelate=window.nRelate={domain:'',clicked_link:null,load_link:false,track_enabled:[false,false,false],domready:false,domready_bound:false,domready_list:[],flyout_show:true,ie_browser:navigator.appName=='Microsoft Internet Explorer',loadFrame:function(){if(nRelate.load_link){nRelate.load_link=false;window.location.href=nRelate.clicked_link}},tracking:function(plugin){if(typeof(jQuery)=='undefined'){setTimeout(arguments.callee,0);return}var nr=nRelate;if(plugin=="rc"&&nr.track_enabled[0])return;if(plugin=="mp"&&nr.track_enabled[1])return;if(plugin=="fo"&&nr.track_enabled[2])return;if(plugin=="rc")nr.track_enabled[0]=true;else if(plugin=="mp")nr.track_enabled[1]=true;else nr.track_enabled[2]=true;jQuery('.nr_'+plugin+'_link').live('click',function(event){if(jQuery(this).hasClass('nr_partner')){return true}var src_url=window.location.href;var iframe_src="http://t.nrelate.com/tracking/";if(jQuery(this).hasClass('nr_avid')){nr_type='avid'}else if(jQuery(this).hasClass('nr_external')){nr_type='external'}else{nr_type='internal'}iframe_src+="?plugin="+escape(plugin)+"&type="+escape(nr_type)+"&domain="+nr.domain+"&src_url="+escape(src_url)+"&dest_url="+escape(jQuery(this).attr('href'));if(nr_type!='avid'){nr.load_link=true;nr.clicked_link=jQuery(this).attr('href')}on_load_function=event.ctrlKey?"void(0)":"nRelate.loadFrame()";jQuery('<iframe id="nr_clickthrough_frame_'+Math.ceil(100*Math.random())+'" height="0" width="0" style="border-width: 0px; display:none;" src="'+iframe_src+'" onload="javascript:'+on_load_function+'"></iframe>').appendTo('body');return(event.ctrlKey?true:false)})},fixHeight:function(id){if(typeof(jQuery)=='undefined'){var r=arguments.callee;setTimeout(function(){r(id)},0);return}var sel='#'+id+' a';if(jQuery(sel+':first').length==0)return;var currentTallest=0,currentRowStart=0,rowDivs=new Array(),$el,topPosition=0,num_cols=0,num_rows=0,row_counter=0,id_string='';currentRowStart=jQuery(sel+':first').position().top;jQuery(sel).each(function(){$el=jQuery(this);$el.append('<div class="nr_clear" style="height:1px;"></div>');topPostion=$el.position().top;if(currentRowStart!=topPostion){for(currentDiv=0;currentDiv<rowDivs.length;currentDiv++){rowDivs[currentDiv].height(currentTallest)}rowDivs.length=0;currentRowStart=topPostion;currentTallest=$el.innerHeight();rowDivs.push($el)}else{rowDivs.push($el);currentTallest=(currentTallest<$el.innerHeight())?($el.innerHeight()):(currentTallest)}for(currentDiv=0;currentDiv<rowDivs.length;currentDiv++){rowDivs[currentDiv].height(currentTallest)}});topPosition=jQuery(sel+':first').position().top;var _elements=jQuery(sel);for(var i=0;i<_elements.length;i++){if(jQuery(_elements[i]).position().top!=topPosition)break;num_cols++}num_rows=Math.ceil(_elements.length/num_cols);var _row_counter=1,_col_counter=1,row_even_odd,col_even_odd,nr_first_col,nr_last_col,nr_first_row,nr_last_row;for(var i=0;i<_elements.length;i++){$el=jQuery(_elements[i]);row_even_odd=(_row_counter%2==0)?' nr_even_row':' nr_odd_row';col_even_odd=(_col_counter%2==0)?' nr_even_col':' nr_odd_col';nr_first_col=(_col_counter==1)?' nr_first_col':'';nr_last_col=(_col_counter==num_cols&&nr_first_col=='')?' nr_last_col':'';nr_first_row=(_row_counter==1)?' nr_first_row':'';nr_last_row=(_row_counter==num_rows&&nr_first_row=='')?' nr_last_row':'';$el.addClass('nr_row_'+_row_counter+' nr_col_'+_col_counter+row_even_odd+col_even_odd+nr_first_col+nr_last_col+nr_first_row+nr_last_row);_col_counter++;if(_col_counter>num_cols){_col_counter=1;_row_counter++}}jQuery('#'+id+'.nrelate_pol').addClass('rotate')},adAnimation:function(id){if(typeof(jQuery)=='undefined'){var r=arguments.callee;setTimeout(function(){r(id)},0);return}jQuery('#'+id+' .nr_panel .nr_sponsored').hover(function(){jQuery(this).stop();jQuery(this).animate({'left':'0px'},200)},function(){jQuery(this).stop();jQuery(this).animate({'left':(jQuery(this).parent().width()-18)+'px'},200)})},getScript:function(url,async){var sc=document.createElement('script');sc.type='text/javascript';sc.src=url;if(async)sc.async=true;document.getElementsByTagName('head')[0].appendChild(sc)},bindDomReady:function(fn){var nr=nRelate;if(nr.domready){fn();return}nr.domready_list.push(fn);if(nr.domready_bound)return;nr.domready_bound=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",nr.domReadyReached,false)}else if(document.attachEvent){document.attachEvent("onreadystatechange",nr.readyStateChange);var toplevel=false;try{toplevel=window.frameElement==null}catch(e){}if(document.documentElement.doScroll&&toplevel){nr.scrollCheck()}}},readyStateChange:function(){var d=document,r=arguments.callee;if(d.readyState==="complete"){d.detachEvent("onreadystatechange",r);nRelate.domReadyReached()}},scrollCheck:function(){var nr=nRelate;if(nr.domready){nr.domReadyReached();return}try{document.documentElement.doScroll("left")}catch(e){setTimeout(nr.scrollCheck,0);return}nr.domReadyReached()},domReadyReached:function(){var nr=nRelate;if(nr.domready)return;nr.domready=true;if(document.addEventListener)document.removeEventListener("DOMContentLoaded",nr.domReadyReached,false);for(var i=0;i<nr.domready_list.length;i++){nr.domready_list[i]()}nr.domready_list=[]},getNrelatePosts:function(url){var nr=nRelate;if(nr.ie_browser&&!nr.domready){nr.bindDomReady(function(){nr.getNrelatePosts(url)});return}if(nr.ie_browser){nr.getScript(url,true)}else{nr.jsIframe(url,'nRelate=window.parent.nRelate;')}},sw:function(content,id){var nr=nRelate;var plugin='';if(id.match('popular'))plugin='mp';if(id.match('related'))plugin='rc';if(id.match('flyout'))plugin='fo';if(document.getElementById(id)){document.getElementById(id).innerHTML=content;nr.fixHeight(id);nr.adAnimation(id);nr.tracking(plugin)}},jsIframe:function(resource_url,custom_js){var doc=document;nrDiv=doc.createElement('div');nrDiv.style.display='none';ifr=doc.createElement('iframe');ifr.frameBorder='0';ifr.allowTransparency='true';nrDiv.appendChild(ifr);doc.body.appendChild(nrDiv);domainSrc="javascript:var d=document.open(); d.domain='"+doc.domain+"';";try{ifr.contentWindow.document.open()}catch(e){iframe.src=domainSrc+"void(0);"}var self_script='';custom_js=typeof(custom_js)=='string'?custom_js:'';resource_url=resource_url.replace(/\'/g,"\\'");iframe_html='<body onload="d=document; '+custom_js+'d.getElementsByTagName(\'head\')[0].appendChild(d.createElement(\'script\')).src=\''+resource_url+'\';"></body>';try{var d=ifr.contentWindow.document;d.write(iframe_html);d.close()}catch(e){ifr.src=domainSrc+'d.write("'+iframe_html.replace(/"/g,'\\"')+'");d.close();'}},flyout_fix_height:function(){jQuery(".nrelate_flyout").css({"right":"0px","display":"none"})}}}
;/*!
 * jquery.qtip. The jQuery tooltip plugin
 *
 * Copyright (c) 2009 Craig Thompson
 * http://craigsworks.com
 *
 * Licensed under MIT
 * http://www.opensource.org/licenses/mit-license.php
 *
 * Launch  : February 2009
 * Version : 1.0.0-rc3
 * Released: Tuesday 12th May, 2009 - 00:00
 * Debug: jquery.qtip.debug.js
 */
(function(f){f.fn.qtip=function(B,u){var y,t,A,s,x,w,v,z;if(typeof B=="string"){if(typeof f(this).data("qtip")!=="object"){f.fn.qtip.log.error.call(self,1,f.fn.qtip.constants.NO_TOOLTIP_PRESENT,false)}if(B=="api"){return f(this).data("qtip").interfaces[f(this).data("qtip").current]}else{if(B=="interfaces"){return f(this).data("qtip").interfaces}}}else{if(!B){B={}}if(typeof B.content!=="object"||(B.content.jquery&&B.content.length>0)){B.content={text:B.content}}if(typeof B.content.title!=="object"){B.content.title={text:B.content.title}}if(typeof B.position!=="object"){B.position={corner:B.position}}if(typeof B.position.corner!=="object"){B.position.corner={target:B.position.corner,tooltip:B.position.corner}}if(typeof B.show!=="object"){B.show={when:B.show}}if(typeof B.show.when!=="object"){B.show.when={event:B.show.when}}if(typeof B.show.effect!=="object"){B.show.effect={type:B.show.effect}}if(typeof B.hide!=="object"){B.hide={when:B.hide}}if(typeof B.hide.when!=="object"){B.hide.when={event:B.hide.when}}if(typeof B.hide.effect!=="object"){B.hide.effect={type:B.hide.effect}}if(typeof B.style!=="object"){B.style={name:B.style}}B.style=c(B.style);s=f.extend(true,{},f.fn.qtip.defaults,B);s.style=a.call({options:s},s.style);s.user=f.extend(true,{},B)}return f(this).each(function(){if(typeof B=="string"){w=B.toLowerCase();A=f(this).qtip("interfaces");if(typeof A=="object"){if(u===true&&w=="destroy"){while(A.length>0){A[A.length-1].destroy()}}else{if(u!==true){A=[f(this).qtip("api")]}for(y=0;y<A.length;y++){if(w=="destroy"){A[y].destroy()}else{if(A[y].status.rendered===true){if(w=="show"){A[y].show()}else{if(w=="hide"){A[y].hide()}else{if(w=="focus"){A[y].focus()}else{if(w=="disable"){A[y].disable(true)}else{if(w=="enable"){A[y].disable(false)}}}}}}}}}}}else{v=f.extend(true,{},s);v.hide.effect.length=s.hide.effect.length;v.show.effect.length=s.show.effect.length;if(v.position.container===false){v.position.container=f(document.body)}if(v.position.target===false){v.position.target=f(this)}if(v.show.when.target===false){v.show.when.target=f(this)}if(v.hide.when.target===false){v.hide.when.target=f(this)}t=f.fn.qtip.interfaces.length;for(y=0;y<t;y++){if(typeof f.fn.qtip.interfaces[y]=="undefined"){t=y;break}}x=new d(f(this),v,t);f.fn.qtip.interfaces[t]=x;if(typeof f(this).data("qtip")==="object"&&f(this).data("qtip")){if(typeof f(this).attr("qtip")==="undefined"){f(this).data("qtip").current=f(this).data("qtip").interfaces.length}f(this).data("qtip").interfaces.push(x)}else{f(this).data("qtip",{current:0,interfaces:[x]})}if(v.content.prerender===false&&v.show.when.event!==false&&v.show.ready!==true){v.show.when.target.bind(v.show.when.event+".qtip-"+t+"-create",{qtip:t},function(C){z=f.fn.qtip.interfaces[C.data.qtip];z.options.show.when.target.unbind(z.options.show.when.event+".qtip-"+C.data.qtip+"-create");z.cache.mouse={x:C.pageX,y:C.pageY};p.call(z);z.options.show.when.target.trigger(z.options.show.when.event)})}else{x.cache.mouse={x:v.show.when.target.offset().left,y:v.show.when.target.offset().top};p.call(x)}}})};function d(u,t,v){var s=this;s.id=v;s.options=t;s.status={animated:false,rendered:false,disabled:false,focused:false};s.elements={target:u.addClass(s.options.style.classes.target),tooltip:null,wrapper:null,content:null,contentWrapper:null,title:null,button:null,tip:null,bgiframe:null};s.cache={mouse:{},position:{},toggle:0};s.timers={};f.extend(s,s.options.api,{show:function(y){var x,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"show")}if(s.elements.tooltip.css("display")!=="none"){return s}s.elements.tooltip.stop(true,false);x=s.beforeShow.call(s,y);if(x===false){return s}function w(){if(s.options.position.type!=="static"){s.focus()}s.onShow.call(s,y);if(f.browser.msie){s.elements.tooltip.get(0).style.removeAttribute("filter")}}s.cache.toggle=1;if(s.options.position.type!=="static"){s.updatePosition(y,(s.options.show.effect.length>0))}if(typeof s.options.show.solo=="object"){z=f(s.options.show.solo)}else{if(s.options.show.solo===true){z=f("div.qtip").not(s.elements.tooltip)}}if(z){z.each(function(){if(f(this).qtip("api").status.rendered===true){f(this).qtip("api").hide()}})}if(typeof s.options.show.effect.type=="function"){s.options.show.effect.type.call(s.elements.tooltip,s.options.show.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.show.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeIn(s.options.show.effect.length,w);break;case"slide":s.elements.tooltip.slideDown(s.options.show.effect.length,function(){w();if(s.options.position.type!=="static"){s.updatePosition(y,true)}});break;case"grow":s.elements.tooltip.show(s.options.show.effect.length,w);break;default:s.elements.tooltip.show(null,w);break}s.elements.tooltip.addClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_SHOWN,"show")},hide:function(y){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"hide")}else{if(s.elements.tooltip.css("display")==="none"){return s}}clearTimeout(s.timers.show);s.elements.tooltip.stop(true,false);x=s.beforeHide.call(s,y);if(x===false){return s}function w(){s.onHide.call(s,y)}s.cache.toggle=0;if(typeof s.options.hide.effect.type=="function"){s.options.hide.effect.type.call(s.elements.tooltip,s.options.hide.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.hide.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeOut(s.options.hide.effect.length,w);break;case"slide":s.elements.tooltip.slideUp(s.options.hide.effect.length,w);break;case"grow":s.elements.tooltip.hide(s.options.hide.effect.length,w);break;default:s.elements.tooltip.hide(null,w);break}s.elements.tooltip.removeClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_HIDDEN,"hide")},updatePosition:function(w,x){var C,G,L,J,H,E,y,I,B,D,K,A,F,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updatePosition")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_POSITION_STATIC,"updatePosition")}}G={position:{left:0,top:0},dimensions:{height:0,width:0},corner:s.options.position.corner.target};L={position:s.getPosition(),dimensions:s.getDimensions(),corner:s.options.position.corner.tooltip};if(s.options.position.target!=="mouse"){if(s.options.position.target.get(0).nodeName.toLowerCase()=="area"){J=s.options.position.target.attr("coords").split(",");for(C=0;C<J.length;C++){J[C]=parseInt(J[C])}H=s.options.position.target.parent("map").attr("name");E=f('img[usemap="#'+H+'"]:first').offset();G.position={left:Math.floor(E.left+J[0]),top:Math.floor(E.top+J[1])};switch(s.options.position.target.attr("shape").toLowerCase()){case"rect":G.dimensions={width:Math.ceil(Math.abs(J[2]-J[0])),height:Math.ceil(Math.abs(J[3]-J[1]))};break;case"circle":G.dimensions={width:J[2]+1,height:J[2]+1};break;case"poly":G.dimensions={width:J[0],height:J[1]};for(C=0;C<J.length;C++){if(C%2==0){if(J[C]>G.dimensions.width){G.dimensions.width=J[C]}if(J[C]<J[0]){G.position.left=Math.floor(E.left+J[C])}}else{if(J[C]>G.dimensions.height){G.dimensions.height=J[C]}if(J[C]<J[1]){G.position.top=Math.floor(E.top+J[C])}}}G.dimensions.width=G.dimensions.width-(G.position.left-E.left);G.dimensions.height=G.dimensions.height-(G.position.top-E.top);break;default:return f.fn.qtip.log.error.call(s,4,f.fn.qtip.constants.INVALID_AREA_SHAPE,"updatePosition");break}G.dimensions.width-=2;G.dimensions.height-=2}else{if(s.options.position.target.add(document.body).length===1){G.position={left:f(document).scrollLeft(),top:f(document).scrollTop()};G.dimensions={height:f(window).height(),width:f(window).width()}}else{if(typeof s.options.position.target.attr("qtip")!=="undefined"){G.position=s.options.position.target.qtip("api").cache.position}else{G.position=s.options.position.target.offset()}G.dimensions={height:s.options.position.target.outerHeight(),width:s.options.position.target.outerWidth()}}}y=f.extend({},G.position);if(G.corner.search(/right/i)!==-1){y.left+=G.dimensions.width}if(G.corner.search(/bottom/i)!==-1){y.top+=G.dimensions.height}if(G.corner.search(/((top|bottom)Middle)|center/)!==-1){y.left+=(G.dimensions.width/2)}if(G.corner.search(/((left|right)Middle)|center/)!==-1){y.top+=(G.dimensions.height/2)}}else{G.position=y={left:s.cache.mouse.x,top:s.cache.mouse.y};G.dimensions={height:1,width:1}}if(L.corner.search(/right/i)!==-1){y.left-=L.dimensions.width}if(L.corner.search(/bottom/i)!==-1){y.top-=L.dimensions.height}if(L.corner.search(/((top|bottom)Middle)|center/)!==-1){y.left-=(L.dimensions.width/2)}if(L.corner.search(/((left|right)Middle)|center/)!==-1){y.top-=(L.dimensions.height/2)}I=(f.browser.msie)?1:0;B=(f.browser.msie&&parseInt(f.browser.version.charAt(0))===6)?1:0;if(s.options.style.border.radius>0){if(L.corner.search(/Left/)!==-1){y.left-=s.options.style.border.radius}else{if(L.corner.search(/Right/)!==-1){y.left+=s.options.style.border.radius}}if(L.corner.search(/Top/)!==-1){y.top-=s.options.style.border.radius}else{if(L.corner.search(/Bottom/)!==-1){y.top+=s.options.style.border.radius}}}if(I){if(L.corner.search(/top/)!==-1){y.top-=I}else{if(L.corner.search(/bottom/)!==-1){y.top+=I}}if(L.corner.search(/left/)!==-1){y.left-=I}else{if(L.corner.search(/right/)!==-1){y.left+=I}}if(L.corner.search(/leftMiddle|rightMiddle/)!==-1){y.top-=1}}if(s.options.position.adjust.screen===true){y=o.call(s,y,G,L)}if(s.options.position.target==="mouse"&&s.options.position.adjust.mouse===true){if(s.options.position.adjust.screen===true&&s.elements.tip){K=s.elements.tip.attr("rel")}else{K=s.options.position.corner.tooltip}y.left+=(K.search(/right/i)!==-1)?-6:6;y.top+=(K.search(/bottom/i)!==-1)?-6:6}if(!s.elements.bgiframe&&f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){f("select, object").each(function(){A=f(this).offset();A.bottom=A.top+f(this).height();A.right=A.left+f(this).width();if(y.top+L.dimensions.height>=A.top&&y.left+L.dimensions.width>=A.left){k.call(s)}})}y.left+=s.options.position.adjust.x;y.top+=s.options.position.adjust.y;F=s.getPosition();if(y.left!=F.left||y.top!=F.top){z=s.beforePositionUpdate.call(s,w);if(z===false){return s}s.cache.position=y;if(x===true){s.status.animated=true;s.elements.tooltip.animate(y,200,"swing",function(){s.status.animated=false})}else{s.elements.tooltip.css(y)}s.onPositionUpdate.call(s,w);if(typeof w!=="undefined"&&w.type&&w.type!=="mousemove"){f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_POSITION_UPDATED,"updatePosition")}}return s},updateWidth:function(w){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateWidth")}else{if(w&&typeof w!=="number"){return f.fn.qtip.log.error.call(s,2,"newWidth must be of type number","updateWidth")}}x=s.elements.contentWrapper.siblings().add(s.elements.tip).add(s.elements.button);if(!w){if(typeof s.options.style.width.value=="number"){w=s.options.style.width.value}else{s.elements.tooltip.css({width:"auto"});x.hide();if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"normal"})}w=s.getDimensions().width+1;if(!s.options.style.width.value){if(w>s.options.style.width.max){w=s.options.style.width.max}if(w<s.options.style.width.min){w=s.options.style.width.min}}}}if(w%2!==0){w-=1}s.elements.tooltip.width(w);x.show();if(s.options.style.border.radius){s.elements.tooltip.find(".qtip-betweenCorners").each(function(y){f(this).width(w-(s.options.style.border.radius*2))})}if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"1"});s.elements.wrapper.width(w);if(s.elements.bgiframe){s.elements.bgiframe.width(w).height(s.getDimensions.height)}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_WIDTH_UPDATED,"updateWidth")},updateStyle:function(w){var z,A,x,y,B;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateStyle")}else{if(typeof w!=="string"||!f.fn.qtip.styles[w]){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.STYLE_NOT_DEFINED,"updateStyle")}}s.options.style=a.call(s,f.fn.qtip.styles[w],s.options.user.style);s.elements.content.css(q(s.options.style));if(s.options.content.title.text!==false){s.elements.title.css(q(s.options.style.title,true))}s.elements.contentWrapper.css({borderColor:s.options.style.border.color});if(s.options.style.tip.corner!==false){if(f("<canvas>").get(0).getContext){z=s.elements.tooltip.find(".qtip-tip canvas:first");x=z.get(0).getContext("2d");x.clearRect(0,0,300,300);y=z.parent("div[rel]:first").attr("rel");B=b(y,s.options.style.tip.size.width,s.options.style.tip.size.height);h.call(s,z,B,s.options.style.tip.color||s.options.style.border.color)}else{if(f.browser.msie){z=s.elements.tooltip.find('.qtip-tip [nodeName="shape"]');z.attr("fillcolor",s.options.style.tip.color||s.options.style.border.color)}}}if(s.options.style.border.radius>0){s.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:s.options.style.border.color});if(f("<canvas>").get(0).getContext){A=g(s.options.style.border.radius);s.elements.tooltip.find(".qtip-wrapper canvas").each(function(){x=f(this).get(0).getContext("2d");x.clearRect(0,0,300,300);y=f(this).parent("div[rel]:first").attr("rel");r.call(s,f(this),A[y],s.options.style.border.radius,s.options.style.border.color)})}else{if(f.browser.msie){s.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function(){f(this).attr("fillcolor",s.options.style.border.color)})}}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_STYLE_UPDATED,"updateStyle")},updateContent:function(A,y){var z,x,w;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateContent")}else{if(!A){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateContent")}}z=s.beforeContentUpdate.call(s,A);if(typeof z=="string"){A=z}else{if(z===false){return}}if(f.browser.msie){s.elements.contentWrapper.children().css({zoom:"normal"})}if(A.jquery&&A.length>0){A.clone(true).appendTo(s.elements.content).show()}else{s.elements.content.html(A)}x=s.elements.content.find("img[complete=false]");if(x.length>0){w=0;x.each(function(C){f('<img src="'+f(this).attr("src")+'" />').load(function(){if(++w==x.length){B()}})})}else{B()}function B(){s.updateWidth();if(y!==false){if(s.options.position.type!=="static"){s.updatePosition(s.elements.tooltip.is(":visible"),true)}if(s.options.style.tip.corner!==false){n.call(s)}}}s.onContentUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_UPDATED,"loadContent")},loadContent:function(w,z,A){var y;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"loadContent")}y=s.beforeContentLoad.call(s);if(y===false){return s}if(A=="post"){f.post(w,z,x)}else{f.get(w,z,x)}function x(B){s.onContentLoad.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_LOADED,"loadContent");s.updateContent(B)}return s},updateTitle:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateTitle")}else{if(!w){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateTitle")}}returned=s.beforeTitleUpdate.call(s);if(returned===false){return s}if(s.elements.button){s.elements.button=s.elements.button.clone(true)}s.elements.title.html(w);if(s.elements.button){s.elements.title.prepend(s.elements.button)}s.onTitleUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_TITLE_UPDATED,"updateTitle")},focus:function(A){var y,x,w,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"focus")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_FOCUS_STATIC,"focus")}}y=parseInt(s.elements.tooltip.css("z-index"));x=6000+f("div.qtip[qtip]").length-1;if(!s.status.focused&&y!==x){z=s.beforeFocus.call(s,A);if(z===false){return s}f("div.qtip[qtip]").not(s.elements.tooltip).each(function(){if(f(this).qtip("api").status.rendered===true){w=parseInt(f(this).css("z-index"));if(typeof w=="number"&&w>-1){f(this).css({zIndex:parseInt(f(this).css("z-index"))-1})}f(this).qtip("api").status.focused=false}});s.elements.tooltip.css({zIndex:x});s.status.focused=true;s.onFocus.call(s,A);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_FOCUSED,"focus")}return s},disable:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"disable")}if(w){if(!s.status.disabled){s.status.disabled=true;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DISABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED,"disable")}}else{if(s.status.disabled){s.status.disabled=false;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_ENABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED,"disable")}}return s},destroy:function(){var w,x,y;x=s.beforeDestroy.call(s);if(x===false){return s}if(s.status.rendered){s.options.show.when.target.unbind("mousemove.qtip",s.updatePosition);s.options.show.when.target.unbind("mouseout.qtip",s.hide);s.options.show.when.target.unbind(s.options.show.when.event+".qtip");s.options.hide.when.target.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind("mouseover.qtip",s.focus);s.elements.tooltip.remove()}else{s.options.show.when.target.unbind(s.options.show.when.event+".qtip-create")}if(typeof s.elements.target.data("qtip")=="object"){y=s.elements.target.data("qtip").interfaces;if(typeof y=="object"&&y.length>0){for(w=0;w<y.length-1;w++){if(y[w].id==s.id){y.splice(w,1)}}}}delete f.fn.qtip.interfaces[s.id];if(typeof y=="object"&&y.length>0){s.elements.target.data("qtip").current=y.length-1}else{s.elements.target.removeData("qtip")}s.onDestroy.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DESTROYED,"destroy");return s.elements.target},getPosition:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getPosition")}w=(s.elements.tooltip.css("display")!=="none")?false:true;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x=s.elements.tooltip.offset();if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x},getDimensions:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getDimensions")}w=(!s.elements.tooltip.is(":visible"))?true:false;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x={height:s.elements.tooltip.outerHeight(),width:s.elements.tooltip.outerWidth()};if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x}})}function p(){var s,w,u,t,v,y,x;s=this;s.beforeRender.call(s);s.status.rendered=true;s.elements.tooltip='<div qtip="'+s.id+'" class="qtip '+(s.options.style.classes.tooltip||s.options.style)+'"style="display:none; -moz-border-radius:0; -webkit-border-radius:0; border-radius:0;position:'+s.options.position.type+';">  <div class="qtip-wrapper" style="position:relative; overflow:hidden; text-align:left;">    <div class="qtip-contentWrapper" style="overflow:hidden;">       <div class="qtip-content '+s.options.style.classes.content+'"></div></div></div></div>';s.elements.tooltip=f(s.elements.tooltip);s.elements.tooltip.appendTo(s.options.position.container);s.elements.tooltip.data("qtip",{current:0,interfaces:[s]});s.elements.wrapper=s.elements.tooltip.children("div:first");s.elements.contentWrapper=s.elements.wrapper.children("div:first").css({background:s.options.style.background});s.elements.content=s.elements.contentWrapper.children("div:first").css(q(s.options.style));if(f.browser.msie){s.elements.wrapper.add(s.elements.content).css({zoom:1})}if(s.options.hide.when.event=="unfocus"){s.elements.tooltip.attr("unfocus",true)}if(typeof s.options.style.width.value=="number"){s.updateWidth()}if(f("<canvas>").get(0).getContext||f.browser.msie){if(s.options.style.border.radius>0){m.call(s)}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color})}if(s.options.style.tip.corner!==false){e.call(s)}}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color});s.options.style.border.radius=0;s.options.style.tip.corner=false;f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED,"render")}if((typeof s.options.content.text=="string"&&s.options.content.text.length>0)||(s.options.content.text.jquery&&s.options.content.text.length>0)){u=s.options.content.text}else{if(typeof s.elements.target.attr("title")=="string"&&s.elements.target.attr("title").length>0){u=s.elements.target.attr("title").replace("\\n","<br />");s.elements.target.attr("title","")}else{if(typeof s.elements.target.attr("alt")=="string"&&s.elements.target.attr("alt").length>0){u=s.elements.target.attr("alt").replace("\\n","<br />");s.elements.target.attr("alt","")}else{u=" ";f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.NO_VALID_CONTENT,"render")}}}if(s.options.content.title.text!==false){j.call(s)}s.updateContent(u);l.call(s);if(s.options.show.ready===true){s.show()}if(s.options.content.url!==false){t=s.options.content.url;v=s.options.content.data;y=s.options.content.method||"get";s.loadContent(t,v,y)}s.onRender.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_RENDERED,"render")}function m(){var F,z,t,B,x,E,u,G,D,y,w,C,A,s,v;F=this;F.elements.wrapper.find(".qtip-borderBottom, .qtip-borderTop").remove();t=F.options.style.border.width;B=F.options.style.border.radius;x=F.options.style.border.color||F.options.style.tip.color;E=g(B);u={};for(z in E){u[z]='<div rel="'+z+'" style="'+((z.search(/Left/)!==-1)?"left":"right")+":0; position:absolute; height:"+B+"px; width:"+B+'px; overflow:hidden; line-height:0.1px; font-size:1px">';if(f("<canvas>").get(0).getContext){u[z]+='<canvas height="'+B+'" width="'+B+'" style="vertical-align: top"></canvas>'}else{if(f.browser.msie){G=B*2+3;u[z]+='<v:arc stroked="false" fillcolor="'+x+'" startangle="'+E[z][0]+'" endangle="'+E[z][1]+'" style="width:'+G+"px; height:"+G+"px; margin-top:"+((z.search(/bottom/)!==-1)?-2:-1)+"px; margin-left:"+((z.search(/Right/)!==-1)?E[z][2]-3.5:-1)+'px; vertical-align:top; display:inline-block; behavior:url(#default#VML)"></v:arc>'}}u[z]+="</div>"}D=F.getDimensions().width-(Math.max(t,B)*2);y='<div class="qtip-betweenCorners" style="height:'+B+"px; width:"+D+"px; overflow:hidden; background-color:"+x+'; line-height:0.1px; font-size:1px;">';w='<div class="qtip-borderTop" dir="ltr" style="height:'+B+"px; margin-left:"+B+'px; line-height:0.1px; font-size:1px; padding:0;">'+u.topLeft+u.topRight+y;F.elements.wrapper.prepend(w);C='<div class="qtip-borderBottom" dir="ltr" style="height:'+B+"px; margin-left:"+B+'px; line-height:0.1px; font-size:1px; padding:0;">'+u.bottomLeft+u.bottomRight+y;F.elements.wrapper.append(C);if(f("<canvas>").get(0).getContext){F.elements.wrapper.find("canvas").each(function(){A=E[f(this).parent("[rel]:first").attr("rel")];r.call(F,f(this),A,B,x)})}else{if(f.browser.msie){F.elements.tooltip.append('<v:image style="behavior:url(#default#VML);"></v:image>')}}s=Math.max(B,(B+(t-B)));v=Math.max(t-B,0);F.elements.contentWrapper.css({border:"0px solid "+x,borderWidth:v+"px "+s+"px"})}function r(u,w,s,t){var v=u.get(0).getContext("2d");v.fillStyle=t;v.beginPath();v.arc(w[0],w[1],s,0,Math.PI*2,false);v.fill()}function e(v){var t,s,x,u,w;t=this;if(t.elements.tip!==null){t.elements.tip.remove()}s=t.options.style.tip.color||t.options.style.border.color;if(t.options.style.tip.corner===false){return}else{if(!v){v=t.options.style.tip.corner}}x=b(v,t.options.style.tip.size.width,t.options.style.tip.size.height);t.elements.tip='<div class="'+t.options.style.classes.tip+'" dir="ltr" rel="'+v+'" style="position:absolute; height:'+t.options.style.tip.size.height+"px; width:"+t.options.style.tip.size.width+'px; margin:0 auto; line-height:0.1px; font-size:1px;">';if(f("<canvas>").get(0).getContext){t.elements.tip+='<canvas height="'+t.options.style.tip.size.height+'" width="'+t.options.style.tip.size.width+'"></canvas>'}else{if(f.browser.msie){u=t.options.style.tip.size.width+","+t.options.style.tip.size.height;w="m"+x[0][0]+","+x[0][1];w+=" l"+x[1][0]+","+x[1][1];w+=" "+x[2][0]+","+x[2][1];w+=" xe";t.elements.tip+='<v:shape fillcolor="'+s+'" stroked="false" filled="true" path="'+w+'" coordsize="'+u+'" style="width:'+t.options.style.tip.size.width+"px; height:"+t.options.style.tip.size.height+"px; line-height:0.1px; display:inline-block; behavior:url(#default#VML); vertical-align:"+((v.search(/top/)!==-1)?"bottom":"top")+'"></v:shape>';t.elements.tip+='<v:image style="behavior:url(#default#VML);"></v:image>';t.elements.contentWrapper.css("position","relative")}}t.elements.tooltip.prepend(t.elements.tip+"</div>");t.elements.tip=t.elements.tooltip.find("."+t.options.style.classes.tip).eq(0);if(f("<canvas>").get(0).getContext){h.call(t,t.elements.tip.find("canvas:first"),x,s)}if(v.search(/top/)!==-1&&f.browser.msie&&parseInt(f.browser.version.charAt(0))===6){t.elements.tip.css({marginTop:-4})}n.call(t,v)}function h(t,v,s){var u=t.get(0).getContext("2d");u.fillStyle=s;u.beginPath();u.moveTo(v[0][0],v[0][1]);u.lineTo(v[1][0],v[1][1]);u.lineTo(v[2][0],v[2][1]);u.fill()}function n(u){var t,w,s,x,v;t=this;if(t.options.style.tip.corner===false||!t.elements.tip){return}if(!u){u=t.elements.tip.attr("rel")}w=positionAdjust=(f.browser.msie)?1:0;t.elements.tip.css(u.match(/left|right|top|bottom/)[0],0);if(u.search(/top|bottom/)!==-1){if(f.browser.msie){if(parseInt(f.browser.version.charAt(0))===6){positionAdjust=(u.search(/top/)!==-1)?-3:1}else{positionAdjust=(u.search(/top/)!==-1)?1:2}}if(u.search(/Middle/)!==-1){t.elements.tip.css({left:"50%",marginLeft:-(t.options.style.tip.size.width/2)})}else{if(u.search(/Left/)!==-1){t.elements.tip.css({left:t.options.style.border.radius-w})}else{if(u.search(/Right/)!==-1){t.elements.tip.css({right:t.options.style.border.radius+w})}}}if(u.search(/top/)!==-1){t.elements.tip.css({top:-positionAdjust})}else{t.elements.tip.css({bottom:positionAdjust})}}else{if(u.search(/left|right/)!==-1){if(f.browser.msie){positionAdjust=(parseInt(f.browser.version.charAt(0))===6)?1:((u.search(/left/)!==-1)?1:2)}if(u.search(/Middle/)!==-1){t.elements.tip.css({top:"50%",marginTop:-(t.options.style.tip.size.height/2)})}else{if(u.search(/Top/)!==-1){t.elements.tip.css({top:t.options.style.border.radius-w})}else{if(u.search(/Bottom/)!==-1){t.elements.tip.css({bottom:t.options.style.border.radius+w})}}}if(u.search(/left/)!==-1){t.elements.tip.css({left:-positionAdjust})}else{t.elements.tip.css({right:positionAdjust})}}}s="padding-"+u.match(/left|right|top|bottom/)[0];x=t.options.style.tip.size[(s.search(/left|right/)!==-1)?"width":"height"];t.elements.tooltip.css("padding",0);t.elements.tooltip.css(s,x);if(f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){v=parseInt(t.elements.tip.css("margin-top"))||0;v+=parseInt(t.elements.content.css("margin-top"))||0;t.elements.tip.css({marginTop:v})}}function j(){var s=this;if(s.elements.title!==null){s.elements.title.remove()}s.elements.title=f('<div class="'+s.options.style.classes.title+'">').css(q(s.options.style.title,true)).css({zoom:(f.browser.msie)?1:0}).prependTo(s.elements.contentWrapper);if(s.options.content.title.text){s.updateTitle.call(s,s.options.content.title.text)}if(s.options.content.title.button!==false&&typeof s.options.content.title.button=="string"){s.elements.button=f('<a class="'+s.options.style.classes.button+'" style="float:right; position: relative"></a>').css(q(s.options.style.button,true)).html(s.options.content.title.button).prependTo(s.elements.title).click(function(t){if(!s.status.disabled){s.hide(t)}})}}function l(){var t,v,u,s;t=this;v=t.options.show.when.target;u=t.options.hide.when.target;if(t.options.hide.fixed){u=u.add(t.elements.tooltip)}if(t.options.hide.when.event=="inactive"){s=["click","dblclick","mousedown","mouseup","mousemove","mouseout","mouseenter","mouseleave","mouseover"];function y(z){if(t.status.disabled===true){return}clearTimeout(t.timers.inactive);t.timers.inactive=setTimeout(function(){f(s).each(function(){u.unbind(this+".qtip-inactive");t.elements.content.unbind(this+".qtip-inactive")});t.hide(z)},t.options.hide.delay)}}else{if(t.options.hide.fixed===true){t.elements.tooltip.bind("mouseover.qtip",function(){if(t.status.disabled===true){return}clearTimeout(t.timers.hide)})}}function x(z){if(t.status.disabled===true){return}if(t.options.hide.when.event=="inactive"){f(s).each(function(){u.bind(this+".qtip-inactive",y);t.elements.content.bind(this+".qtip-inactive",y)});y()}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.timers.show=setTimeout(function(){t.show(z)},t.options.show.delay)}function w(z){if(t.status.disabled===true){return}if(t.options.hide.fixed===true&&t.options.hide.when.event.search(/mouse(out|leave)/i)!==-1&&f(z.relatedTarget).parents("div.qtip[qtip]").length>0){z.stopPropagation();z.preventDefault();clearTimeout(t.timers.hide);return false}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.elements.tooltip.stop(true,true);t.timers.hide=setTimeout(function(){t.hide(z)},t.options.hide.delay)}if((t.options.show.when.target.add(t.options.hide.when.target).length===1&&t.options.show.when.event==t.options.hide.when.event&&t.options.hide.when.event!=="inactive")||t.options.hide.when.event=="unfocus"){t.cache.toggle=0;v.bind(t.options.show.when.event+".qtip",function(z){if(t.cache.toggle==0){x(z)}else{w(z)}})}else{v.bind(t.options.show.when.event+".qtip",x);if(t.options.hide.when.event!=="inactive"){u.bind(t.options.hide.when.event+".qtip",w)}}if(t.options.position.type.search(/(fixed|absolute)/)!==-1){t.elements.tooltip.bind("mouseover.qtip",t.focus)}if(t.options.position.target==="mouse"&&t.options.position.type!=="static"){v.bind("mousemove.qtip",function(z){t.cache.mouse={x:z.pageX,y:z.pageY};if(t.status.disabled===false&&t.options.position.adjust.mouse===true&&t.options.position.type!=="static"&&t.elements.tooltip.css("display")!=="none"){t.updatePosition(z)}})}}function o(u,v,A){var z,s,x,y,t,w;z=this;if(A.corner=="center"){return v.position}s=f.extend({},u);y={x:false,y:false};t={left:(s.left<f.fn.qtip.cache.screen.scroll.left),right:(s.left+A.dimensions.width+2>=f.fn.qtip.cache.screen.width+f.fn.qtip.cache.screen.scroll.left),top:(s.top<f.fn.qtip.cache.screen.scroll.top),bottom:(s.top+A.dimensions.height+2>=f.fn.qtip.cache.screen.height+f.fn.qtip.cache.screen.scroll.top)};x={left:(t.left&&(A.corner.search(/right/i)!=-1||(A.corner.search(/right/i)==-1&&!t.right))),right:(t.right&&(A.corner.search(/left/i)!=-1||(A.corner.search(/left/i)==-1&&!t.left))),top:(t.top&&A.corner.search(/top/i)==-1),bottom:(t.bottom&&A.corner.search(/bottom/i)==-1)};if(x.left){if(z.options.position.target!=="mouse"){s.left=v.position.left+v.dimensions.width}else{s.left=z.cache.mouse.x}y.x="Left"}else{if(x.right){if(z.options.position.target!=="mouse"){s.left=v.position.left-A.dimensions.width}else{s.left=z.cache.mouse.x-A.dimensions.width}y.x="Right"}}if(x.top){if(z.options.position.target!=="mouse"){s.top=v.position.top+v.dimensions.height}else{s.top=z.cache.mouse.y}y.y="top"}else{if(x.bottom){if(z.options.position.target!=="mouse"){s.top=v.position.top-A.dimensions.height}else{s.top=z.cache.mouse.y-A.dimensions.height}y.y="bottom"}}if(s.left<0){s.left=u.left;y.x=false}if(s.top<0){s.top=u.top;y.y=false}if(z.options.style.tip.corner!==false){s.corner=new String(A.corner);if(y.x!==false){s.corner=s.corner.replace(/Left|Right|Middle/,y.x)}if(y.y!==false){s.corner=s.corner.replace(/top|bottom/,y.y)}if(s.corner!==z.elements.tip.attr("rel")){e.call(z,s.corner)}}return s}function q(u,t){var v,s;v=f.extend(true,{},u);for(s in v){if(t===true&&s.search(/(tip|classes)/i)!==-1){delete v[s]}else{if(!t&&s.search(/(width|border|tip|title|classes|user)/i)!==-1){delete v[s]}}}return v}function c(s){if(typeof s.tip!=="object"){s.tip={corner:s.tip}}if(typeof s.tip.size!=="object"){s.tip.size={width:s.tip.size,height:s.tip.size}}if(typeof s.border!=="object"){s.border={width:s.border}}if(typeof s.width!=="object"){s.width={value:s.width}}if(typeof s.width.max=="string"){s.width.max=parseInt(s.width.max.replace(/([0-9]+)/i,"$1"))}if(typeof s.width.min=="string"){s.width.min=parseInt(s.width.min.replace(/([0-9]+)/i,"$1"))}if(typeof s.tip.size.x=="number"){s.tip.size.width=s.tip.size.x;delete s.tip.size.x}if(typeof s.tip.size.y=="number"){s.tip.size.height=s.tip.size.y;delete s.tip.size.y}return s}function a(){var s,t,u,x,v,w;s=this;u=[true,{}];for(t=0;t<arguments.length;t++){u.push(arguments[t])}x=[f.extend.apply(f,u)];while(typeof x[0].name=="string"){x.unshift(c(f.fn.qtip.styles[x[0].name]))}x.unshift(true,{classes:{tooltip:"qtip-"+(arguments[0].name||"defaults")}},f.fn.qtip.styles.defaults);v=f.extend.apply(f,x);w=(f.browser.msie)?1:0;v.tip.size.width+=w;v.tip.size.height+=w;if(v.tip.size.width%2>0){v.tip.size.width+=1}if(v.tip.size.height%2>0){v.tip.size.height+=1}if(v.tip.corner===true){v.tip.corner=(s.options.position.corner.tooltip==="center")?false:s.options.position.corner.tooltip}return v}function b(v,u,t){var s={bottomRight:[[0,0],[u,t],[u,0]],bottomLeft:[[0,0],[u,0],[0,t]],topRight:[[0,t],[u,0],[u,t]],topLeft:[[0,0],[0,t],[u,t]],topMiddle:[[0,t],[u/2,0],[u,t]],bottomMiddle:[[0,0],[u,0],[u/2,t]],rightMiddle:[[0,0],[u,t/2],[0,t]],leftMiddle:[[u,0],[u,t],[0,t/2]]};s.leftTop=s.bottomRight;s.rightTop=s.bottomLeft;s.leftBottom=s.topRight;s.rightBottom=s.topLeft;return s[v]}function g(s){var t;if(f("<canvas>").get(0).getContext){t={topLeft:[s,s],topRight:[0,s],bottomLeft:[s,0],bottomRight:[0,0]}}else{if(f.browser.msie){t={topLeft:[-90,90,0],topRight:[-90,90,-s],bottomLeft:[90,270,0],bottomRight:[90,270,-s]}}}return t}function k(){var s,t,u;s=this;u=s.getDimensions();t='<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:false" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=\'0\'); border: 1px solid red; height:'+u.height+"px; width:"+u.width+'px" />';s.elements.bgiframe=s.elements.wrapper.prepend(t).children(".qtip-bgiframe:first")}f(document).ready(function(){f.fn.qtip.cache={screen:{scroll:{left:f(window).scrollLeft(),top:f(window).scrollTop()},width:f(window).width(),height:f(window).height()}};var s;f(window).bind("resize scroll",function(t){clearTimeout(s);s=setTimeout(function(){if(t.type==="scroll"){f.fn.qtip.cache.screen.scroll={left:f(window).scrollLeft(),top:f(window).scrollTop()}}else{f.fn.qtip.cache.screen.width=f(window).width();f.fn.qtip.cache.screen.height=f(window).height()}for(i=0;i<f.fn.qtip.interfaces.length;i++){var u=f.fn.qtip.interfaces[i];if(u.status.rendered===true&&(u.options.position.type!=="static"||u.options.position.adjust.scroll&&t.type==="scroll"||u.options.position.adjust.resize&&t.type==="resize")){u.updatePosition(t,true)}}},100)});f(document).bind("mousedown.qtip",function(t){if(f(t.target).parents("div.qtip").length===0){f(".qtip[unfocus]").each(function(){var u=f(this).qtip("api");if(f(this).is(":visible")&&!u.status.disabled&&f(t.target).add(u.elements.target).length>1){u.hide(t)}})}})});f.fn.qtip.interfaces=[];f.fn.qtip.log={error:function(){return this}};f.fn.qtip.constants={};f.fn.qtip.defaults={content:{prerender:false,text:false,url:false,data:null,title:{text:false,button:false}},position:{target:false,corner:{target:"bottomRight",tooltip:"topLeft"},adjust:{x:0,y:0,mouse:true,screen:false,scroll:true,resize:true},type:"absolute",container:false},show:{when:{target:false,event:"mouseover"},effect:{type:"fade",length:100},delay:140,solo:false,ready:false},hide:{when:{target:false,event:"mouseout"},effect:{type:"fade",length:100},delay:0,fixed:false},api:{beforeRender:function(){},onRender:function(){},beforePositionUpdate:function(){},onPositionUpdate:function(){},beforeShow:function(){},onShow:function(){},beforeHide:function(){},onHide:function(){},beforeContentUpdate:function(){},onContentUpdate:function(){},beforeContentLoad:function(){},onContentLoad:function(){},beforeTitleUpdate:function(){},onTitleUpdate:function(){},beforeDestroy:function(){},onDestroy:function(){},beforeFocus:function(){},onFocus:function(){}}};f.fn.qtip.styles={defaults:{background:"white",color:"#111",overflow:"hidden",textAlign:"left",width:{min:0,max:250},padding:"5px 9px",border:{width:1,radius:0,color:"#d3d3d3"},tip:{corner:false,color:false,size:{width:13,height:13},opacity:1},title:{background:"#e1e1e1",fontWeight:"bold",padding:"7px 12px"},button:{cursor:"pointer"},classes:{target:"",tip:"qtip-tip",title:"qtip-title",button:"qtip-button",content:"qtip-content",active:"qtip-active"}},cream:{border:{width:3,radius:0,color:"#F9E98E"},title:{background:"#F0DE7D",color:"#A27D35"},background:"#FBF7AA",color:"#A27D35",classes:{tooltip:"qtip-cream"}},light:{border:{width:3,radius:0,color:"#E2E2E2"},title:{background:"#f1f1f1",color:"#454545"},background:"white",color:"#454545",classes:{tooltip:"qtip-light"}},dark:{border:{width:3,radius:0,color:"#303030"},title:{background:"#404040",color:"#f3f3f3"},background:"#505050",color:"#f3f3f3",classes:{tooltip:"qtip-dark"}},red:{border:{width:3,radius:0,color:"#CE6F6F"},title:{background:"#f28279",color:"#9C2F2F"},background:"#F79992",color:"#9C2F2F",classes:{tooltip:"qtip-red"}},green:{border:{width:3,radius:0,color:"#A9DB66"},title:{background:"#b9db8c",color:"#58792E"},background:"#CDE6AC",color:"#58792E",classes:{tooltip:"qtip-green"}},blue:{border:{width:3,radius:0,color:"#ADD9ED"},title:{background:"#D0E9F5",color:"#5E99BD"},background:"#E5F6FE",color:"#4D9FBF",classes:{tooltip:"qtip-blue"}}}})(jQuery);
;function gce_ajaxify(target, feed_ids, max_events, title_text, type){
	//Add click event to change month links
	jQuery('#' + target + ' .gce-change-month').click(function(){
		//Extract month and year
		var month_year = jQuery(this).attr('name').split('-', 2);
		//Add loading text to table caption
		jQuery('#' + target + ' caption').html(GoogleCalendarEvents.loading);
		//Send AJAX request
		jQuery.get(GoogleCalendarEvents.ajaxurl,{
			action:'gce_ajax',
			gce_type:type,
			gce_feed_ids:feed_ids,
			gce_title_text:title_text,
			gce_widget_id:target,
			gce_max_events:max_events,
			gce_month:month_year[0],
			gce_year:month_year[1]
		}, function(data){
			//Replace existing data with returned AJAX data
			if(type == 'widget'){
				jQuery('#' + target).html(data);
			}else{
				jQuery('#' + target).replaceWith(data);
			}
			gce_tooltips('#' + target + ' .gce-has-events');
		});
	});
}

function gce_tooltips(target_items){
	jQuery(target_items).each(function(){
		//Add qtip to all target items
		jQuery(this).qtip({
			content: jQuery(this).children('.gce-event-info'),
			position: { corner: { target: 'center', tooltip: 'bottomLeft' }, adjust: { screen: true } },
			hide: { fixed: true, delay: 100, effect: { length: 0 } },
			show: { solo: true, delay: 0, effect: { length: 0 } },
			style: { padding: "0", classes: { tooltip: 'gce-qtip', tip: 'gce-qtip-tip', title: 'gce-qtip-title', content: 'gce-qtip-content', active: 'gce-qtip-active' }, border: { width: 0 } }
		});
	});
}

jQuery(document).ready(function(){
	gce_tooltips('.gce-has-events');
});
;(function() {
  var intentRegex = /twitter\.com(\:\d{2,4})?\/intent\/(\w+)/,
      shortIntents = { tweet: true, retweet:true, favorite:true },
      windowOptions = 'scrollbars=yes,resizable=yes,toolbar=no,location=yes',
      winHeight = screen.height,
      winWidth = screen.width;

  function handleIntent(e) {
    e = e || window.event;
    var target = e.target || e.srcElement,
        m, width, height, left, top;

    while (target && target.nodeName.toLowerCase() !== 'a') {
      target = target.parentNode;
    }

    if (target && target.nodeName.toLowerCase() === 'a' && target.href) {
      m = target.href.match(intentRegex);
      if (m) {
        width = 550;
        height = (m[2] in shortIntents) ? 420 : 560;

        left = Math.round((winWidth / 2) - (width / 2));
        top = 0;

        if (winHeight > height) {
          top = Math.round((winHeight / 2) - (height / 2));
        }

        window.open(target.href, 'intent', windowOptions + ',width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
        e.returnValue = false;
        e.preventDefault && e.preventDefault();
      }
    }
  }

  if (document.addEventListener) {
    document.addEventListener('click', handleIntent, false);
  } else if (document.attachEvent) {
    document.attachEvent('onclick', handleIntent);
  }
}());
;var wpgb_cookie_exp = 365;

function wpgb_get_cookie(c_name) {
  if (document.cookie.length>0) {
    c_start=document.cookie.indexOf(c_name + "=");
    if (c_start!=-1) {
      c_start=c_start + c_name.length+1;
      c_end=document.cookie.indexOf(";",c_start);
      if (c_end==-1) c_end=document.cookie.length;
      return unescape(document.cookie.substring(c_start,c_end));
    }
  }
  return "";
}

function wpgb_set_cookie(c_name,value,expiredays) {
  var exdate = new Date();
  exdate.setDate(exdate.getDate()+expiredays);
  document.cookie=c_name+ "=" +escape(value)+";path="+"/"+
  ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function wpgb_delete_cookie ( c_name )
{
  var now = new Date ();
  now.setTime ( now.getTime() - 1 );
  document.cookie = c_name += "=; expires=" + now.toGMTString();
}

function wpgb_get_delta(ref) {
  var visit_delta;
  var visit_last = wpgb_get_cookie("wpgb_visit_last-"+ref);

  if(visit_last==null || visit_last=="") {
    visit_delta = -1;
  }
  else {
    visit_last = new Date(visit_last);
    visit_delta = Math.round((new Date() - visit_last)/(1000 * 60));
  }
  return visit_delta;
}

function wpgb_get_closed(ref) {
  var closed = wpgb_get_cookie("wpgb_closed-"+ref);
  if(closed==null || closed=="") {
    return ""
  }
  else {
    return "true"
  }
}

function wpgb_get_logged_in() {
  var logged_in = wpgb_get_cookie("wpgb_logged_in");
  if(logged_in==null || logged_in=="") {
    return ""
  }
  else {
    return "true"
  }
}

;// display greet box when document is ready
jQuery(document).ready(function($){
  // set default referrer if none found
  var ref = "default";
  if(document.referrer){
    ref = document.referrer;
    m = ref.match(/^(http:\/\/[^\/]+)/i);
    if(m){
      ref = m[1].replace(".", "_");
    }
  }
  // send request
  $.ajax({
    type: "GET",
    url: "index.php",
    data: "wpgb_public_action=query&visit_delta="+wpgb_get_delta(ref)+"&closed="+wpgb_get_closed(ref)+"&logged_in="+wpgb_get_logged_in()+"&referrer="+encodeURIComponent(document.referrer)+"&url="+encodeURIComponent(document.location)+"&title="+encodeURIComponent(document.title),
    dataType: "html",
    success: function(resp) {
      if(resp != ''){
        // show greeting message
        $("#greet_block").hide().html(resp).fadeIn("def");
        // bind close action
        $("#greet_block_close").click(function(event){
          event.preventDefault();
          wpgb_set_cookie("wpgb_closed-"+ref,new Date(),wpgb_cookie_exp);
          wpgb_set_cookie("wpgb_closed-"+ref,new Date(),wpgb_cookie_exp);
          $("#greet_block").fadeOut("def");
        });
        // bind search action (if any)
        $("#greet_search_link").click(function(){
          action = $(this).attr("action");
          if(action == "show"){
            $("#greet_search_results").slideDown();
            $(this).attr("action","hide");
            $("#greet_search_link_text_show").hide();
            $("#greet_search_link_text_hide").show();
            $("#greet_search_text_show").hide();
            $("#greet_search_text_hide").show();
          }
          else if(action == "hide"){
            $("#greet_search_results").slideUp("fast");
            $(this).attr("action","show");
            $("#greet_search_link_text_show").show();
            $("#greet_search_link_text_hide").hide();
            $("#greet_search_text_show").show();
            $("#greet_search_text_hide").hide();
          }
        });
      }
    }
  });
  // set cookie
  wpgb_set_cookie("wpgb_visit_last-"+ref,new Date(),wpgb_cookie_exp);
});

;var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
  //Non-IE
  myWidth = window.innerWidth;
  myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
  //IE 6+ in 'standards compliant mode'
  myWidth = document.documentElement.clientWidth;
  myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
  //IE 4 compatible
  myWidth = document.body.clientWidth;
  myHeight = document.body.clientHeight;
}
var trueheight;
trueheight=myHeight;

var truewidth;
truewidth=myWidth;





function showFollowMe()
{
document.getElementById('FollowMeBubble').style.visibility='visible';
document.getElementById('FollowMeBubbleBG').style.visibility='visible';
document.getElementById("FollowMeBubbleBG").style.height = trueheight + "px";
document.getElementById("FollowMeBubbleBG").style.width = truewidth + "px";
}

function hideFollowMe()
{
document.getElementById('FollowMeBubble').style.visibility='hidden';
document.getElementById('FollowMeBubbleBG').style.visibility='hidden';
}


;	
	/* --- vCita Constants --- */
	
	var VC_REQUIRED_MIN_SPACE_WIDTH = 125;
	var VC_MAX_SPACE_WIDTH = 200;
	var VC_REQUIRED_BOTTOM_HORIZONTAL_WIDTH = 330;
	var VC_BOTTOM_HORIZONTAL_HEIGHT = 120;
	var VC_BOTTOM_VERTICAL_HEIGHT = 225;

	
	/* --- On Load Functions --- */
	
	/** 
	 * Go over each of FSC-vCita widgets in the page and load them
	 */
	jQuery(document).ready(function($) {
		$(".fscf_vcita_container").each (function() {
			VC_FSCF_widget_load($(this));
		});
	});

	
	/* --- Public function --- */
	
	/** 
	 * Get a name for the cookie associated with this id
	 */
	function VC_FSCF_cookie_name(uid) {
		return "vc_widget_" + uid;
	}

	/**
	 * Set the value of the cookie with expiration date of one year.
	 */
	function VC_FSCF_set_cookie(uid, value) {
		var date = new Date();
		date.setTime(date.getTime()+(1*365*86400*1000)); // Expires in one year
		var expires = "; expires="+date.toGMTString();
		document.cookie = VC_FSCF_cookie_name(uid) + "=" + value + expires + "; path=/";
	}

	/** 
	 * Read the content of the cookie based on the uid
	 */
	function VC_FSCF_read_cookie(uid) {
		var nameEQ = VC_FSCF_cookie_name(uid) + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}

	/** 
	 * Get the value for the confirmation token of the current user
	 */
	function VC_FSCF_get_owner_token(uid) {
		var content = VC_FSCF_read_cookie(uid);
		var token = "";

		if (content != null && content.length > 0) {
			var attributes = content.split("|||");

			for (i = 0; i < attributes .length; i++) {
				var attribute = attributes[i].split("=");

				if (attribute[0] == 'confirmation_token' && attribute.length > 1) {
					token = attribute[1];
				}
			}
			
		}
		
		return token;
	}
	
	/**
	 * Return the confirmation token for the given uid and container. 
	 * In case the token is specified on the container, it means it also should be saved in the 
	 * cookie for later use.
	 */
	function VC_FSCF_get_confirmation_token(container, uid) {
		var confirmation_token = container.attr("confirmation_token");
		
		if (confirmation_token != null && confirmation_token != "") {	
			VC_FSCF_set_cookie(uid, "confirmation_token=" + confirmation_token);
		} else {
			confirmation_token = VC_FSCF_get_owner_token(uid);
		}
		
		return confirmation_token;
	}
	
	/** 
	 * Build the url of the widget, use the cookie to add a parameter regarding the user token.
	 */
	function VC_FSCF_populate_frame(container, widget_position, widget_orientation, width, height) {
		var divClass = "";
		var uid = container.attr("vcita_uid");
		var custom_style = "color:" + container.css("color") + ";";
		var confirmation_token = VC_FSCF_get_confirmation_token(container, uid);
		var url = "http://www.vcita.com/" + uid + "/buttons?invite=wp-fscf";
		
		
		if (confirmation_token != null && confirmation_token != "") {
			url += "&confirmation_token=" + confirmation_token;
		}
		
		if (container.attr("custom_style") != null && container.attr("custom_style") != "") {
			custom_style += container.attr("custom_style");
		}
		
		url += "&custom_style=" + encodeURIComponent(custom_style);
		
		if (widget_position == "right") {
			divClass = "vcita-widget-right";
		} else {
			divClass = "vcita-widget-bottom";
		}
		
		container.attr("class", divClass);

		container.html("<iframe style='border:none !important;' src='" + url + "&position=" + widget_position + "&orientation=" + widget_orientation + "'" + 
					   "width='" + width + "' height='" + height + "' frameborder='0' allowtransparency='true'></iframe>");
	}

	/** 
	 * Load the vCita Set meeting buttons into the available place marked by the container.
	 * The function checks how much space is availble (increasing the parent width if there is available space)
	 * and places the widget in the right side of the widget or in the bottom.
	 */
	function VC_FSCF_widget_load(container) {
		var widget_position = "";
		var widget_orientation = "vertical";
		var height = "";
		var width = "";

		// Check if there is extra room in the Fast Secure container 
		if (container.parent().parent().outerWidth(true) > container.parent().outerWidth(true)) {
			// Overcome a problem in which increasing the container size will also increase the form element 
			// Which will resolve that no extra room will be left for our buttons - happens in IE7
			container.parent().find(".fsc_data_container").css("width", container.parent().find(".fsc_data_container").outerWidth(true));

			container.parent().css("width", container.parent().parent().outerWidth(true));
		}

		var available_space = container.parent().outerWidth(true) - container.parent().children().outerWidth(true);
		
		// Check the available size - right or down
		if (available_space > VC_REQUIRED_MIN_SPACE_WIDTH) {
			var formHeight = container.parent().children().outerHeight(true) 
			width = ((available_space < VC_MAX_SPACE_WIDTH) ? available_space : VC_MAX_SPACE_WIDTH) + "px";
			height = formHeight  + "px";
			widget_position = "right";
							
		} else {
			widget_position = "bottom";

			if (container.parent().outerWidth(true) >= VC_REQUIRED_BOTTOM_HORIZONTAL_WIDTH ) {
				width = VC_REQUIRED_BOTTOM_HORIZONTAL_WIDTH + "px";
				height =  VC_BOTTOM_HORIZONTAL_HEIGHT + "px";
				widget_orientation = "horizontal";
			} else {
				width = "100%";
				height =  VC_BOTTOM_VERTICAL_HEIGHT + "px";
			}
		}
		
		VC_FSCF_populate_frame(container, widget_position, widget_orientation, width, height); 
	}
;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' );
} );

;(function($){
  $.fn.extend( {
		share_is_email: function( value ) {
	    return /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test( this.val() );
		}
  } );
  
	$( document ).ready(function() {
		$( '.sharing a.sharing-anchor' ).click( function() {
			return false;
		} );

		$( '.sharing a' ).each( function() {
			if ( $( this ).attr( 'href' ) && $( this ).attr( 'href' ).indexOf( 'share=' ) != -1 )
				$( this ).attr( 'href', $( this ).attr( 'href' ) + '&nb=1' );
		} );
		
		// Show hidden buttons
		$( '.sharing a.sharing-anchor' ).hover( function() {
			if ( $( this ).data( 'hasappeared' ) !== true ) {
				var item     = $( this ).parents( 'div:first' ).find( '.inner' );
				var original = $( this );
				
				// Create a timer to make the area appear if the mouse hovers for a period
				var timer = setTimeout( function() {
					$( '#sharing_email' ).slideUp( 200 );

					$( item ).css( {
						left: $( original ).position().left + 'px',
						top: $( original ).position().top + $( original ).height() + 3 + 'px'
					} ).slideDown( 200, function() {
						// Mark the item as have being appeared by the hover
						$( original ).data( 'hasappeared', true ).data( 'hasoriginal', true ).data( 'hasitem', false );
						
						// Remove all special handlers
						$( item ).mouseleave( handler_item_leave ).mouseenter( handler_item_enter );
						$( original ).mouseleave( handler_original_leave ).mouseenter( handler_original_enter );
						
						// Add a special handler to quickly close the item
						$( original ).click( close_it );
					} );
					
					// The following handlers take care of the mouseenter/mouseleave for the share button and the share area - if both are left then we close the share area
					var handler_item_leave = function() {
						$( original ).data( 'hasitem', false );
						
						if ( $( original ).data( 'hasoriginal' ) === false ) {
							var timer = setTimeout( close_it, 800 );
							$( original ).data( 'timer2', timer );
						}
					};

					var handler_item_enter = function() {
						$( original ).data( 'hasitem', true );
						clearTimeout( $( original ).data( 'timer2' ) );
					} 
					
					var handler_original_leave = function() {
						$( original ).data( 'hasoriginal', false );
						
						if ( $( original ).data( 'hasitem' ) === false ) {
							var timer = setTimeout( close_it, 800 );
							$( original ).data( 'timer2', timer );
						}
					};
					
					var handler_original_enter = function() {
						$( original ).data( 'hasoriginal', true );
						clearTimeout( $( original ).data( 'timer2' ) );
					};
	
					var close_it = function() {
						item.slideUp( 200 );

						// Clear all hooks
						$( original ).unbind( 'mouseleave', handler_original_leave ).unbind( 'mouseenter', handler_original_enter );
						$( item ).unbind( 'mouseleave', handler_item_leave ).unbind( 'mouseenter', handler_item_leave );
						$( original ).data( 'hasappeared', false );
						$( original ).unbind( 'click', close_it );
						return false;
					};
				}, 200 );
				
				// Remember the timer so we can detect it on the mouseout
				$( this ).data( 'timer', timer );
			}
		}, function() {
			// Mouse out - remove any timer
			clearTimeout( $( this ).data( 'timer' ) );
			$( this ).data( 'timer', false );
		} );
		
		// Add click functionality
		$( '.sharing ul' ).each( function( item ) {
			printUrl = function ( uniqueId, urlToPrint ) {
				$( 'body:first' ).append( '<iframe style="position:fixed;top:100;left:100;height:1px;width:1px;border:none;" id="printFrame-' + uniqueId + '" name="printFrame-' + uniqueId + '" src="' + urlToPrint + '" onload="frames[\'printFrame-' + uniqueId + '\'].focus();frames[\'printFrame-' + uniqueId + '\'].print();"></iframe>' )
			};
			
			// Print button
			$( this ).find( '.share-print a' ).click( function() {
				ref = $( this ).attr( 'href' );
				
				var do_print = function() {
					if ( ref.indexOf( '#print' ) == -1 ) {
						uid = new Date().getTime();
						printUrl( uid , ref );
					}
					else
						print();
				}
				
				// Is the button in a dropdown?
				if ( $( this ).parents( '.sharing-hidden' ).length > 0 ) {
					$( this ).parents( '.inner' ).slideUp( 0, function() {
						do_print();
					} );
				}
				else
					do_print();

				return false;
			} );
			
			// Press This button
			$( this ).find( '.share-press-this a' ).click( function() {
			 	var s = '';
			 	
			  if ( window.getSelection )
			    s = window.getSelection();
			  else if( document.getSelection )
			    s = document.getSelection();
			  else if( document.selection )
			    s = document.selection.createRange().text;

				if ( s )
					$( this ).attr( 'href', $( this ).attr( 'href' ) + '&sel=' + encodeURI( s ) );

				if ( !window.open( $( this ).attr( 'href' ), 't', 'toolbar=0,resizable=1,scrollbars=1,status=1,width=720,height=570' ) ) 
					document.location.href = $( this ).attr( 'href' );

				return false;
			} );

			// Email button
			$( this ).find( '.share-email a' ).click( function() {
				var url = $( this ).attr( 'href' );
				
				if ( $( '#sharing_email' ).is( ':visible' ) )
					$( '#sharing_email' ).slideUp( 200 );
				else {
					$( '.sharing .inner' ).slideUp();

					$( '#sharing_email .response' ).remove();
					$( '#sharing_email form' ).show();
					$( '#sharing_email form input[type=submit]' ).removeAttr( 'disabled' );
					$( '#sharing_email form a.sharing_cancel' ).show();

					// Show dialog
					$( '#sharing_email' ).css( {
						left: $( this ).offset().left + 'px',
						top: $( this ).offset().top + $( this ).height() + 'px'
					} ).slideDown( 200 );
					
					// Hook up other buttons
					$( '#sharing_email a.sharing_cancel' ).unbind( 'click' ).click( function() {
						$( '#sharing_email .errors' ).hide();
						$( '#sharing_email' ).slideUp( 200 );
						$( '#sharing_background' ).fadeOut();
						return false;
					} );
					
					// Submit validation
					$( '#sharing_email input[type=submit]' ).unbind( 'click' ).click( function() {
						var form = $( this ).parents( 'form' );
						
						// Disable buttons + enable loading icon
						$( this ).attr( 'disabled', 'disabled' );
						form.find( 'a.sharing_cancel' ).hide();
						form.find( 'img.loading' ).show();
						
						$( '#sharing_email .errors' ).hide();
						$( '#sharing_email .error' ).removeClass( 'error' );
						
						if ( $( '#sharing_email input[name=source_email]' ).share_is_email() == false )
							$( '#sharing_email input[name=source_email]' ).addClass( 'error' );
							
						if ( $( '#sharing_email input[name=target_email]' ).share_is_email() == false )
							$( '#sharing_email input[name=target_email]' ).addClass( 'error' );
						
						if ( $( '#sharing_email .error' ).length == 0 ) {
							// AJAX send the form
							$.ajax( {
								url: url,
								type: 'POST',
								data: form.serialize(),
								success: function( response ) {
									form.find( 'img.loading' ).hide();

									if ( response == '1' || response == '2' || response == '3' ) {
										$( '#sharing_email .errors-' + response ).show();
										form.find( 'input[type=submit]' ).removeAttr( 'disabled' );
										form.find( 'a.sharing_cancel' ).show();
									}
									else {
										$( '#sharing_email form' ).hide();
										$( '#sharing_email' ).append( response );
										$( '#sharing_email a.sharing_cancel' ).click( function() {
											$( '#sharing_email' ).slideUp( 200 );
											$( '#sharing_background' ).fadeOut();
											return false;
										} );
									}
								}
							} );
							
							return false;
						}
						
						form.find( 'img.loading' ).hide();
						form.find( 'input[type=submit]' ).removeAttr( 'disabled' );
						form.find( 'a.sharing_cancel' ).show();
						$( '#sharing_email .errors-1' ).show();

						return false;
					} );
				}
				
				return false;
			} );
		} );
		
		$( 'li.share-email, li.share-custom a.sharing-anchor' ).addClass( 'share-service-visible' );
	} );
})( 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};
