// usage: log('inside coolFunc', this, arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
  log.history = log.history || [];   // store logs to an array for reference
  log.history.push(arguments);
  if(this.console) {
    arguments.callee = arguments.callee.caller;
    var newarr = [].slice.call(arguments);
    (typeof console.log === 'object' ? log.apply.call(console.log, console, newarr) : console.log.apply(console, newarr));
  }
};

// make it safe to use console.log always
(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,timeStamp,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();){b[a]=b[a]||c}})((function(){try
{console.log();return window.console;}catch(err){return window.console={};}})());






/*Noisy*/
(function(c){c.fn.noisy=function(b){var b=c.extend({},c.fn.noisy.defaults,b),d,h,a=!1;try{h="localStorage"in window&&window.localStorage!==null}catch(l){h=!1}window.JSON&&h&&(a=localStorage.getItem(window.JSON.stringify(b)));if(a)d=a;else{a=document.createElement("canvas");if(a.getContext){a.width=a.height=b.size;for(var i=a.getContext("2d"),e=i.createImageData(a.width,a.height),j=b.intensity*Math.pow(b.size,2),k=255*b.opacity;j--;){var f=~~(Math.random()*a.width),g=~~(Math.random()*a.height),f=(f+
g*e.width)*4,g=j%255;e.data[f]=g;e.data[f+1]=b.monochrome?g:~~(Math.random()*255);e.data[f+2]=b.monochrome?g:~~(Math.random()*255);e.data[f+3]=~~(Math.random()*k)}i.putImageData(e,0,0);d=a.toDataURL("image/png");if(d.indexOf("data:image/png")!=0||c.browser.msie&&c.browser.version.substr(0,1)<9&&d.length>32768)d=b.fallback}else d=b.fallback;window.JSON&&h&&localStorage.setItem(window.JSON.stringify(b),d)}return this.each(function(){c(this).css("background-image","url('"+d+"'),"+c(this).css("background-image"))})};
c.fn.noisy.defaults={intensity:0.9,size:200,opacity:0.08,fallback:"",monochrome:!1}})(jQuery);

 jQuery.fn.Kingsdownlogin = function(settings) {
 	 settings = jQuery.extend({
		speed:500
	}, settings)
	
	caller = this
 	if($(caller).css("display") == "none"){
 		$(caller).animate({
 			opacity: 1,
 			height: 'toggle'
 		}, settings.speed, settings.easing);
	}else{
		$(caller).animate({
 			opacity: 1,
 			height: 'toggle'
 		}, settings.speed, settings.easing);
	}
};
function podImageSize() {
	var containerSize = $('.pod').width();
	$('.pod img').css('width', containerSize-30);
}
function resizePages() {
	var h = $(window).height();
	var height  =  h;
	$('body').css('min-height',h);
}
function PageWidth() {
	var w = $(window).width();
	$('html, body, #outerborder').css('width',w);
	var width = w - 40;
	$('#container').css('width',width);
}
(function ($)
{
	$.fn.equalHeightColumns = function (options)
	{
		var height, elements;
		
		options = $.extend({}, $.equalHeightColumns.defaults, options);
		height = options.height;
		elements = $(this);
		
		$(this).each
		(
			function ()
			{
				// Apply equal height to the children of this element??
				if (options.children)
				{
					elements = $(this).children(options.children);
				}
				
				// If options.height is 0, then find which element is the highest.
				if (!options.height)
				{
					// If applying to this elements children, then loop each child element and find which is the highest.
					if (options.children)
					{
						elements.each
						(
							function ()
							{
								// If this element's height is more than is store in 'height' then update 'height'.
								if ($(this).height() > height)
								{
									height = $(this).height();
								}
							}
						);
					}
					
					else
					{
						// If this element's height is more than is store in 'height' then update 'height'.
						if ($(this).height() > height)
						{
							height = $(this).height();
						}
					}
				}
			}
		);
		
		
		// Enforce min height.
		if (options.minHeight && height < options.minHeight)
		{
			height = options.minHeight;
		}
		
		
		// Enforce max height.
		if (options.maxHeight && height > options.maxHeight)
		{
			height = options.maxHeight;
		}
		
		
		// Animate the column's height change.
		elements.animate
		(
			{
				height : height
			},
			options.speed
		);
		
		return $(this);
	};
	
	
	$.equalHeightColumns = {
		version : 1.0,
		defaults : {
			children : false,
			height : 0,
			minHeight : 0,
			maxHeight : 0,
			speed : 0
		}
	};
})(jQuery);


