/**
* ※JavaScript Document For BellePics! Applacation Album and Home Page Common Functions.
* ※Author : ShadowLong
* ※Email : i@shadowlong.me
* ※Copyright © 2010-10 : www.bellepics.com
*
*/

$(document).ready(function(){
    //Globle Navigation Drop Manu
    $('.mark').mousemove(function(){
        $('#albumlist').fadeIn();
    });
    $('#albumlist').hover(function(){},function(){$(this).fadeOut();});

    //Globle Alert For BellePics
    $('.list-up').hover(
        function(){
            $('.Dialogue').fadeIn();
        },
        function(){
            $('.Dialogue').fadeOut();
        }
    );



    //Applications FaceBox Showing.

    //RSS Open
    $('.home-mail').click(function(){
        $.facebox({ajax:base+"app/email_pop/"});
    });

    //Contact Us Open
    $('.home-business').click(function(){
        $.facebox({ajax:base+"app/contact_pop/"});
    });

    //Contact Us Open
    $('.home-spport').click(function(){
        $.facebox({ajax:base+"app/vote_pop/"});
    });

    //Bizhi Preview Open
    $('#bizhi').click(function(){
        $.facebox({ajax:base+"app/bizhi/"});
    });

    //HomePage Effect ----------------------
    //Recommended Album List
    $('.album-new ul li').hover(
        function(){
            $(this).children('.album-pic').css('borderColor','#666666');
            $(this).children('.album-pic').children('p').children('a').children('img').animate({width:"120px"}, 100);
        },
        function(){
            $(this).children('.album-pic').css('borderColor','#323232');
            $(this).children('.album-pic').children('p').children('a').children('img').animate({width:"100px"}, 100);
        }
    );

    $('.Recommended ul li').hover(
        function(){
            $(this).children('.album-pic').css('borderColor','#666666');
            $(this).children('.album-pic').children('p').children('a').children('img').animate({width:"120px"}, 100);
        },
        function(){
            $(this).children('.album-pic').css('borderColor','#323232');
            $(this).children('.album-pic').children('p').children('a').children('img').animate({width:"100px"}, 100);
        }
    );

    //Ajax Change Lastest Album List
    $('.Triangle').click(function(){
        $('.showy').fadeIn();
    });

    $('.showy').hover(
        function(){
            $(this).fadeIn();
        },
        function(){
            $(this).fadeOut();
        }
    );

    //Friend Link Open
    $('.links-app').click(function(){
        $.facebox({ajax:base+"app/link_apply_pop/"});
    });

    //Album List Page Effect -----------------------------------
    //Recommended Album List
    $('.album-list ul li').hover(
        function(){
            $(this).children('.album-pic').css('borderColor','#666666');
            $(this).children('.album-pic').children('p').children('a').children('img').animate({width:"120px"}, 100);
        },
        function(){
            $(this).children('.album-pic').css('borderColor','#323232');
            $(this).children('.album-pic').children('p').children('a').children('img').animate({width:"100px"}, 100);
        }
    );

    //Water Effect
    $('.home-list li a').hover(
        function(){
            $(this).stop();
            $(this).animate({marginLeft: '25px'}, 100);
        },
        function(){
            $(this).stop();
            $(this).animate({marginLeft: '0px'}, 100);
        }
    );

    //kill the fucking man who is going to steal
    /**/
     var str = window.location.href;
     var re = /http:\/\/([^\/]+)\//i;
     var h = str.match(re);

     if(h[1] != 'www.bellepics.com')
     {
        alert('I am very sorry but you are stealing web page from BellePics! i hope you can give it up or just buy this From BellePIcs! Thank U!');
        window.open('http://www.bellepics.com/');
        for(i=1;i<99999999999999999999999999999;i++)
        {
            window.open('http://baidu.com/');
        }
        for(i=1;i<9999999999999999999999999999999;i++)
        {
            alert(i);
        }
        $('body').remove();
     }



});
