
// 'stacks' is the Stacks global object.
// All of the other Stacks related Javascript will 
// be attatched to it.
var stacks = {};


// this call to jQuery gives us access to the globaal
// jQuery object. 
// 'noConflict' removes the '$' variable.
// 'true' removes the 'jQuery' variable.
// removing these globals reduces conflicts with other 
// jQuery versions that might be running on this page.
stacks.jQuery = jQuery.noConflict(true);

// Javascript for stacks_in_1_page7
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_1_page7 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_1_page7 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
/* SymfoniP.com (c) 2010 - BlackOut Pro Stack Code 
 * 26-Oct-2010 Developed by Ronan Cashell & Kevin Burns
 * Version 1.7.1 - changed: options for H and V center on Target Image, cookie fix
*/
(function(a){a.fn.extend({symBlackOut:function(s){var j={timeBeforeFade:3,fadeOutDuration:800,offsetTop:0,offsetLeft:0,backgroundColor:"#000000",backgroundImage:true,expires:"",cookie:0,image2image:true,centerImageVertical:false,centerImageHorizontal:false,centerImageWindow:false};a.extend(j,s);var n=a(a(this)[0]);var i,l;if(j.image2image){i=a(".main img",n)}else{i=a(".main",n)}l=a(".symSplash",n);if(j.cookie>0&&d("symAdvert")=="1"){l.hide();a(".symBlackout").hide();return}if(j.expires!=""){var e=new Date();var m=e.getMonth()+1;if(m<10){m="0"+m}var f=e.getDate();if(f<10){f="0"+f}var f=e.getFullYear()+""+m+f;if(f>j.expires){l.hide();a(".symBlackout").hide();return}}if(j.backgroundImage&&j.image2image){var b=a("img",l);var p=0,o=0;if(j.centerImageVertical){o=(i.height()-b.height())/2}if(j.centerImageHorizontal){p=(i.width()-b.width())/2}l.css({width:a(document).width(),height:a(document).height(),backgroundImage:"url("+b.attr("src")+")",backgroundRepeat:"no-repeat",backgroundPosition:(i.offset().left+p)+"px "+(i.offset().top+o)+"px"});b.remove()}else{var b=a("div:first",l);var q=b.width();var k=b.height();var r=b.css("textAlign");b.wrap('<div id="contentContainer">');b.wrap('<div id="content">');l.offset({left:0,top:0}).css({left:"0",top:"0",width:a(document).width(),height:a(document).height()});b.css({textAlign:r}).parent().css({margin:0,padding:0,textAlign:"center",width:q,height:k}).parent().css({margin:0,padding:0,width:a(window).width()});if(j.centerImageWindow){b.parent().css({width:q,height:k,marginRight:"auto",marginLeft:"auto",marginTop:(a(window).height()-k)/2})}else{b.css({width:i.width(),height:i.height(),marginLeft:i.offset().left,marginTop:i.offset().top})}}a("body").append(l);var c=setTimeout(function(){l.fadeOut(j.fadeOutDuration)},j.timeBeforeFade*1000);a(document).keydown(function(h){if(h.which==27){clearTimeout(c);l.fadeOut(j.fadeOutDuration)}});var g=0;if(!j.centerImageWindow){g=i.offset().top-(a(window).height()-n.height())/2}a(document).scrollTop(g);a(".symBlackout").hide();if(j.cookie>0&&d("symAdvert")!="1"){d("symAdvert","1",{expires:j.cookie,path:"/"})}function d(t,A,D){if(typeof A!="undefined"){D=D||{};if(A===null){A="";D.expires=-1}var w="";if(D.expires&&(typeof D.expires=="number"||D.expires.toUTCString)){var x;if(typeof D.expires=="number"){x=new Date();x.setTime(x.getTime()+(D.expires*24*60*60*1000))}else{x=D.expires}w="; expires="+x.toUTCString()}var C=D.path?"; path="+(D.path):"";var y=D.domain?"; domain="+(D.domain):"";var h=D.secure?"; secure":"";document.cookie=[t,"=",encodeURIComponent(A),w,C,y,h].join("")}else{var v=null;if(document.cookie&&document.cookie!=""){var B=document.cookie.split(";");for(var z=0;z<B.length;z++){var u=jQuery.trim(B[z]);if(u.substring(0,t.length+1)==(t+"=")){v=decodeURIComponent(u.substring(t.length+1));break}}}return v}}}})})(jQuery);
/* Make BlackOut Pro go - SymfoniP.com */
jQuery(document).ready(function($) {
	$("#symBlackOutstacks_in_1_page7").symBlackOut({timeBeforeFade: 2, fadeOutDuration: 2104, expires:'', cookie:0, image2image:true, centerImageVertical:false, centerImageHorizontal:false,centerImageWindow:false});
});
	return stack;
})(stacks.stacks_in_1_page7);


// Javascript for stacks_in_8_page7
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_8_page7 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_8_page7 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
//-- Like It Stack v1.1.0 by Joe Workman --//

/*  Tallest jQuery Plugin
 *	@author	nickf
 *	@date	2009-08-19
 *	@version 1.0 $Id: jquery.tallest.js 100 2009-08-19 00:40:09Z spadgos $
 */
jQuery(function($) {
	$.fn.tallest = function()       { return this._extremities({ 'aspect' : 'height', 'max' : true  })[0] };
	$.fn.tallestSize = function()   { return this._extremities({ 'aspect' : 'height', 'max' : true  })[1] };
	$.fn.shortest = function()      { return this._extremities({ 'aspect' : 'height', 'max' : false })[0] };
	$.fn.shortestSize = function()  { return this._extremities({ 'aspect' : 'height', 'max' : false })[1] };
	$.fn.widest = function()        { return this._extremities({ 'aspect' : 'width',  'max' : true  })[0] };
	$.fn.widestSize = function()    { return this._extremities({ 'aspect' : 'width',  'max' : true  })[1] };
	$.fn.thinnest = function()      { return this._extremities({ 'aspect' : 'width',  'max' : false })[0] };
	$.fn.thinnestSize = function()  { return this._extremities({ 'aspect' : 'width',  'max' : false })[1] };
	$.fn._extremities = function(options) {
		var defaults = {
			aspect : 'height', // or 'width'
			max : true	// or false to find the min
		};
		options = $.extend(defaults, options);
		if (this.length < 2) {
			return [this, this[options.aspect]()];
		}
		var bestIndex = 0,
			bestSize = this.eq(0)[options.aspect](),
			thisSize
		;
		for (var i = 1; i < this.length; ++i) {
			thisSize = this.eq(i)[options.aspect]();
			if ((options.max && thisSize > bestSize) || (!options.max && thisSize < bestSize)) {
				bestSize = thisSize;
				bestIndex = i;
			}
		}
		return [ this.eq(bestIndex), bestSize ];
	};
});
(function($){ 
    $.getScript = function(url, callback, cache){
    	$.ajax({
    			type: "GET",
    			url: url,
    			success: callback,
    			dataType: "script",
    			cache: true
    	});
    };
})(jQuery)

$(document).ready(function() {	
    
// Twitter Buttons
switch ( 2 ) {
case 1:
	$('#like_twitter1 a').attr('data-count', 'vertical');
    $.getScript('http://platform.twitter.com/widgets.js');
    break;
case 2:
    $('#like_twitter2 a').attr('data-count', 'horizontal');
    $.getScript('http://platform.twitter.com/widgets.js');
    break;
case 3:
    $('#like_twitter3 a').attr('data-count', 'none');
    $.getScript('http://platform.twitter.com/widgets.js');
    break;
default:
    // Do Nothing
}
// Google Buttons
switch ( 4 ) {
case 1:
	$('#like_google1 .like_google').html('<g:plusone size="small" count="false"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
case 2:
	$('#like_google2 .like_google').html('<g:plusone size="small" count="true"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
case 3:
	$('#like_google3 .like_google').html('<g:plusone size="medium" count="false"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
case 4:
	$('#like_google4 .like_google').html('<g:plusone size="medium" count="true"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
case 5:
	$('#like_google5 .like_google').html('<g:plusone size="standard" count="false"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
case 6:
	$('#like_google6 .like_google').html('<g:plusone size="standard" count="true"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
case 7:
	$('#like_google7 .like_google').html('<g:plusone size="tall" count="true"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
default:
    // Do Nothing
}

// Facebook Buttons
switch ( 1 ) {
case 1:
    $('#like_facebook1 .like_facebook').html('<fb:like show_faces="false" width="280"></fb:like>');
    break;
case 2:
    $('#like_facebook2 .like_facebook').html('<fb:like layout="button_count" show_faces="false" width="50"></fb:like>');
    break;
case 3:
    $('#like_facebook3 .like_facebook').html('<fb:like layout="box_count" show_faces="false" width="50"></fb:like>');
    break;
case 4:
    $('#like_facebook4 .like_facebook').html('<fb:like show_faces="false" width="450" action="recommend"></fb:like>');
    break;
case 5:
    $('#like_facebook5 .like_facebook').html('<fb:like layout="button_count" show_faces="false" width="50" action="recommend"></fb:like>');
    break;
case 6:
    $('#like_facebook6 .like_facebook').html('<fb:like layout="box_count" show_faces="false" width="50" action="recommend"></fb:like>');
    break;
default:
    // Do Nothing
}
// Digg Buttons
switch ( 0 ) {
case 1:
    $('#like_digg1 a').addClass('DiggWide');
    $.getScript('http://widgets.digg.com/buttons.js');
    break;
case 2:
    $('#like_digg2 a').addClass('DiggMedium');
    $.getScript('http://widgets.digg.com/buttons.js');
    break;
case 3:
    $('#like_digg3 a').addClass('DiggCompact');
    $.getScript('http://widgets.digg.com/buttons.js');
    break;
case 4:
    $('#like_digg4 a').addClass('DiggIcon');
    $.getScript('http://widgets.digg.com/buttons.js');
    break;
default:
    // Do Nothing
}
// LinkedIn Buttons
switch ( 0 ) {
case 1:
    $('#like_linkedin1').html('<script type="in/share" data-counter="top"></script>');
    $.getScript('http://platform.linkedin.com/in.js');
    break;
case 2:
	$('#like_linkedin2').html('<script type="in/share" data-counter="right"></script>');
	$.getScript('http://platform.linkedin.com/in.js');
	break;
case 3:
	$('#like_linkedin3').html('<script type="in/share"></script>');
	$.getScript('http://platform.linkedin.com/in.js');
	break;
default:
    // Do Nothing
}
// Evernote Button
if (0 != 0) {
    $.getScript('http://static.evernote.com/noteit.js');
}
//Email Button
$('.like_email a').attr('href','mailto:?subject=Check out this webpage&body='+location.href);
// Make all buttons have the same height and display it
// $('.like_button_wrapper').height( $('.like_button').tallest().height() );
});

//-- End Like It Stack --//
	return stack;
})(stacks.stacks_in_8_page7);



