function gdsrWait(b,a){jQuery("#"+b).css("display","none");jQuery("#"+a).css("display","block");}function jquery_escape_id(a){return"#"+a.replace(/:/g,"\\:").replace(/\./g,"\\.");}function gdsrEmpty(){}function multi_rating_vote(g){var d=g.split("_");var b=d[0];var e=d[1];var f=d[2];var c=d[3];var a=jQuery("#gdsr_multi_"+b+"_"+e).val();gdsrWait("gdsr_mur_text_"+b+"_"+e,"gdsr_mur_loader_"+b+"_"+e);jQuery.getJSON(gdsr_cnst_ajax,{_ajax_nonce:gdsr_cnst_nonce,vote_id:b,vote_set:e,vote_value:a,vote_tpl:f,vote_type:"m",vote_size:c},function(k){jQuery("#gdsr_mur_block_"+b+"_"+e+" .gdsr_multis_as").remove();jQuery("#gdsr_mur_block_"+b+"_"+e+" .gdcurrent").remove();jQuery("#gdsr_mur_block_"+b+"_"+e+" input").remove();jQuery("#gdsr_mur_block_"+b+"_"+e+" .ratingbutton").remove();var h=jQuery("#gdsr_mur_avgstars_"+b+"_"+e+" div").css("height");if(h>0){jQuery("#gdsr_mur_avgstars_"+b+"_"+e+" div").css("width",k.average*h.substring(0,2));}for(var j=0;j<k.values.length;j++){jQuery("#gdsr_mur_stars_rated_"+b+"_"+e+"_"+j).css("width",parseInt(k.values[j]));}jQuery("#gdsr_mur_text_"+b+"_"+e).html(k.rater).addClass("voted");gdsrWait("gdsr_mur_loader_"+b+"_"+e,"gdsr_mur_text_"+b+"_"+e);});}function gdsr_rating_multi_button(a){if(jQuery(a).hasClass("active")){block=jQuery(a).parent().attr("id").substring(12);multi_rating_vote(block);}}function gdsr_rating_multi_stars(k){var b=jQuery(k).attr("id").split("X");var g=b[4];var m=b[5];var c=g*m;var j="#gdsr_mur_stars_current_"+b[1]+"_"+b[2]+"_"+b[3];var h="#gdsr_multi_"+b[1]+"_"+b[2];jQuery(j).css("width",c+"px");var l=jQuery(h).val().split("X");l[b[3]]=g;var d=true;for(var e=0;e<l.length;e++){if(parseInt(l[e])===0){d=false;break;}}jQuery(h).val(l.join("X"));var a=b[1]+"_"+b[2]+"_"+b[6]+"_"+m;if(gdsr_cnst_button==1){var f="#gdsr_button_"+a;if(d){jQuery(f).removeClass("gdinactive");jQuery(f).addClass("gdactive");jQuery(f+" a").addClass("active");}else{jQuery(f).removeClass("gdactive");jQuery(f).addClass("gdinactive");jQuery(f+" a").removeClass("active");}}else{if(d){multi_rating_vote(a);}}}function gdsr_rating_standard(b){var a=jQuery(b).attr("id").split("X");gdsrWait(a[5],a[6]);jQuery.getJSON(gdsr_cnst_ajax,{_ajax_nonce:gdsr_cnst_nonce,vote_id:a[1],vote_value:a[2],vote_type:a[4],vote_tpl:a[7],vote_size:a[8]},function(c){gdsrWait(a[6],a[5]);if(c.status=="ok"){jQuery("#gdr_stars_"+a[4]+a[1]).html("");jQuery("#gdr_vote_"+a[4]+a[1]).css("width",parseInt(c.value));jQuery("#gdr_text_"+a[4]+a[1]).addClass("voted");jQuery("#gdr_text_"+a[4]+a[1]).html(c.rater);}});}function gdsr_rating_thumb(c){var a=jQuery(c).attr("class");var b=jQuery(c).attr("id").split("X");if(b[6]=="Y"){gdsrWait("gdsr_thumb_"+b[1]+"_"+b[3]+"_"+b[2],"gdsr_thumb_"+b[1]+"_"+b[3]+"_loader_"+b[2]);}jQuery("#gdsr_thumb_"+b[1]+"_"+b[3]+"_up a").replaceWith('<div class="'+a+'"></div>');jQuery("#gdsr_thumb_"+b[1]+"_"+b[3]+"_dw a").replaceWith('<div class="'+a+'"></div>');jQuery.getJSON(gdsr_cnst_ajax,{_ajax_nonce:gdsr_cnst_nonce,vote_id:b[1],vote_value:b[2],vote_type:"r"+b[3],vote_tpl:b[4],vote_size:b[5]},function(d){if(b[6]=="Y"){gdsrWait("gdsr_thumb_"+b[1]+"_"+b[3]+"_loader_"+b[2],"gdsr_thumb_"+b[1]+"_"+b[3]+"_"+b[2]);}if(d.status=="ok"){jQuery("#gdsr_thumb_text_"+b[1]+"_"+b[3]).addClass("voted");jQuery("#gdsr_thumb_text_"+b[1]+"_"+b[3]).html(d.rater);}});}var gdsrCanceled=false;function hideshowCmmInt(){var a=jQuery("#comment_parent").val();if(parseInt(a)===0){jQuery("#gdsr-cmm-integration-block-review").removeClass("cmminthide");jQuery("#gdsr-cmm-integration-block-standard").removeClass("cmminthide");jQuery("#gdsr-cmm-integration-block-multis").removeClass("cmminthide");}else{jQuery("#gdsr-cmm-integration-block-review").addClass("cmminthide");jQuery("#gdsr-cmm-integration-block-standard").addClass("cmminthide");jQuery("#gdsr-cmm-integration-block-multis").addClass("cmminthide");}if(!gdsrCanceled){jQuery("#cancel-comment-reply-link").click(function(){hideshowCmmInt();});gdsrCanceled=true;}else{jQuery("#cancel-comment-reply-link").unbind("click");gdsrCanceled=false;}}function value_cmm_rated_multis(){var a=jQuery(".gdsr-mur-cls-rt").val();return a.split("X");}function is_cmm_rated_multis(){var b=value_cmm_rated_multis();var c=true;for(var a=0;a<b.length;a++){if(parseInt(b[a])===0){c=false;}}return c;}function value_cmm_rated_standard(){return jQuery(".gdsr-int-cls-rt").val();}function is_cmm_rated_standard(){return value_cmm_rated_standard()>0;}function value_cmm_rated_review(){return jQuery(".gdsr-cmm-cls-rt").val();}function is_cmm_rated_review(){return value_cmm_rated_review()>0;}function gdsr_ie(){return jQuery.browser.msie&&jQuery.browser.version<"8.0";}function gdsr_random_seed(){var a=new Date().getTime();a+=Math.floor(Math.random()*1024);return a;}jQuery(document).ready(function(){if(typeof(gdsr_cnst_cache)!=="undefined"&&gdsr_cnst_cache==1){var a="";var b="";jQuery(".gdsrcacheloader").each(function(c){el=jQuery(this).attr("id").substring(6);if(el.substring(0,1)=="a"){a+=el+":";}else{b+=el+":";}});if(a.length>0){a=a.substring(0,a.length-1);jQuery.getJSON(gdsr_cnst_ajax,{_ajax_nonce:gdsr_cnst_nonce,vote_type:"cache",vote_domain:"a",votes:a},function(d){for(var c=0;c<d.items.length;c++){var e=d.items[c];jQuery(jquery_escape_id(e.id)).replaceWith(e.html);}if(jQuery.browser.msie){jQuery(".gdsr_rating_as > a").attr("href","javascript:gdsrEmpty()");}if(jQuery.browser.msie){jQuery(".gdthumb > a").attr("href","javascript:gdsrEmpty()");}if(jQuery.browser.msie){jQuery(".gdsr_multisbutton_as > a").attr("href","javascript:gdsrEmpty()");}if(jQuery.browser.msie){jQuery(".gdsr_multis_as > a").attr("href","javascript:gdsrEmpty()");}jQuery(".gdsr_rating_as > a").unbind("click");jQuery(".gdsr_rating_as > a").click(function(){gdsr_rating_standard(this);});jQuery(".gdthumb > a").unbind("click");jQuery(".gdthumb > a").click(function(){gdsr_rating_thumb(this);});jQuery(".gdsr_multisbutton_as > a").unbind("click");jQuery(".gdsr_multisbutton_as > a").click(function(){gdsr_rating_multi_button(this);});jQuery(".gdsr_multis_as > a").unbind("click");jQuery(".gdsr_multis_as > a").click(function(){gdsr_rating_multi_stars(this);});});}if(b.length>0){b=b.substring(0,b.length-1);jQuery.getJSON(gdsr_cnst_ajax,{_ajax_nonce:gdsr_cnst_nonce,vote_type:"cache",vote_domain:"c",votes:b},function(d){for(var c=0;c<d.items.length;c++){var e=d.items[c];jQuery(jquery_escape_id(e.id)).replaceWith(e.html);}if(jQuery.browser.msie){jQuery(".gdsr_rating_as > a").attr("href","javascript:gdsrEmpty()");}if(jQuery.browser.msie){jQuery(".gdthumb > a").attr("href","javascript:gdsrEmpty()");}jQuery(".gdsr_rating_as > a").unbind("click");jQuery(".gdsr_rating_as > a").click(function(){gdsr_rating_standard(this);});jQuery(".gdthumb > a").unbind("click");jQuery(".gdthumb > a").click(function(){gdsr_rating_thumb(this);});});}}if(gdsr_ie()){jQuery(".gdsr_rating_as > a").attr("href","javascript:gdsrEmpty()");}jQuery(".gdsr_rating_as > a").click(function(){gdsr_rating_standard(this);});if(gdsr_ie()){jQuery(".gdthumb > a").attr("href","javascript:gdsrEmpty()");}jQuery(".gdthumb > a").click(function(){gdsr_rating_thumb(this);});if(gdsr_ie()){jQuery(".gdsr_integration > a").attr("href","javascript:gdsrEmpty()");}jQuery(".gdsr_integration > a").click(function(){var e=jQuery(this).attr("id").split("X");var d="#"+jQuery(this).parent().attr("id");var c=e[1]*e[2];jQuery(d+"_stars_rated").css("width",c+"px");jQuery(d+"_value").val(e[1]);});if(gdsr_ie()){jQuery(".gdsr_multisbutton_as > a").attr("href","javascript:gdsrEmpty()");}jQuery(".gdsr_multisbutton_as > a").click(function(){gdsr_rating_multi_button(this);});if(gdsr_ie()){jQuery(".gdsr_multis_as > a").attr("href","javascript:gdsrEmpty()");}jQuery(".gdsr_multis_as > a").click(function(){gdsr_rating_multi_stars(this);});if(gdsr_ie()){jQuery(".gdsr_mur_static > a").attr("href","javascript:gdsrEmpty()");}jQuery(".gdsr_mur_static > a").click(function(){var k=jQuery(this).attr("id").split("X");var g=k[4];var j=k[5];var e=g*j;var d="#gdsr_murvw_stars_current_"+k[1]+"_"+k[2]+"_"+k[3];var f=".gdsr_int_multi_"+k[1]+"_"+k[2];jQuery(d).css("width",e+"px");var c=jQuery(f).val().split("X");c[k[3]]=g;for(var h=0;h<c.length;h++){if(parseInt(c[h])===0){break;}}jQuery(f).val(c.join("X"));});});
;addComment={moveForm:function(d,f,i,c){var m=this,a,h=m.I(d),b=m.I(i),l=m.I("cancel-comment-reply-link"),j=m.I("comment_parent"),k=m.I("comment_post_ID");if(!h||!b||!l||!j){return}m.respondId=i;c=c||false;if(!m.I("wp-temp-form-div")){a=document.createElement("div");a.id="wp-temp-form-div";a.style.display="none";b.parentNode.insertBefore(a,b)}h.parentNode.insertBefore(b,h.nextSibling);if(k&&c){k.value=c}j.value=f;l.style.display="";l.onclick=function(){var n=addComment,e=n.I("wp-temp-form-div"),o=n.I(n.respondId);if(!e||!o){return}n.I("comment_parent").value="0";e.parentNode.insertBefore(o,e);e.parentNode.removeChild(e);this.style.display="none";this.onclick=null;return false};try{m.I("comment").focus()}catch(g){}return false},I:function(a){return document.getElementById(a)}};
;jQuery(document).ready(function(){jQuery('a').each(function(){var a=jQuery(this);var href=a.attr('href');if(href==undefined)
return;var url=href.replace('http://','').replace('https://','');var hrefArray=href.split('.').reverse();var extension=hrefArray[0].toLowerCase();var hrefArray=href.split('/').reverse();var domain=hrefArray[2];var downloadTracked=false;if(jQuery.inArray(extension,analyticsFileTypes)!=-1){downloadTracked=true;a.click(function(){if(analyticsEventTracking=='enabled'){_gaq.push(['_trackEvent','Downloads',extension.toUpperCase(),href]);}else
_gaq.push(['_trackPageview',analyticsDownloadsPrefix+url]);});}
if((href.match(/^http/))&&(!href.match(document.domain))&&(downloadTracked==false)){a.click(function(){if(analyticsEventTracking=='enabled'){_gaq.push(['_trackEvent','Outbound Traffic',href.match(/:\/\/(.[^/]+)/)[1],href]);}else
_gaq.push(['_trackPageview',analyticsOutboundPrefix+url]);});}});});
;	/*
   Plugin Name: Comment Rating
	Plugin URI: http://wealthynetizen.com/wordpress-plugin-comment-rating/
	Description: Allows visitors to rate the comments on your blog in a Like vs. Dislike fashion.  Clickable images and ratings are automatically inserted into each comment.  Comments disliked too much by readers will be hidden in a click-to-show link. 
	Author: Bob King
	Author URI: http://wealthynetizen.com
	Version: 2.3.2
	*/ 

	/*
	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.
	
	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
	*/

function ckratingcreateXMLHttpRequest(){
    var xmlhttp = null;
    try {
        // Moz supports XMLHttpRequest. IE uses ActiveX.
        // browser detction is bad. object detection works for any browser
        xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {
        // browser doesn’t support ajax. handle however you want
        //document.getElementById("errormsg").innerHTML = "Your browser doesnt support XMLHttpRequest.";
        // This won't help ordinary users.  Turned off
        // alert("Your browser does not support the XMLHttpRequest Object!");
    }
    return xmlhttp;
}

var ckratingXhr = ckratingcreateXMLHttpRequest();

function ckratingKarma(id, action, path, imgIndex){
    ckratingXhr.open('get', 'http\://'+ path +'ck-processkarma.php?id='+ id +'&action='+ action +'&path='+ path +'&imgIndex='+imgIndex);
    ckratingXhr.onreadystatechange = ckratingHandleResponse;
    ckratingXhr.send(null);
}

function ckratingHandleResponse(){
    if(ckratingXhr.readyState == 4){
        var response = ckratingXhr.responseText.split('|');
        
        if(response[0] == 'done'){
            if(response[1]){
                //Changes the thumbs to dull gray and disable the action
                if (response[4] == 'down') {
                  if ( document.getElementById("down-"+response[1]) != null ) { 
                      document.getElementById("down-"+response[1]).src = "http://"+response[3]+'images/'+response[6]+'checkmark.png';
                  }
                }
                else {
                  if ( document.getElementById("down-"+response[1]) != null ) {
                      document.getElementById("down-"+response[1]).src = "http://"+response[3]+'images/'+response[6]+'gray_down.png';
                  }
                }
                if ( document.getElementById("down-"+response[1]) != null ) {
                   document.getElementById("down-"+response[1]).onclick    = '';
                }
                if (response[4] == 'up') {
                   if ( document.getElementById("up-"+response[1]) != null ) {
                      document.getElementById("up-"+response[1]).src   = "http://"+response[3]+'images/'+response[6]+'checkmark.png';
                   }
                }
                else {
                   if ( document.getElementById("up-"+response[1]) != null ) {
                      document.getElementById("up-"+response[1]).src   = "http://"+response[3]+'images/'+response[6]+'gray_up.png';
                   }
                }
                if ( document.getElementById("up-"+response[1]) != null ) {
                   document.getElementById("up-"+response[1]).onclick      = '';
                }
                //Update the karma number display
                if(!response[2]){
                	alert("Response has no value");
                }
                var karmanumber = response[2];
                //The below line is commented out because there is no karma number atm.
                if (document.getElementById("karma-"+response[1]+"-"+response[4]) != null) {
                   document.getElementById("karma-"+response[1]+"-"+response[4]).innerHTML = karmanumber;
                }
                // deal with the single value total
                if (document.getElementById("karma-"+response[1]+"-total") != null) {
                   document.getElementById("karma-"+response[1]+"-total").innerHTML = response[5];
                }
            } else {
                alert("WTF ?");
            }
        }
        else if(response[0] == 'error')
        {
            var error = 'Error: '+response[1];
            alert(error);
        } else {
           /*  This causes unnecessary error messages when the icon
            *  is double clicked.
        	   alert("Reponse: "+response[0]);
            alert("Karma not changed, please try again later.");
            */
        }
    }
}

var crToggleComment = 0;

function crSwitchDisplay(id) {
   if (crToggleComment % 2 == 0) { crShowdiv(id); }
   else { crHidediv(id); }
   crToggleComment++;
}

// hide <div id='a2' style="display:none;"> tagged div ID blocks
function crHidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

// show <div id='a2' style="display:none;"> tagged div ID blocks
// <a href="javascript:crShowdiv('a2');">show a2</a>

function crShowdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}


;/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * Create a cookie with the given name and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String name The name of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given name.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};
;var email_p=0;var email_pageid=0;var email_yourname="";var email_youremail="";var email_yourremarks="";var email_friendname="";var email_friendemail="";var email_friendnames="";var email_friendemails="";var email_imageverify="";emailL10n.max_allowed=parseInt(emailL10n.max_allowed);function validate_email_form(){var b=false;var a=emailL10n.text_error+"\n";a=a+"__________________________________\n\n";if(jQuery("#yourname").length){if(isEmpty(email_yourname)||!is_valid_name(email_yourname)){a=a+emailL10n.text_name_invalid+"\n";b=true}}if(jQuery("#youremail").length){if(isEmpty(email_youremail)||!is_valid_email(email_youremail)){a=a+emailL10n.text_email_invalid+"\n";b=true}}if(jQuery("#yourremarks").length){if(!isEmpty(email_yourremarks)){if(!is_valid_remarks(email_yourremarks)){a=a+emailL10n.text_remarks_invalid+"\n";b=true}}}if(jQuery("#friendname").length){if(isEmpty(email_friendname)){a=a+emailL10n.text_friend_names_empty+"\n";b=true}else{for(i=0;i<email_friendnames.length;i++){if(isEmpty(email_friendnames[i])||!is_valid_name(email_friendnames[i])){a=a+emailL10n.text_friend_name_invalid+email_friendnames[i]+"\n";b=true}}}if(email_friendnames.length>emailL10n.max_allowed){a=a+emailL10n.text_max_friend_names_allowed+"\n";b=true}}if(isEmpty(email_friendemail)){a=a+emailL10n.text_friend_emails_empty+"\n";b=true}else{for(i=0;i<email_friendemails.length;i++){if(isEmpty(email_friendemails[i])||!is_valid_email(email_friendemails[i])){a=a+emailL10n.text_friend_email_invalid+email_friendemails[i]+"\n";b=true}}}if(email_friendemails.length>emailL10n.max_allowed){a=a+emailL10n.text_max_friend_emails_allowed+"\n";b=true}if(jQuery("#friendname").length){if(email_friendnames.length!=email_friendemails.length){a=a+emailL10n.text_friends_tally+"\n";b=true}}if(jQuery("#imageverify").length){if(isEmpty(email_imageverify)){a=a+emailL10n.text_image_verify_empty+"\n";b=true}}if(b==true){alert(a);return false}else{return true}}function isEmpty(a){if(jQuery.trim(a)==""){return true}return false}function is_valid_name(a){filter=/[(\*\(\)\[\]\+\,\/\?\:\;\'\"\`\~\\#\$\%\^\&\<\>)+]/;return !filter.test(jQuery.trim(a))}function is_valid_email(a){filter=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;return filter.test(jQuery.trim(a))}function is_valid_remarks(a){a=jQuery.trim(a);injection_strings=new Array("apparently-to","cc","bcc","boundary","charset","content-disposition","content-type","content-transfer-encoding","errors-to","in-reply-to","message-id","mime-version","multipart/mixed","multipart/alternative","multipart/related","reply-to","x-mailer","x-sender","x-uidl");for(i=0;i<injection_strings.length;i++){if(a.indexOf(injection_strings[i])!=-1){return false}}return true}function email_popup(a){window.open(a,"_blank","width=500,height=500,toolbar=0,menubar=0,location=0,resizable=0,scrollbars=1,status=0")}function email_form(){if(jQuery("#yourname").length){email_yourname=jQuery("#yourname").val()}if(jQuery("#youremail").length){email_youremail=jQuery("#youremail").val()}if(jQuery("#yourremarks").length){email_yourremarks=jQuery("#yourremarks").val()}if(jQuery("#friendname").length){email_friendname=jQuery("#friendname").val();email_friendnames=email_friendname.split(",")}email_friendemail=jQuery("#friendemail").val();email_friendemails=email_friendemail.split(",");if(jQuery("#imageverify").length){email_imageverify=jQuery("#imageverify").val()}if(jQuery("#p").length){email_p=jQuery("#p").val()}if(jQuery("#page_id").length){email_pageid=jQuery("#page_id").val()}if(validate_email_form()){email_ajax_data="wp-email=1";jQuery("#wp-email-submit").attr("disabled",true);jQuery("#wp-email-loading").show();if(jQuery("#yourname").length){email_ajax_data+="&yourname="+email_yourname;jQuery("#yourname").attr("disabled",true)}if(jQuery("#youremail").length){email_ajax_data+="&youremail="+email_youremail;jQuery("#youremail").attr("disabled",true)}if(jQuery("#yourremarks").length){email_ajax_data+="&yourremarks="+email_yourremarks;jQuery("#yourremarks").attr("disabled",true)}if(jQuery("#friendname").length){email_ajax_data+="&friendname="+email_friendname;jQuery("#friendname").attr("disabled",true)}if(jQuery("#friendemail").length){email_ajax_data+="&friendemail="+email_friendemail;jQuery("#friendemail").attr("disabled",true)}if(jQuery("#imageverify").length){email_ajax_data+="&imageverify="+email_imageverify;jQuery("#imageverify").attr("disabled",true)}if(jQuery("#p").length){email_ajax_data+="&p="+email_p}if(jQuery("#page_id").length){email_ajax_data+="&page_id="+email_pageid}jQuery.ajax({type:"POST",url:emailL10n.ajax_url,data:email_ajax_data,cache:false,success:function(a){jQuery("#wp-email-content").html(a)}})}};
;(function($){$.fn.ajaxSubmit=function(options){if(typeof options=="function"){options={success:options}}options=$.extend({url:this.attr("action")||window.location.toString(),type:this.attr("method")||"GET"},options||{});var veto={};$.event.trigger("form.pre.serialize",[this,options,veto]);if(veto.veto){return this}var a=this.formToArray(options.semantic);if(options.data){for(var n in options.data){a.push({name:n,value:options.data[n]})}}if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){return this}$.event.trigger("form.submit.validate",[a,this,options,veto]);if(veto.veto){return this}var q=$.param(a);if(options.type.toUpperCase()=="GET"){options.url+=(options.url.indexOf("?")>=0?"&":"?")+q;options.data=null}else{options.data=q}var $form=this,callbacks=[];if(options.resetForm){callbacks.push(function(){$form.resetForm()})}if(options.clearForm){callbacks.push(function(){$form.clearForm()})}if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){if(this.evalScripts){$(options.target).attr("innerHTML",data).evalScripts().each(oldSuccess,arguments)}else{$(options.target).html(data).each(oldSuccess,arguments)}})}else{if(options.success){callbacks.push(options.success)}}options.success=function(data,status){for(var i=0,max=callbacks.length;i<max;i++){callbacks[i](data,status,$form)}};var files=$("input:file",this).fieldValue();var found=false;for(var j=0;j<files.length;j++){if(files[j]){found=true}}if(options.iframe||found){if($.browser.safari&&options.closeKeepAlive){$.get(options.closeKeepAlive,fileUpload)}else{fileUpload()}}else{$.ajax(options)}$.event.trigger("form.submit.notify",[this,options]);return this;function fileUpload(){var form=$form[0];var opts=$.extend({},$.ajaxSettings,options);var id="jqFormIO"+$.fn.ajaxSubmit.counter++;var $io=$('<iframe id="'+id+'" name="'+id+'" />');var io=$io[0];var op8=$.browser.opera&&window.opera.version()<9;if($.browser.msie||op8){io.src='javascript:false;document.write("");'}$io.css({position:"absolute",top:"-1000px",left:"-1000px"});var xhr={responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){}};var g=opts.global;if(g&&!$.active++){$.event.trigger("ajaxStart")}if(g){$.event.trigger("ajaxSend",[xhr,opts])}var cbInvoked=0;var timedOut=0;setTimeout(function(){var encAttr=form.encoding?"encoding":"enctype";var t=$form.attr("target");$form.attr({target:id,method:"POST",action:opts.url});form[encAttr]="multipart/form-data";if(opts.timeout){setTimeout(function(){timedOut=true;cb()},opts.timeout)}$io.appendTo("body");io.attachEvent?io.attachEvent("onload",cb):io.addEventListener("load",cb,false);form.submit();$form.attr("target",t)},10);function cb(){if(cbInvoked++){return}io.detachEvent?io.detachEvent("onload",cb):io.removeEventListener("load",cb,false);var ok=true;try{if(timedOut){throw"timeout"}var data,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(opts.dataType=="json"||opts.dataType=="script"){var ta=doc.getElementsByTagName("textarea")[0];data=ta?ta.value:xhr.responseText;if(opts.dataType=="json"){eval("data = "+data)}else{$.globalEval(data)}}else{if(opts.dataType=="xml"){data=xhr.responseXML;if(!data&&xhr.responseText!=null){data=toXml(xhr.responseText)}}else{data=xhr.responseText}}}catch(e){ok=false;$.handleError(opts,xhr,"error",e)}if(ok){opts.success(data,"success");if(g){$.event.trigger("ajaxSuccess",[xhr,opts])}}if(g){$.event.trigger("ajaxComplete",[xhr,opts])}if(g&&!--$.active){$.event.trigger("ajaxStop")}if(opts.complete){opts.complete(xhr,ok?"success":"error")}setTimeout(function(){$io.remove();xhr.responseXML=null},100)}function toXml(s,doc){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.tagName!="parsererror")?doc:null}}};$.fn.ajaxSubmit.counter=0;$.fn.ajaxForm=function(options){return this.ajaxFormUnbind().submit(submitHandler).each(function(){this.formPluginId=$.fn.ajaxForm.counter++;$.fn.ajaxForm.optionHash[this.formPluginId]=options;$(":submit,input:image",this).click(clickHandler)})};$.fn.ajaxForm.counter=1;$.fn.ajaxForm.optionHash={};function clickHandler(e){var $form=this.form;$form.clk=this;if(this.type=="image"){if(e.offsetX!=undefined){$form.clk_x=e.offsetX;$form.clk_y=e.offsetY}else{if(typeof $.fn.offset=="function"){var offset=$(this).offset();$form.clk_x=e.pageX-offset.left;$form.clk_y=e.pageY-offset.top}else{$form.clk_x=e.pageX-this.offsetLeft;$form.clk_y=e.pageY-this.offsetTop}}}setTimeout(function(){$form.clk=$form.clk_x=$form.clk_y=null},10)}function submitHandler(){var id=this.formPluginId;var options=$.fn.ajaxForm.optionHash[id];$(this).ajaxSubmit(options);return false}$.fn.ajaxFormUnbind=function(){this.unbind("submit",submitHandler);return this.each(function(){$(":submit,input:image",this).unbind("click",clickHandler)})};$.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}for(var i=0,max=els.length;i<max;i++){var el=els[i];var n=el.name;if(!n){continue}if(semantic&&form.clk&&el.type=="image"){if(!el.disabled&&form.clk==el){a.push({name:n+".x",value:form.clk_x},{name:n+".y",value:form.clk_y})}continue}var v=$.fieldValue(el,true);if(v&&v.constructor==Array){for(var 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){var inputs=form.getElementsByTagName("input");for(var i=0,max=inputs.length;i<max;i++){var input=inputs[i];var n=input.name;if(n&&!input.disabled&&input.type=="image"&&form.clk==input){a.push({name:n+".x",value:form.clk_x},{name:n+".y",value:form.clk_y})}}}return a};$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic))};$.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})}}});return $.param(a)};$.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};$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof 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=$.browser.msie&&!(op.attributes.value.specified)?op.text:op.value;if(one){return v}a.push(v)}}return a}return el.value};$.fn.clearForm=function(){return this.each(function(){$("input,select,textarea",this).clearFields()})};$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(t=="text"||t=="password"||tag=="textarea"){this.value=""}else{if(t=="checkbox"||t=="radio"){this.checked=false}else{if(tag=="select"){this.selectedIndex=-1}}}})};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};$.fn.enable=function(b){if(b==undefined){b=true}return this.each(function(){this.disabled=!b})};$.fn.select=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"){$sel.find("option").select(false)}this.selected=select}}})}})(jQuery);
;jQuery(document).ready(function() {
	try {
		jQuery('div.wpcf7 > form').ajaxForm({
			beforeSubmit: wpcf7BeforeSubmit,
			dataType: 'json',
			success: wpcf7ProcessJson
		});
	} catch (e) {
	}

	try {
		jQuery('div.wpcf7 > form').each(function(i, n) {
			wpcf7ToggleSubmit(jQuery(n));
		});
	} catch (e) {
	}

	try {
		if (_wpcf7.cached) {
			jQuery('div.wpcf7 > form').each(function(i, n) {
				wpcf7OnloadRefill(n);
			});
		}
	} catch (e) {
	}
});

// Exclusive checkbox
function wpcf7ExclusiveCheckbox(elem) {
	jQuery(elem.form).find('input:checkbox[name="' + elem.name + '"]').not(elem).removeAttr('checked');
}

// Toggle submit button
function wpcf7ToggleSubmit(form) {
	var submit = jQuery(form).find('input:submit');
	if (! submit.length) return;

	var acceptances = jQuery(form).find('input:checkbox.wpcf7-acceptance');
	if (! acceptances.length) return;

	submit.removeAttr('disabled');
	acceptances.each(function(i, n) {
		n = jQuery(n);
		if (n.hasClass('wpcf7-invert') && n.is(':checked') || ! n.hasClass('wpcf7-invert') && ! n.is(':checked'))
		submit.attr('disabled', 'disabled');
	});
}

function wpcf7BeforeSubmit(formData, jqForm, options) {
	wpcf7ClearResponseOutput();
	jQuery('img.ajax-loader', jqForm[0]).css({ visibility: 'visible' });

	formData.push({name: '_wpcf7_is_ajax_call', value: 1});
	jQuery(jqForm[0]).append('<input type="hidden" name="_wpcf7_is_ajax_call" value="1" />');

	return true;
}

function wpcf7NotValidTip(into, message) {
	jQuery(into).append('<span class="wpcf7-not-valid-tip">' + message + '</span>');
	jQuery('span.wpcf7-not-valid-tip').mouseover(function() {
		jQuery(this).fadeOut('fast');
	});
	jQuery(into).find(':input').mouseover(function() {
		jQuery(into).find('.wpcf7-not-valid-tip').not(':hidden').fadeOut('fast');
	});
	jQuery(into).find(':input').focus(function() {
		jQuery(into).find('.wpcf7-not-valid-tip').not(':hidden').fadeOut('fast');
	});
}

function wpcf7OnloadRefill(form) {
	var url = jQuery(form).attr('action');
	if (0 < url.indexOf('#'))
		url = url.substr(0, url.indexOf('#'));

	var id = jQuery(form).find('input[name="_wpcf7"]').val();
	var unitTag = jQuery(form).find('input[name="_wpcf7_unit_tag"]').val();

	jQuery.getJSON(url,
		{ _wpcf7_is_ajax_call: 1, _wpcf7: id },
		function(data) {
			if (data && data.captcha) {
				wpcf7RefillCaptcha('#' + unitTag, data.captcha);
			}
			if (data && data.quiz) {
				wpcf7RefillQuiz('#' + unitTag, data.quiz);
			}
		}
	);
}

function wpcf7ProcessJson(data) {
	var wpcf7ResponseOutput = jQuery(data.into).find('div.wpcf7-response-output');
	wpcf7ClearResponseOutput();

	if (data.invalids) {
		jQuery.each(data.invalids, function(i, n) {
			wpcf7NotValidTip(jQuery(data.into).find(n.into), n.message);
		});
		wpcf7ResponseOutput.addClass('wpcf7-validation-errors');
	}

	if (data.captcha) {
		wpcf7RefillCaptcha(data.into, data.captcha);
	}

	if (data.quiz) {
		wpcf7RefillQuiz(data.into, data.quiz);
	}

	if (1 == data.spam) {
		wpcf7ResponseOutput.addClass('wpcf7-spam-blocked');
	}

	if (1 == data.mailSent) {
		jQuery(data.into).find('form').resetForm().clearForm();
		wpcf7ResponseOutput.addClass('wpcf7-mail-sent-ok');

		if (data.onSentOk)
			jQuery.each(data.onSentOk, function(i, n) { eval(n) });
	} else {
		wpcf7ResponseOutput.addClass('wpcf7-mail-sent-ng');
	}

	if (data.onSubmit)
		jQuery.each(data.onSubmit, function(i, n) { eval(n) });

	wpcf7ResponseOutput.append(data.message).slideDown('fast');
}

function wpcf7RefillCaptcha(form, captcha) {
	jQuery.each(captcha, function(i, n) {
		jQuery(form).find(':input[name="' + i + '"]').clearFields();
		jQuery(form).find('img.wpcf7-captcha-' + i).attr('src', n);
		var match = /([0-9]+)\.(png|gif|jpeg)$/.exec(n);
		jQuery(form).find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[1]);
	});
}

function wpcf7RefillQuiz(form, quiz) {
	jQuery.each(quiz, function(i, n) {
		jQuery(form).find(':input[name="' + i + '"]').clearFields();
		jQuery(form).find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[0]);
		jQuery(form).find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[1]);
	});
}

function wpcf7ClearResponseOutput() {
	jQuery('div.wpcf7-response-output').hide().empty().removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked');
	jQuery('span.wpcf7-not-valid-tip').remove();
	jQuery('img.ajax-loader').css({ visibility: 'hidden' });
}
;
var FBConnect = {

  /*
   * If this value is true alert boxes will be raised when various
   * types of configuration errors are detected.
   */
  debugVerbose : (window.location.href.indexOf('fbc_verbose_debug') != -1),

  initialized : false,

  init : function(api_key, plugin_path,
                  home_url, wp_user, app_config) {

    if (!api_key) {
      FBConnect.error("api_key is not set");
    }

    if (!plugin_path) {
      FBConnect.error("plugin path not provided");
    }

    // Check for properly configured template - note this test fails in IE!
    if (this.debugVerbose) {
      var html_tag = document.getElementsByTagName('html').item(0);
      if (html_tag.getAttribute('xmlns:fb') === null) {
        FBConnect.error('xmlns:fb not defined on html tag - check your templates');
      }
    }

    FBConnect.home_url = home_url || "/";

    FBConnect.plugin_path = plugin_path;
    FBConnect.wp_user = wp_user;

    FB.init(api_key, plugin_path + "xd_receiver.php", app_config);

    FBConnect.initialized = true;
  },

  appconfig_reload : {
    reloadIfSessionStateChanged: true
  },

  appconfig_none : {},

  appconfig_ajaxy : {
    ifUserConnected : fbc_onlogin_noauto,
    ifUserNotConnected : fbc_onlogout_noauto
  },

  logout : function() {
    FB.ensureInit(function() {
       FB.Connect.logout();
    });
  },

  redirect_home : function() {
    window.location = FBConnect.home_url;
  },

  /*
   wordpress specific functions
   */
  setup_feedform : function() {

    var comment_form = ge('commentform');
    if (!comment_form) {
      FBConnect.error('unable to locate id=commentform');
      return;
    }

    var orig_submit = ge('submit');
    if (orig_submit && orig_submit.getAttribute('name') === 'submit') {
      /* This is a bit of a hack. The default theme gives the submit
       button an id and name of "submit". This causes it to overwrite
       the .submit() function on the form. The solution is to delete
       the submit button and recreate it with a different id. See
       http://jibbering.com/faq/names/ for more info on why this is
       bad.  */

      var subbutton = document.createElement('input');
      subbutton.setAttribute('name', 'fbc_submit_hack');
      subbutton.setAttribute('type', 'submit');

      // restore the origional name
      subbutton.setAttribute('value', 'Submit Comment');

      comment_form.appendChild(subbutton);

      orig_submit.parentNode.replaceChild(subbutton, orig_submit);

    }

    /*
     * This is pretty terrible but I don't have a better option for
     * detecting a callable on IE since typeof(comment_form.submit)
     * returns object and 'call' in comment_form.submit is false.
     */
    if (comment_form.submit.nodeType) {
      FBConnect.error('unable to find .submit() on commentform');
      return;
    }

    comment_form.onsubmit = function() {
      return FBConnect.show_comment_feedform();
    }

  },

  show_comment_feedform : function() {

    var comment_text = '';

    var commentform = ge('commentform');
    if (commentform) {
      // if this isn't present something is seriously wrong
      var comment_box = commentform.comment;
      if (comment_box) {
        comment_text = comment_box.value;
      } else {
        FBConnect.error('unable to locate comment textarea');
        return true;
      }
    } else {
      FBConnect.error('unable to locate comment form, expected id=commentform');
      return true;
    }

    if (comment_text.length === 0) {
      // allow normal submit to complete
      return true;
    }

    FB.Connect.streamPublish(
      comment_text, // user_message
      { 
        name: FBConnect.article_title,
        href: window.location.href,
        caption: 'A post on the blog ' + FBConnect.blog_name,
        description: "\"" + FBConnect.excerpt + "\""
      }, // attachment
      null, // action links
      null, // target_id
      'My Comment', // prompt
      function() {
        // unconditional
        commentform.submit();
      }
    );

    // submit handled by streamPublish
    return false;

  },

  error : function(msg) {
    if (FBConnect.debugVerbose) {
      var emsg = 'Error: ' + msg;
      alert(emsg);
    }
  }

};

// end FBConnect

function fbc_onlogout_noauto() {
  fbc_set_visibility_by_class('fbc_hide_on_login', '');
  fbc_set_visibility_by_class('fbc_hide_on_logout', 'none');
}


function fbc_onlogin_noauto() {

  fbc_set_visibility_by_class('fbc_hide_on_login', 'none');
  fbc_set_visibility_by_class('fbc_hide_on_logout', '');
  FBConnect.setup_feedform();
}

function fbc_set_visibility_by_class(cls, vis) {
  var res = document.getElementsByClassName(cls);
  for(var i = 0; i < res.length; ++i) {
    res[i].style.visibility = vis;
  }
}


function ge(elem) {
  return document.getElementById(elem);
}

