window.log = function(){
  log.history = log.history || [];  
  log.history.push(arguments);
  arguments.callee = arguments.callee.caller;  
  if(this.console) console.log( Array.prototype.slice.call(arguments) );
};
(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();)b[a]=b[a]||c})(window.console=window.console||{});


/**
* hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne brian(at)cherne(dot)net
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);


/**
* center
* @param container DOM element within which to center || nothing (defaults to window)
* @param hv string "horizontal", "vertical", or "both" || nothing (defaults to "both")
*/
(function($){$.fn.center=function(container,hv){if(!container)container=window;if(!hv)hv="both";this.css("position",(hv=="both"?"absolute":"relative"));if(hv=="horizontal"||hv=="both")this.css("left",($(container).width()-this.width())/2+$(container).scrollLeft()+"px");if(hv=="vertical"||hv=="both")this.css("top",($(container).height()-this.height())/2+$(container).scrollTop()+"px");return this;};})(jQuery);


/* idTabs ~ Sean Catchpole - Version 2.2 - MIT/GPL */
(function () {
    var dep = { "jQuery": "http://code.jquery.com/jquery-latest.min.js" }; var init = function () {
  	    (function ($) {
  		    $.fn.idTabs = function () {
  			    var s = {}; for (var i = 0; i < arguments.length; ++i) { var a = arguments[i]; switch (a.constructor) { case Object: $.extend(s, a); break; case Boolean: s.change = a; break; case Number: s.start = a; break; case Function: s.click = a; break; case String: if (a.charAt(0) == '.') s.selected = a; else if (a.charAt(0) == '!') s.event = a; else s.start = a; break; } }
  			    if (typeof s['return'] == "function")
  				    s.change = s['return']; return this.each(function () { $.idTabs(this, s); });
  		    }
  		    $.idTabs = function (tabs, options) {
  			    var meta = ($.metadata) ? $(tabs).metadata() : {}; var s = $.extend({}, $.idTabs.settings, meta, options); if (s.selected.charAt(0) == '.') s.selected = s.selected.substr(1); if (s.event.charAt(0) == '!') s.event = s.event.substr(1); if (s.start == null) s.start = -1; var showId = function () {
  				    if ($(this).is('.' + s.selected))
  					    return s.change; var id = "#" + this.href.split('#')[1]; var aList = []; var idList = []; $("a", tabs).each(function () { if (this.href.match(/#/)) { aList.push(this); idList.push("#" + this.href.split('#')[1]); } }); if (s.click && !s.click.apply(this, [id, idList, tabs, s])) return s.change; for (i in aList) $(aList[i]).removeClass(s.selected); for (i in idList) $(idList[i]).hide(); $(this).addClass(s.selected); $(id).show(); return s.change;
  			    }
  			    var list = $("a[href*='#']", tabs).unbind(s.event, showId).bind(s.event, showId); list.each(function () { $("#" + this.href.split('#')[1]).hide(); }); var test = false; if ((test = list.filter('.' + s.selected)).length); else if (typeof s.start == "number" && (test = list.eq(s.start)).length); else if (typeof s.start == "string" && (test = list.filter("[href*='#" + s.start + "']")).length); if (test) { test.removeClass(s.selected); test.trigger(s.event); }
  			    return s;
  		    }
  		    $.idTabs.settings = { start: 0, change: false, click: null, selected: ".selected", event: "!click" }; $.idTabs.version = "2.2"; $(function () { $(".idTabs").idTabs(); });
  	    })(jQuery);
    }
    var check = function (o, s) { s = s.split('.'); while (o && s.length) o = o[s.shift()]; return o; }
    var head = document.getElementsByTagName("head")[0]; var add = function (url) { var s = document.createElement("script"); s.type = "text/javascript"; s.src = url; head.appendChild(s); }
    var s = document.getElementsByTagName('script'); var src = s[s.length - 1].src; var ok = true; for (d in dep) { if (check(this, d)) continue; ok = false; add(dep[d]); } if (ok) return init(); add(src);
})();


/*
	reflection.js for jQuery v1.03
	(c) 2006-2009 Christophe Beyls <http://www.digitalia.be>
	MIT-style license.

    height: decimal - height of reflection as proportion of source img height
    opacity: decimal - opacity of reflection

    UPDATED: 05/13/2011 by Rodney Golpe
    borderWidth: doesn't draw a border; allows space for the source img to include a css border 
*/
(function(a){a.fn.extend({reflect:function(b){b=a.extend({height:1/3,opacity:0.5,borderWidth:0},b);return this.unreflect().each(function(){var c=this;if(/^img$/i.test(c.tagName)){function d(){var g=c.width,f=c.height,bWidth=b.borderWidth,i,m,h,k;i=Math.floor((b.height>1)?Math.min(f,b.height):f*b.height);if(a.browser.msie){l=a("<img />").attr("src",c.src).css({width:g,height:f,marginBottom:i-f,filter:"flipv progid:DXImageTransform.Microsoft.Alpha(opacity="+(b.opacity*100)+", style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy="+(i/f*100)+")"})[0]}else{l=a("<canvas />")[0];if(!l.getContext){return}h=l.getContext("2d");try{a(l).attr({width:g,height:i});h.save();h.translate(0,f-1);h.scale(1,-1);h.drawImage(c,0,0,g,f);h.restore();h.globalCompositeOperation="destination-out";k=h.createLinearGradient(0,0,0,i);k.addColorStop(0,"rgba(255, 255, 255, "+(1-b.opacity)+")");k.addColorStop(1,"rgba(255, 255, 255, 1.0)");h.fillStyle=k;h.rect(0,0,g,i);h.fill()}catch(j){return}}a(l).css({display:"block",border:0,"margin-left":b.borderWidth+"px"});m=a(/^a$/i.test(c.parentNode.tagName)?"<span />":"<div />").insertAfter(c).append([c,l])[0];m.className=c.className;a.data(c,"reflected",m.style.cssText=c.style.cssText);a(m).css({width:g+(bWidth*2),height:f+i+(bWidth*2),overflow:"hidden","text-align":"center"});c.style.cssText="display: block";c.className="reflected"}if(c.complete){d()}else{a(c).load(d)}}})},unreflect:function(){return this.unbind("load").each(function(){var c=this,b=a.data(this,"reflected"),d;if(b!==undefined){d=c.parentNode;c.className=d.className;c.style.cssText=b;a.removeData(c,"reflected");d.parentNode.replaceChild(c,d)}})}})})(jQuery);

/**
* jQuery Cookie plugin
*
* Copyright (c) 2010 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
*
*/
jQuery.cookie = function (key, value, options) {

	// key and at least value given, set cookie...
	if (arguments.length > 1 && String(value) !== "[object Object]") {
		options = jQuery.extend({}, options);

		if (value === null || value === undefined) {
			options.expires = -1;
		}

		if (typeof options.expires === 'number') {
			var days = options.expires, t = options.expires = new Date();
			t.setDate(t.getDate() + days);
		}

		value = String(value);

		return (document.cookie = [
            encodeURIComponent(key), '=',
            options.raw ? value : encodeURIComponent(value),
            options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
            options.path ? '; path=' + options.path : '',
            options.domain ? '; domain=' + options.domain : '',
            options.secure ? '; secure' : ''
        ].join(''));
	}

	// key and possibly options given, get cookie...
	options = value || {};
	var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
	return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
};

/** URLEncode **/
jQuery.extend({
    URLEncode: function (c) {
        var o = ''; var x = 0; c = c.toString(); var r = /(^[a-zA-Z0-9_.]*)/;
        while (x < c.length) {
            var m = r.exec(c.substr(x));
            if (m != null && m.length > 1 && m[1] != '') {
                o += m[1]; x += m[1].length;
            } else {
                if (c[x] == ' ') o += '+'; else {
                    var d = c.charCodeAt(x); var h = d.toString(16);
                    o += '%' + (h.length < 2 ? '0' : '') + h.toUpperCase();
                } x++;
            }
        } return o;
    }
});


