// JavaScript Document for Bin v1.0


// jFav

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(7($){$.8.9=7(d){g e=$.v({},$.8.9.k,d);g f=e.l;2.w(7(){5(!$(2).3(\'4\')||$(2).3(\'4\')=="#"){$(2).3(\'4\',j.x.4)}5(!$(2).3(\'6\')){$(2).3(\'6\',y.6)}5($.h.z){$(2).3(\'m\',$(2).3(\'4\')).3(\'4\',\'\').3(\'4\',\'A:B(0)\').3(\'C\',\'$.8.9.n(2,"\'+$(2).3(\'6\')+\'","\'+$(2).3(\'m\')+\'")\')}i{$(2).o(p)}});7 p(a){g b=$(2).3(\'4\');g c=$(2).3(\'6\');b=b.E("q:///","F://q/");5($.h.G){j.H.I(b,c)}i 5($.h.J){j.r.K(c,b,\'\')}i 5(L.M.N().O(\'P\')>-1){s(f)}i 5($.h.Q){s(f)}a.R()};t 2};$.8.9.k={l:\'S "T + D" U "V + D" W X, u Y 2 Z u 10 11.\'};$.8.9.n=7(e,a,b){e.12="r";e.6=a;e.4="";e.4=b;e.o();t 13}})(14);',62,67,'||this|attr|href|if|title|function|fn|jFav|||||||var|browser|else|window|defaults|msg|link|OperaBookmark|click|addToFavorites|file|sidebar|alert|return|to|extend|each|location|document|opera|javascript|void|onClick||replace|http|msie|external|AddFavorite|mozilla|addPanel|navigator|userAgent|toLowerCase|indexOf|chrome|safari|preventDefault|Press|Ctrl|or|CMD|for|MAC|add|page|your|bookmarks|rel|false|jQuery'.split('|'),0,{}));



// Lavalamp

(function($){$.fn.lavaLamp=function(o){o=$.extend({fx:"linear",speed:500,click:function(){}},o||{});return this.each(function(){var b=$(this),noop=function(){},$back=$('<li class="back"><div class="left"></div></li>').appendTo(b),$li=$("li",this),curr=$("li.current",this)[0]||$($li[0]).addClass("current")[0];$li.not(".back").hover(function(){move(this)},noop);$(this).hover(noop,function(){move(curr)});$li.click(function(e){setCurr(this);return o.click.apply(this,[e,this])});setCurr(curr);function setCurr(a){$back.css({"left":a.offsetLeft+"px","width":a.offsetWidth+"px"});curr=a};function move(a){$back.each(function(){$(this).dequeue()}).animate({width:a.offsetWidth,left:a.offsetLeft},o.speed,o.fx)}})}})(jQuery);



jQuery.easing={easein:function(x,t,b,c,d){return c*(t/=d)*t+b},easeinout:function(x,t,b,c,d){if(t<d/2)return 2*c*t*t/(d*d)+b;var a=t-d/2;return-2*c*a*a/(d*d)+2*c*a/d+c/2+b},easeout:function(x,t,b,c,d){return-c*t*t/(d*d)+2*c*t/d+b},expoin:function(x,t,b,c,d){var a=1;if(c<0){a*=-1;c*=-1}return a*(Math.exp(Math.log(c)/d*t))+b},expoout:function(x,t,b,c,d){var a=1;if(c<0){a*=-1;c*=-1}return a*(-Math.exp(-Math.log(c)/d*(t-d))+c+1)+b},expoinout:function(x,t,b,c,d){var a=1;if(c<0){a*=-1;c*=-1}if(t<d/2)return a*(Math.exp(Math.log(c/2)/(d/2)*t))+b;return a*(-Math.exp(-2*Math.log(c/2)/d*(t-d))+c+1)+b},bouncein:function(x,t,b,c,d){return c-jQuery.easing['bounceout'](x,d-t,0,c,d)+b},bounceout:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b}},bounceinout:function(x,t,b,c,d){if(t<d/2)return jQuery.easing['bouncein'](x,t*2,0,c,d)*.5+b;return jQuery.easing['bounceout'](x,t*2-d,0,c,d)*.5+c*.5+b},elasin:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},elasout:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},elasinout:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b},backin:function(x,t,b,c,d){var s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},backout:function(x,t,b,c,d){var s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},backinout:function(x,t,b,c,d){var s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},linear:function(x,t,b,c,d){return c*t/d+b}};



// Round corner

(function($) { 



var expr = (function() {

    var div = document.createElement('div');

    try { div.style.setExpression('width','0+0'); }

    catch(e) { return false; }

    return true;

})();

    

function sz(el, p) { 

    return parseInt($.css(el,p))||0; 

};

function hex2(s) {

    var s = parseInt(s).toString(16);

    return ( s.length < 2 ) ? '0'+s : s;

};

function gpc(node) {

    for ( ; node && node.nodeName.toLowerCase() != 'html'; node = node.parentNode ) {

        var v = $.css(node,'backgroundColor');

        if ( v.indexOf('rgb') >= 0 ) { 

            if ($.browser.safari && v == 'rgba(0, 0, 0, 0)')

                continue;

            var rgb = v.match(/\d+/g); 

            return '#'+ hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]);

        }

        if ( v && v != 'transparent' )

            return v;

    }

    return '#ffffff';

};



function getWidth(fx, i, width) {

    switch(fx) {

    case 'round':  return Math.round(width*(1-Math.cos(Math.asin(i/width))));

    case 'cool':   return Math.round(width*(1+Math.cos(Math.asin(i/width))));

    case 'sharp':  return Math.round(width*(1-Math.cos(Math.acos(i/width))));

    case 'bite':   return Math.round(width*(Math.cos(Math.asin((width-i-1)/width))));

    case 'slide':  return Math.round(width*(Math.atan2(i,width/i)));

    case 'jut':    return Math.round(width*(Math.atan2(width,(width-i-1))));

    case 'curl':   return Math.round(width*(Math.atan(i)));

    case 'tear':   return Math.round(width*(Math.cos(i)));

    case 'wicked': return Math.round(width*(Math.tan(i)));

    case 'long':   return Math.round(width*(Math.sqrt(i)));

    case 'sculpt': return Math.round(width*(Math.log((width-i-1),width)));

    case 'dog':    return (i&1) ? (i+1) : width;

    case 'dog2':   return (i&2) ? (i+1) : width;

    case 'dog3':   return (i&3) ? (i+1) : width;

    case 'fray':   return (i%2)*width;

    case 'notch':  return width; 

    case 'bevel':  return i+1;

    }

};



$.fn.corner = function(o) {

    // in 1.3+ we can fix mistakes with the ready state

	if (this.length == 0) {

        if (!$.isReady && this.selector) {

            var s = this.selector, c = this.context;

            $(function() {

                $(s,c).corner(o);

            });

        }

        return this;

	}



    o = (o||"").toLowerCase();

    var keep = /keep/.test(o);                       // keep borders?

    var cc = ((o.match(/cc:(#[0-9a-f]+)/)||[])[1]);  // corner color

    var sc = ((o.match(/sc:(#[0-9a-f]+)/)||[])[1]);  // strip color

    var width = parseInt((o.match(/(\d+)px/)||[])[1]) || 10; // corner width

    var re = /round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/;

    var fx = ((o.match(re)||['round'])[0]);

    var edges = { T:0, B:1 };

    var opts = {

        TL:  /top|tl/.test(o),       TR:  /top|tr/.test(o),

        BL:  /bottom|bl/.test(o),    BR:  /bottom|br/.test(o)

    };

    if ( !opts.TL && !opts.TR && !opts.BL && !opts.BR )

        opts = { TL:1, TR:1, BL:1, BR:1 };

    var strip = document.createElement('div');

    strip.style.overflow = 'hidden';

    strip.style.height = '1px';

    strip.style.backgroundColor = sc || 'transparent';

    strip.style.borderStyle = 'solid';

    return this.each(function(index){

        var pad = {

            T: parseInt($.css(this,'paddingTop'))||0,     R: parseInt($.css(this,'paddingRight'))||0,

            B: parseInt($.css(this,'paddingBottom'))||0,  L: parseInt($.css(this,'paddingLeft'))||0

        };



        if (typeof this.style.zoom != undefined) this.style.zoom = 1; // force 'hasLayout' in IE

        if (!keep) this.style.border = 'none';

        strip.style.borderColor = cc || gpc(this.parentNode);

        var cssHeight = $.curCSS(this, 'height');



        for (var j in edges) {

            var bot = edges[j];

            // only add stips if needed

            if ((bot && (opts.BL || opts.BR)) || (!bot && (opts.TL || opts.TR))) {

                strip.style.borderStyle = 'none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none');

                var d = document.createElement('div');

                $(d).addClass('jquery-corner');

                var ds = d.style;



                bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild);



                if (bot && cssHeight != 'auto') {

                    if ($.css(this,'position') == 'static')

                        this.style.position = 'relative';

                    ds.position = 'absolute';

                    ds.bottom = ds.left = ds.padding = ds.margin = '0';

                    if (expr)

                        ds.setExpression('width', 'this.parentNode.offsetWidth');

                    else

                        ds.width = '100%';

                }

                else if (!bot && $.browser.msie) {

                    if ($.css(this,'position') == 'static')

                        this.style.position = 'relative';

                    ds.position = 'absolute';

                    ds.top = ds.left = ds.right = ds.padding = ds.margin = '0';

                    

                    // fix ie6 problem when blocked element has a border width

                    if (expr) {

                        var bw = sz(this,'borderLeftWidth') + sz(this,'borderRightWidth');

                        ds.setExpression('width', 'this.parentNode.offsetWidth - '+bw+'+ "px"');

                    }

                    else

                        ds.width = '100%';

                }

                else {

                    ds.margin = !bot ? '-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px' : 

                                        (pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px';                

                }



                for (var i=0; i < width; i++) {

                    var w = Math.max(0,getWidth(fx,i, width));

                    var e = strip.cloneNode(false);

                    e.style.borderWidth = '0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px';

                    bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild);

                }

            }

        }

    });

};



$.fn.uncorner = function() { return $('.jquery-corner', this).remove(); };

    

})(jQuery);





jQuery(function($){

	$(document).ready(function(){

		$("#content").corner("tl tr");
		$("#sidebar ul.cornerize").corner("tr br");
		
		$(".bookmark_site a").jFav();

		$("#top_buttons li").css({width: 30+"px"});

		$("#top_buttons li.bookmark_site").hover(
			function(){ $(this).animate({width: 140+"px"}, { queue:false, duration:400}); }, 
			function(){ $(this).animate({width: 30+"px"}, { queue:false, duration:400 }); }
		);
		$("#top_buttons li.mail2friend").hover(
			function(){ $(this).animate({width: 120+"px"}, { queue:false, duration:400}); }, 
			function(){ $(this).animate({width: 30+"px"}, { queue:false, duration:400 }); }
		);
		$("#top_buttons li.home-icon").hover(
			function(){ $(this).animate({width: 120+"px"}, { queue:false, duration:400}); }, 
			function(){ $(this).animate({width: 30+"px"}, { queue:false, duration:400 }); }
		);

		$('.toggle').toggle(function(){
				el = $(this);
				$(this).next('div').slideToggle('fast',function(){
				el.removeClass('close').addClass('open');
				});
				return false;
			},function(){
				el = $(this);
				$(this).next('div').slideToggle('flast',function(){
				el.removeClass('open').addClass('close');
				});
			return false;
		});
		
		$('.m1').click(function(){
			$('.prev_box').css({display: "none"});
			$('.next_box').css({display: "inline"});
			$('body ul.car').stop().animate({marginLeft: 0+"px"},{ queue:false, duration:400});
			return false;
		})		
		$('.m2').click(function(){
			$('.next_box').css({display: "inline"});
			$('.prev_box').css({display: "inline"});
			$('body ul.car').stop().animate({marginLeft: -800+"px"},{ queue:false, duration:400});
			return false;
		})		
		$('.m3').click(function(){
			$('.next_box').css({display: "inline"});
			$('.prev_box').css({display: "inline"});
			$('.car').stop().animate({marginLeft: -1600+"px"},{ queue:false, duration:400});
			return false;
		})		
		$('.m4').click(function(){
			$('.next_box').css({display: "inline"});
			$('.prev_box').css({display: "inline"});
			$('.car').stop().animate({marginLeft: -2400+"px"},{ queue:false, duration:400});
			return false;
		})		
		$('.m5').click(function(){
			$('.next_box').css({display: "inline"});
			$('.prev_box').css({display: "inline"});
			$('.car').stop().animate({marginLeft: -3200+"px"},{ queue:false, duration:400});
			return false;
		})	
		$('.m6').click(function(){
			$('.next_box').css({display: "none"});								
			$('.prev_box').css({display: "inline"});
			$('.car').stop().animate({marginLeft: -4000+"px"},{ queue:false, duration:400});
			return false;
		})
		
		$('.prev_box').css({display: "none"});
		
		$('.next_box').click(function(){
				el = $(this);
				var ew = parseInt($('.car').css("marginLeft"));
				if(parseInt(ew) == 0){
					$('.prev_box').css({display: "inline"});
					$('.car').stop().animate({marginLeft: -800+"px"},{ queue:false, duration:400});
					$('.back').animate({left: 117+"px", width: 147+"px"},{ queue:false, duration:400});
					return false;
				} else if(parseInt(ew) == -800){
					$('.car').stop().animate({marginLeft: -1600+"px"},{ queue:false, duration:400});
					$('.back').animate({left: 299+"px", width: 62+"px"},{ queue:false, duration:400});
					return false;
				} else if(parseInt(ew) == -1600){
					$('.car').stop().animate({marginLeft: -2400+"px"},{ queue:false, duration:400});
					$('.back').animate({left: 396+"px", width: 99+"px"},{ queue:false, duration:400});
					return false;
				} else if(parseInt(ew) == -2400){
					$('.car').stop().animate({marginLeft: -3200+"px"},{ queue:false, duration:400});
					$('.back').animate({left: 530+"px", width: 104+"px"},{ queue:false, duration:400});
					return false;
				} else if(parseInt(ew) == -3200){
					$('.next_box').css({display: "none"});
					$('.car').stop().animate({marginLeft: -4000+"px"},{ queue:false, duration:400});
					$('.back').animate({left: 669+"px", width: 95+"px"},{ queue:false, duration:400});
					return false;
				}
		})
		$('.prev_box').click(function(){
				el = $(this);
				var ew = parseInt($('.car').css("marginLeft"));
				if(parseInt(ew) == -800){
					$('.prev_box').css({display: "none"});
					$('.car').stop().animate({marginLeft: 0},{ queue:false, duration:400});
					$('.back').animate({left: 30+"px", width: 52+"px"},{ queue:false, duration:400});
					return false;
				} else if(parseInt(ew) == -1600){
					$('.car').stop().animate({marginLeft: -800+"px"},{ queue:false, duration:400});
					$('.back').animate({left: 117+"px", width: 147+"px"},{ queue:false, duration:400});
					return false;
				} else if(parseInt(ew) == -2400){
					$('.car').stop().animate({marginLeft: -1600+"px"},{ queue:false, duration:400});
					$('.back').animate({left: 299+"px", width: 62+"px"},{ queue:false, duration:400});
					return false;
				} else if(parseInt(ew) == -3200){
					$('.car').stop().animate({marginLeft: -2400+"px"},{ queue:false, duration:400});
					$('.back').animate({left: 396+"px", width: 99+"px"},{ queue:false, duration:400});
					return false;
				} else if(parseInt(ew) == -4000){
					$('.next_box').css({display: "inline"});
					$('.car').stop().animate({marginLeft: -3200+"px"},{ queue:false, duration:400});
					$('.back').animate({left: 530+"px", width: 104+"px"},{ queue:false, duration:400});
					return false;
				}
		})

		$("#main_menu ul").lavaLamp({
			fx: "backout",
			speed: 500,
			click: function(event, menuItem) {
			return false;
			}
		});
		
		$('#tabbed_area').tabs({ fxSlide: true, fxFade: true, fxSpeed: 'fast' });
		$('#tabbed_area_2').tabs({ fxSlide: true, fxFade: true, fxSpeed: 'fast' });
		$('#tabbed_area_3').tabs({ fxSlide: true, fxFade: true, fxSpeed: 'fast' });

	
		function filterPath(string) {
			return string
			.replace(/^\//,'')
			.replace(/(index|default).[a-zA-Z]{3,4}$/,'')
			.replace(/\/$/,'');
			}
			var locationPath = filterPath(location.pathname);
			$('div#return2top a[href*=#]').each(function() {

			var thisPath = filterPath(this.pathname) || locationPath;

			if (  locationPath == thisPath

			&& (location.hostname == this.hostname || !this.hostname)

			&& this.hash.replace(/#/,'') ) {

			var $target = $(this.hash), target = this.hash;

			if (target) {

			var targetOffset = $target.offset().top;

			$(this).click(function(event) {

			event.preventDefault();

			$('html, body').animate({scrollTop: targetOffset}, 400, function() {

			location.hash = target;

			});

			});

			}

			}

		});

  



	});

});

