﻿var suiji80to100 = 80+Math.ceil(Math.random()*20);
var suiji3to13 = 3+Math.ceil(Math.random()*10);
var paiming = suiji3to13 +Math.ceil((300000*15*suiji80to100) /(100*readedItemsCount));
var styleIndex = 0; 
var readedItemsCount = 15;
var jianjiezhiguanMoshiIndex = 0; 
var tickCount  = 0;
var pageCount = 0 ;
var tishiCount =  5;
var daodi=0;
var bixufanye=0;
var fanyehouDiyici=0;
var maxPerPage=61;
var RefreshPage1 = function() {$.scrollTo('+=1px', 10);
setTimeout(RefreshPage2,3000);  };
var RefreshPage2 = function() {$.scrollTo('-=1px', 10);};
setTimeout(RefreshPage1, 3000); 

var RefreshTitle = function() { 
var readInfo = "";
if(tickCount  %2==0)
    readInfo += "刚翻了【"+readedItemsCount +"】件宝贝，在今日翻翻排行榜里排名【"+paiming+"位】" ;
else
    readInfo += "刚翻了  "+readedItemsCount +"  件宝贝，在今日翻翻排行榜里排名【"+paiming+"位】" ;
tickCount ++;
document.title=readInfo; 

setTimeout(RefreshTitle, 1000); 
};
setTimeout(RefreshTitle, 1000); 
var ie = -[1,];
$(function(){
$('#container  .controlFullScr').mouseover(function(){
    if(styleIndex ==0){$('#container .controlFullScr img').css("border","1px solid grey");}
}).mouseout(function(){
    if(styleIndex ==0){$('#container .controlFullScr img').css("border","0px solid grey");}
});

$('#container .controlMofaScr').mouseover(function(){
    if(styleIndex ==1){$('#container .controlMofaScr img').css("border","1px solid pink");}
}).mouseout(function(){
    if(styleIndex ==1){$('#container .controlMofaScr img').css("border","0px solid pink");}
});

//判断所属风格
if(styleIndex ==0)
{
   $('#container .controlMofaScr img').css("border","3px solid  pink");
}
else if(styleIndex ==1)
{
   $('#container .controlFullScr img').css("border","3px solid grey");
}
	
});


$(document).ready(function() {
  $(".side-item img").attr("title", function() { return this.alt });
var ie = -[1,];
if(ie)
{
    $(".side-item img").aToolTip();
      $(".goodimg a img").aToolTip();
}
else
{
        $(".goodtitle").animate({
                height: 20
            });
	if(!!window.ActiveXObject&&!window.XMLHttpRequest)
	{
		$("#arrow").css("display","none");$('#container').css("margin-left","80");
		$(".item").css("border","0px solid #D8D8D8;");
	}

}
    $("#arrow").css("position","fixed");    $("#arrow").css("right","0px");    $("#arrow").css("width","auto");    setTimeout("$.scrollTo('+=1px', 10);",2000);
    
    $("#btnbottom").click(function() {
        $.scrollTo('+=550px', 400);
    });
    $("#btntop").click(function() {
        $.scrollTo('0', 400);
    });
             $(".closebar").click(function() {

                $(this).animate({

                    bottom: '0px'

                },

                400,

                function() {

                    $(this).css("display", "none");

                    $(".openbar").css("bottom", "0").css("display", "block");

                });



                $("#taobao_bar").slideUp("normal",

                function() {

                    //关闭结束

                });

            });



            $(".openbar").click(function() {

                $(this).animate({

                    bottom: '200px'

                },

                400,

                function() {

                    $(this).css("display", "none");

                    $(".closebar").css("bottom", "200px").css("display", "block");

                });

                $("#taobao_bar").slideDown("normal",

                function() {

		$("#taobao_bar").css("height", "200");

                    //打开结束

                });

            });
});


$('.jianjieStyle').live('click', function () {jianjiezhiguanMoshiIndex =1;$(".goodinfo").css("display","none");$(".side-item").css("display","none");$(".goodcomment").css("display","none");$(".morecomment").css("display","none");$(".pictag").css("display","none");$('#container').masonry({columnWidth: 238,itemSelector: '.item',isFitWidth: true,isAnimated: false,animationOptions: {duration: 400, easing: 'linear',queue: false}});$('.jianjieStyle').css("display","none");$('.zhiguanStyle').css("display","block");});
$('.zhiguanStyle').live('click', function () {jianjiezhiguanMoshiIndex =0;$(".goodinfo").css("display","block");$(".side-item").css("display","block");$(".goodcomment").css("display","block");$(".morecomment").css("display","block");$(".pictag").css("display","block");            $('#container').masonry({columnWidth: 238,itemSelector: '.item',isFitWidth: true,isAnimated: false,animationOptions: {duration: 400, easing: 'linear',queue: false}});$('.jianjieStyle').css("display","block");$('.zhiguanStyle').css("display","none");});
$('.fanye').live('click', function () {daodi=0;bixufanye=1;fanyehouDiyici=1; $("#fanye2").css("display","none");pageCount=0;$("#tooltipTishi").hide();$(".essenceInfo").html("");$(".nextPag").html("");$('#container').masonry({columnWidth: 238,itemSelector: '.item',isFitWidth: true,isAnimated: false,animationOptions: {duration: 400, easing: 'linear',queue: false}});$('#heightPage').css("height","1500px");$.scrollTo('10px', 1000);});


function ChangeTostyle2() { styleIndex =1;   $('#container .controlMofaScr img').css("border","0px solid  pink");//$('#container .controlFullScr img').css("border","3px solid grey");
    $('.yggintro').css("display","none");
    $('.item').css("border","1px solid #D8D8D8");
    $('.container_header').css("display","none");
    $('.header').css("display","none");
    $('#bodyContainer').removeClass("container");//$('.goodrank').css("background","#F3F3F3");
    $('#container').masonry({columnWidth: 240,itemSelector: '.item',isFitWidth: true,isAnimated: false,animationOptions: {duration: 10, easing: 'linear',queue: false}});$('.controlbar1').css("display","none"); $('.controlbar2').css("display","block"); //$('body').css("background","#e8e7e3");
    //$('.side-item').css("background","#F3F3F3"); $('.itemshadow').css("display","none");$('.goodinfo').css("color","#76838B");$('.morecomment').css("background-color","#f9f9f9");$(".morecomment a").css("color","#AAA");
    //$('.goodcomment').css("border-top","1px solid #E7E7E7");$('.side-item').css("border-top","1px solid #E7E7E7");$('#arrow').css("display","none");

}

 $('.controlFullScr').live('click', function () {ChangeTostyle2();$('#heightPage').css("height","1500px"); $.scrollTo('+=50px', 400);});


function ChangeTostyle1() { styleIndex =0;$('#container .controlMofaScr img').css("border","3px solid pink");$('#container .controlFullScr img').css("border","0px solid grey");
    $('.item').css("border","0px");
    $('.header').css("display","block");
    $('.yggintro').css("display","block");$('.container_header').css("display","block");$('#bodyContainer').addClass("container"); $('.goodrank').css("background","#FFF9F7");
    $('#container').masonry({columnWidth: 238,itemSelector: '.item',isFitWidth: true,isAnimated: false,animationOptions: {duration: 400, easing: 'linear',queue: false}}); $('.controlbar2').css("display","none");$('.controlbar1').css("display","block"); $('body').css("background","#fef4f2 url(/images/transback.jpg) repeat-x  fixed");
    $('.side-item').css("background","#fff9f7");  $('.itemshadow').css("display","block");$('.goodinfo').css("color","#76838B;");$('.morecomment').css("background-color","#FFF9F7");$(".morecomment a").css("color","#AEB7BB");
    $('.goodcomment').css("border-top","1px solid #fcefef");$('.side-item').css("border-top","1px solid #fcefef");$('#arrow').css("display","block");
    
}
 $('.controlMofaScr').live('click', function () {ChangeTostyle1();});



$(function() {
    var $container = $('#container');
    $container.imagesLoaded(function() {
        $container.masonry({
            columnWidth: 238,
            itemSelector: '.item',
            isFitWidth: true,
            isAnimated: false,
            animationOptions: {
                duration: 0,
                easing: 'linear',
                queue: false
            }
        });
    });
    $container.infinitescroll({
        navSelector: '#page_nav',
        nextSelector: '#page_nav #mopouPagenext',
        itemSelector: '.nextPag',
        loadingImg: 'http://a.imimg.cn/r4841/images/array/loadinggreen.gif',
        loadingImg: 'http://a.imimg.cn/r4841/images/array/loadinggreen.gif',
        loadingText: '宝贝搜寻ing',
        donetext: ' complete',
        debug: false,
        errorCallback: function() {
            // fade out the error message after 2 seconds
            $('#infscr-loading').animate({
                opacity: .8
            },
            3000).fadeOut('slow');
            $('#infscr-done').css("display", "block");
            $('#infscr-done').animate({
                opacity: .8
            },
            10000).fadeOut('slow');
        }
    },
    // call masonry as a callback.
    function(newElements) {

pageCount++;
if(pageCount==tishiCount)
{
     tishiCount=tishiCount*2;
     //写入翻页代码
     //document.write('<div class="item"><div class="fanye"> 当前页面信息太多？点击翻页</div></div>');
     $("#tooltipTishi").show();
     setTimeout("$('#tooltipTishi').hide();",5000)
}
var ie = -[1,];
if(ie)
{
    $(".side-item img").aToolTip();  
    $(".goodimg a img").aToolTip();
}
else
{
     $(".goodtitle").animate({
                height: 20
            });
}
            var $newElems = $(newElements);
            // ensure that images load before adding to masonry layout
if(fanyehouDiyici==0)
{
            $newElems.hide();
}
else
{
	fanyehouDiyici=0;
}

            $newElems.imagesLoaded(function() {
if(ie)
{
            $newElems.fadeIn();
}
else
{
            $newElems.show();
}
	    readedItemsCount =readedItemsCount +15;
if(readedItemsCount>maxPerPage)
{
	if(ie)
	{}
	else
	{
		//到底了
		$("#heightPage").css("height","0");
		daodi=1;
        $("#fanye2").css("display","block");
        maxPerPage+=80;
	}
}
paiming = 3+Math.ceil((300000*15*suiji80to100) /(100*readedItemsCount));
            $container.masonry('appended', $newElems, true);
            if(styleIndex==1)
            {ChangeTostyle2();}
           });
            if(jianjiezhiguanMoshiIndex ==1)
            {
               $(".goodinfo").css("display","none");$(".side-item").css("display","none");$(".goodcomment").css("display","none");$(".morecomment").css("display","none");$(".pictag").css("display","none");$('#container').masonry({columnWidth: 238,itemSelector: '.item',isFitWidth: true,isAnimated: false,animationOptions: {duration: 400, easing: 'linear',queue: false}});$('.jianjieStyle').css("display","none");$('.zhiguanStyle').css("display","block");
            }
});
 
jQuery.fn.outer = function() { 
	    return $($('<div></div>').html(this.clone())).html();
	} 

var readItem1,readItem2,readItem3,readItem4,readItem5;
$(".goodimg").live({
mouseenter: function() {
if(ie)
{          
        $(this).parent().children(".goodrank").animate({height:117});
        $(this).children(".goodtitle").animate({
                height: 20
            });
      if(jianjiezhiguanMoshiIndex ==1)
      {
            $(this).parent().children(".goodinfo").show();
            $(this).parent().children(".side-item").show();
            $(this).parent().children(".goodcomment").show();
            $(this).parent().children(".morecomment").show();
            $(this).parent().children(".pictag").show();

      }
            $(this).parent().css({"z-index":"99"});
}
else
{
      $(this).parent().children(".goodrank").css("height","137px");
      if(jianjiezhiguanMoshiIndex ==1)
      {
            $(this).parent().children(".goodinfo").fadeIn();
            $(this).parent().children(".side-item").fadeIn();
            $(this).parent().children(".goodcomment").fadeIn();
            $(this).parent().children(".morecomment").fadeIn();
            $(this).parent().children(".pictag").fadeIn();

      }
            $(this).parent().css({"z-index":"99"});
}
},

click: function() {
var imgstr =$(this).children("a").outer();

readItem5=readItem4;
readItem4=readItem3;
readItem3=readItem2;
readItem2=readItem1;
readItem1=imgstr;

$('.readed').html('<div class="readeditemsStr" style="background-color: #FF9BA9;width: 60px;height: 24px;border: 1px solid #D70034;color: white;text-align: center;color: rgb(255, 255, 255);font-weight: bold;">刚看过<div><div class="readItem">'+readItem1+readItem2+readItem3+readItem4+readItem5+'</div>');
}
});


$(".item").live({
mouseenter: function() {
            $(this).css({"z-index":"99"});
       var ie = -[1,];
       if(ie)
        {
            $(this).children(".goodimg").children("a").children("img").css({"-moz-box-shadow":"0px 0px 20px #aaa"});
            $(this).children(".goodimg").children("a").children("img").css({"-webkit-box-shadow":"0px 0px 20px #aaa"});
            $(this).children(".goodimg").children("a").children("img").css({"box-shadow":"0px 0px 20px #aaa"});
        }
},
      mouseleave: function() {
       var ie = -[1,];
       if(ie)
       {
            $(this).children(".goodrank").animate({height:0});
            $(this).children(".goodimg").children("a").children("img").css({"-moz-box-shadow":"0px 0px 10px #ccc"});
            $(this).children(".goodimg").children("a").children("img").css({"-webkit-box-shadow":"0px 0px 10px #ccc"});
            $(this).children(".goodimg").children("a").children("img").css({"box-shadow":"0px 0px 10px #ccc"});
            $(this).children(".goodimg").children(".goodtitle").animate({
                height: 0
            });
        }
        else
        {
            $(this).children(".goodrank").css("height","0px");
        }
        
           
      if(jianjiezhiguanMoshiIndex ==1)
      {
            $(this).children(".goodinfo").hide();
            $(this).children(".side-item").hide();
            $(this).children(".goodcomment").hide();
            $(this).children(".morecomment").hide();
            $(this).children(".pictag").hide();

      }
            $(this).css({"z-index":"50"});
        }
    });



 
    $('.toggle').live('click',
    function() {
        if ($(this).parent().siblings(".morecommentbox").css("display") == "none") {
            $(this).html("收起评论");
        } else {
            $(this).html("更多评论");
        }
        $(this).parent().siblings(".morecommentbox").slideToggle("normal",
        function() {
				$container.imagesLoaded(function() {
                    $container.masonry({
                        columnWidth: 238,
                        itemSelector: '.item',
                        isFitWidth: true,
                        isAnimated: true,
                        animationOptions: {
                            duration: 400,
                            easing: 'linear',
                            queue: false
                        }
                    });
                });
        });
    });
 
	$(".favthis a").live('click',
	function(){
		var ctrl = (navigator.userAgent.toLowerCase()).indexOf('mac') != -1 ? 'Command/Cmd':'Ctrl';
		var myloc = "http://www.mopou.com"+$(this).attr("title");
		var mytitle = $(this).parent().parent().siblings(".goodimg").children(".goodtitle").html();
		if(document.all)
		{
			window.external.addFavorite(myloc,mytitle);
		}
		else if(window.sidebar)
		{ 
			window.sidebar.addPanel(mytitle,myloc);
		}
		else{
			top.location = myloc;
			//alert('请用Ctrl+D进行添加');
		}
	});
 
       $(".hidecomment").live('click',
	function(){
		$(".goodcomment").hide();
                $(".morecomment").hide();
                $(this).hide();
$(".showcomment").show();
$container.imagesLoaded(function() {
                    $container.masonry({
                        columnWidth: 238,
                        itemSelector: '.item',
                        isFitWidth: true,
                        isAnimated: true,
                        animationOptions: {
                            duration: 400,
                            easing: 'linear',
                            queue: false
                        }
                    });
                });
		}
	);
 
 $(".showcomment").live('click',
	function(){
		$(".goodcomment").show();
                $(".morecomment").show();
                $(this).hide();
$(".hidecomment").show();
$container.imagesLoaded(function() {
                    $container.masonry({
                        columnWidth: 238,
                        itemSelector: '.item',
                        isFitWidth: true,
                        isAnimated: true,
                        animationOptions: {
                            duration: 400,
                            easing: 'linear',
                            queue: false
                        }
                    });
                });
		}
	);
 
});


// by zhangxinxu welcome to visit my personal website http://www.zhangxinxu.com/
// 2010-03-12 v1.0.0
//鍗佸叚杩涘埗棰滆壊鍊煎煙RGB鏍煎紡棰滆壊鍊间箣闂寸殑鐩镐簰杞崲

//-------------------------------------
//鍗佸叚杩涘埗棰滆壊鍊肩殑姝ｅ垯琛ㄨ揪寮�
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
/*RGB棰滆壊杞崲涓�16杩涘埗*/
String.prototype.colorHex = function(){
	var that = this;
	if(/^(rgb|RGB)/.test(that)){
		var aColor = that.replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",");
		var strHex = "#";
		for(var i=0; i<aColor.length; i++){
			var hex = Number(aColor[i]).toString(16);
			if(hex === "0"){
				hex += hex;	
			}
			strHex += hex;
		}
		if(strHex.length !== 7){
			strHex = that;	
		}
		return strHex;
	}else if(reg.test(that)){
		var aNum = that.replace(/#/,"").split("");
		if(aNum.length === 6){
			return that;	
		}else if(aNum.length === 3){
			var numHex = "#";
			for(var i=0; i<aNum.length; i+=1){
				numHex += (aNum[i]+aNum[i]);
			}
			return numHex;
		}
	}else{
		return that;	
	}
};

//-------------------------------------------------

/*16杩涘埗棰滆壊杞负RGB鏍煎紡*/
String.prototype.colorRgb = function(){
	var sColor = this.toLowerCase();
	if(sColor && reg.test(sColor)){
		if(sColor.length === 4){
			var sColorNew = "#";
			for(var i=1; i<4; i+=1){
				sColorNew += sColor.slice(i,i+1).concat(sColor.slice(i,i+1));	
			}
			sColor = sColorNew;
		}
		//澶勭悊鍏綅鐨勯鑹插€�
		var sColorChange = [];
		for(var i=1; i<7; i+=2){
			sColorChange.push(parseInt("0x"+sColor.slice(i,i+2)));	
		}
		return "RGB(" + sColorChange.join(",") + ")";
	}else{
		return sColor;	
	}
};


/*
 * Bubbleup - Spicing up menu jQuery plugin
 *
 * Tranform the images inside the list items like Mac Dock effect
 *
 * Homepage: http://aext.net/2010/04/bubbleup-jquery-plugin/
 *
 * Copryright? I don't have any!
 *
 * First written by Lam Nguyen (yah, it's me)
 * Written again by Jonathan Uhlmann http://jonnitto.ch
 * Thanks to Icehawg (Hey, I don't know anything from him, just a name http://aext.net/2010/02/learn-jquery-first-jquery-plugin-bubbleup/#comment-6777)
 *
 */


(function($){
	$.fn.bubbleup = function(settings){
		settings=$.extend({
			tooltip: false,//鏄惁鎻愮ず鏂囨湰
			scale:120,//鏀惧ぇ鍚庣殑鍥剧墖瀹藉害
			fontFamily:'Helvetica, Arial, sans-serif',//鎻愮ず鏂囨湰瀛椾綋
			color:'#333333',//鎻愮ず鏂囨湰瀛椾綋棰滆壊
			fontSize:12,//鎻愮ず鏂囨湰瀛椾綋澶у皬
			fontWeight:'bold',//鎻愮ず鏂囨湰瀛椾綋绮楃粏
			inSpeed:'fast',//榧犳爣鍒掕繃鏀惧ぇ鏃剁殑閫熷害
			outSpeed:'fast'//榧犳爣宸插嚭缂╁皬鏃舵椂鐨勯€熷害
			},settings);
			return this.each(function(){
				$.fn.bubbleup.runing( $( this ), settings );
			})
	};
	$.fn.bubbleup.runing=function($this,settings){
		var smallImgW=$this.width();
                var smallImgH=$this.height();
		$this.mouseover(function(){
			if (settings.tooltip) {
                                $this.parent().parent().parent().css({'z-index':99});
				tip=$('<div>' + $(this).attr('alt') + '</div>').css({
					fontFamily: settings.fontFamily,
					color: settings.color, 
					fontSize: settings.fontSize, 
					fontWeight: settings.fontWeight, 
					position: 'absolute', 
					zIndex: 100000
				}).remove().css({top:0,left: 0,visibility:'hidden',display:'block'}).appendTo(document.body);
				var position=$.extend({},$this.offset(),{width:this.offsetWidth,height:this.offsetHeight});
				var tipWidth = tip[0].offsetWidth;
				var tipHeight = tip[0].offsetHeight;
				tip.stop().css({
						top: position.top - tipHeight, 
						left: position.left + position.width / 2 - tipWidth / 2,
						visibility: 'visible'
					}).animate({top:'-='+(settings.scale/2-smallImgW/2)},settings.inSpeed); 
			}
			$this.closest('li').css({'z-index':100000});
			$this.stop().css({'z-index':100000,'top':0,'left':0,'width':smallImgW}).animate({
				left:-settings.scale/2+smallImgW/2,
				top:-settings.scale/2+smallImgW/2,
				width:settings.scale,
                                height:settings.scale*smallImgH/smallImgW
			},settings.inSpeed)
		}).mouseout(function(){
			$this.closest('li').css({'z-index':100});
			$this.closest('li').next().css({'z-index':0});
			$this.closest('li').next().css({'z-index':0});
			$this.closest('li').next().children('img').css({'z-index':0});
			if(settings.tooltip){tip.remove()}
			$this.stop().animate({left:0,top:0,width:smallImgW,height:smallImgH},settings.outSpeed,function(){
				$this.css({'z-index':0});
                                $this.parent().parent().parent().css({'z-index':51});
			});
		});
		
	}
})(jQuery);

$(function () { 
	// Stack initialize
	var openspeed = 300;
	var closespeed = 300;
	$('.stack>img').toggle(function(){
		var vertical = 0;
		var horizontal = 0;
		var $el=$(this);
		$el.next().children().each(function(){
			$(this).animate({top: '-' + vertical + 'px', left: horizontal + 'px'}, openspeed);
			vertical = vertical + 55;
			horizontal = (horizontal+.75)*2;
		});
		$el.next().animate({top: '-50px', left: '10px'}, openspeed).addClass('openStack')
		   .find('li a>img').animate({width: '50px', marginLeft: '9px'}, openspeed);
		$el.animate({paddingTop: '0'});
	}, function(){
		//reverse above
		var $el=$(this);
		$el.next().removeClass('openStack').children('li').animate({top: '55px', left: '-10px'}, closespeed);
		$el.next().find('li a>img').animate({width: '79px', marginLeft: '0'}, closespeed);
		$el.animate({paddingTop: '35px'});
	});
	
	// Stacks additional animation
	$('.stack li a').hover(function(){
		$("img",this).animate({width: '56px'}, 100);
		$("span",this).animate({marginRight: '30px'});
	},function(){
		$("img",this).animate({width: '50px'}, 100);
		$("span",this).animate({marginRight: '0'});
	});
});

$(document).ready(function(){
$("a.switch_thumb").toggle(function(){
$(this).addClass("swap");
$("ul.display").fadeOut("fast", function() {
$(this).fadeIn("fast").addClass("thumb_view");
});
}, function () {
$(this).removeClass("swap");
$("ul.display").fadeOut("fast", function() {
$(this).fadeIn("fast").removeClass("thumb_view");
});
});
});


jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: 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;
	},
	easeOutElastic: 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;
	},
	easeInOutElastic: 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;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) 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;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: 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;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});



$(document).ready(function(){

//Page Flip on hover

	$("#pageflip").hover(function() {
		$("#pageflip img , .msg_block").stop()
			.animate({
				width: '307px', 
				height: '319px'
			}, 500); 
		} , function() {
		$("#pageflip img").stop() 
			.animate({
				width: '50px', 
				height: '52px'
			}, 220);
		$(".msg_block").stop() 
			.animate({
				width: '50px', 
				height: '50px'
			}, 200);
	});

	
});


