var image;
var introAnimTime = 800;


function init()
{
//     image = new Image();
//     image.onload = startPage;
//     image.src = "../static/images/index_page.jpg";
//     $("#collection img").hover()
    $("#menu").css("opacity","0");
    $("#menu").css("display","block")
    
    img = new Image();
    img.onload = start_stage1_1
    img.src = "../static/images/main_girls.jpg";
}

function startPage()
{
    $("#credits").animate({"opacity":"1"},1000);
    $("#pic").animate({"opacity":"1"},1000,start_stage1_6);
}

function start_stage1_1()
{
    $("#mgLeft").animate({"height":"100%"},introAnimTime/2,start_stage1_2);
}

function start_stage1_2()
{
    $("#mgTop").animate({"width":"100%"},introAnimTime/2,start_stage1_3);
}


function start_stage1_3()
{
    $("#mgRight").animate({"height":"100%"},introAnimTime/2,start_stage1_4);
}

function start_stage1_4()
{
    $("#mgBottom").animate({"width":"100%"},introAnimTime/2,start_stage1_5);
}


function start_stage1_5()
{
    $("#smallLogo").animate({"top":"150px","opacuty":"1"},introAnimTime/2,startPage);
    $("#smallLogo").animate({"top":"120"},200);
}


function start_stage1_6()
{
    setTimeout("start_stage1_7()",3500);
}

function start_stage1_7()
{
    $("#smallLogo").animate({"opacity":"0"},500,start_stage1_8);
    
}

function start_stage1_8()
{
    $("#mainGirls").animate({"opacity":"0"},1000,start_stage2);
    $("#credits").animate({"opacity":"0"},1000);
}

function start_stage2()
{
    $("#mainGirls").css("display","none");
    $("#rightLine").animate({"top":"0"},introAnimTime,start_stage3);
    $("#leftLine").animate({"top":"60"},introAnimTime);
}

function start_stage3()
{
    $("#top1Line").animate({"right":"68"},introAnimTime,start_stage4);
    $("#top2Line").animate({"left":"0"},introAnimTime);
    $("#menu").animate({"opacity":"1"},introAnimTime);
}

function start_stage4()
{
    $("#bottom2Line").animate({"left":"56"},introAnimTime,start_stage5);
    $("#bottom1Line").animate({"left":"47"},introAnimTime);
    $("#logo").animate({"opacity":"1","top":"63"},introAnimTime);
}

function start_stage5()
{
    $("#bottom2Line").animate({"top":"583"},introAnimTime,start_stage6);
        $("#footer").animate({"height":"16"},introAnimTime);
        $("#footer_en").animate({"height":"16"},introAnimTime);

}

function start_stage6()
{
    $("#detail_pic").css("display","block");
    $("#detail_pic").animate({"opacity":"1"},introAnimTime);
    $("#squareThingy").animate({"height":"125"},introAnimTime);
    $("#rightLine").animate({"left":"908"},introAnimTime);
    $("#content_wrap").animate({"width":"782"},introAnimTime);
//     $("#leftLine").animate({"background-position":"0px 1000px"},5000);
}

init();