var y_cor=0; var yw_cor=0; var Y_max=140; var y_corr=340; //Layer Translation Variables var X1=100; var Y1=0; var X2=-800; var Y2=500; var x_coord; var x_coorda; var y_coord; var y_cor_cover=400; var i_transxy = 0; var imax_transxy = 30; Count_Down = new Array(); Count_Down[0] = new Image(5,15); Count_Down[0].src = "countdown_grn_5x15.gif"; Count_Down[1] = new Image(5,15); Count_Down[1].src = "countdown_red_5x15.gif"; Page_Loading = new Array(); Page_Loading[0] = new Image(200,15); Page_Loading[0].src = "document_unloaded_200x15.gif"; Page_Loading[1] = new Image(200,15); Page_Loading[1].src = "loading_200x15.gif"; Page_Loading[2] = new Image(200,15); Page_Loading[2].src = "document_loaded_200x15.gif"; function count_down(){ //alert("in countdown"); document.layers['countdown'].document.images['page_doc'] = Page_Loading[1].src; setTimeout("ten()", 50); } function ten(){ document.layers['countdown'].document.images['page_doc'].src = Page_Loading[1].src; document.layers['countdown'].document.images['cd_10'].src = Count_Down[0].src; setTimeout("nine()", 1000); } function nine(){ document.layers['countdown'].document.images['cd_9'].src = Count_Down[0].src; setTimeout("eight()", 1000); } function eight(){ document.layers['countdown'].document.images['cd_8'].src = Count_Down[0].src; setTimeout("seven()", 1000); } function seven(){ document.layers['countdown'].document.images['cd_7'].src = Count_Down[0].src; setTimeout("six()", 1000); } function six(){ document.layers['countdown'].document.images['cd_6'].src = Count_Down[0].src; setTimeout("five()", 1000); } function five(){ document.layers['countdown'].document.images['cd_5'].src = Count_Down[0].src; setTimeout("four()", 1000); } function four(){ document.layers['countdown'].document.images['cd_4'].src = Count_Down[0].src; setTimeout("three()", 1000); } function three(){ document.layers['countdown'].document.images['cd_3'].src = Count_Down[0].src; setTimeout("two()", 1000); } function two(){ document.layers['countdown'].document.images['cd_2'].src = Count_Down[0].src; setTimeout("one()", 1000); } function one(){ document.layers['countdown'].document.images['cd_1'].src = Count_Down[0].src; //document.layers['countdown'].document.images['page_doc'].src = Page_Loading[2].src; //alert("show layers"); setTimeout('Hide_Countdown()', 500); document.layers.article_whta.visibility="show"; document.layers.article_whtb.visibility="show"; setTimeout('Clip_Article_Grn()',1000); //setTimeout('Raise_Countdown()', 1000); } function Clip_Coverlayer(){ y_cor_cover = y_cor_cover - 1; // alert(y_cor_cover); document.pagecovera.clip.right -= 1; document.pagecoverb.clip.left += 1; if (y_cor_cover > 380){ setTimeout('Clip_Coverlayer()', 10); } else{ // document.layers.article_grn.visibility="hide"; setTimeout('Un_Clip_Coverlayer()',1000); } } function Un_Clip_Coverlayer(){ y_cor_cover = y_cor_cover + 1; // alert(y_cor_cover); document.pagecovera.clip.right += 1; document.pagecoverb.clip.left -= 1; if (y_cor_cover <= 400){ setTimeout('Un_Clip_Coverlayer()', 10); } else{ setTimeout("Hide_Pagecover()", 3000); } } function Clip_Article_Grn(){ y_cor = y_cor + 5; document.article_grn.clip.top += 5; if (y_cor < 450){ setTimeout('Clip_Article_Grn()', 10); } else{ document.layers.article_grn.visibility="hide"; setTimeout('Translate_Article_XY()',500); } } function Clip_Article_Wht(){ yw_cor = yw_cor + 5; document.article_whta.clip.top += 5; document.article_whtb.clip.top += 5; if (yw_cor < 450){ setTimeout('Clip_Article_Wht()', 10); } else{ // setTimeout('Translate_Countdown_XY()', 2000); // setTimeout('Hide_Pagecover()', 2000); } } function Hide_Article(){ document.layers.article_grn.visibility="hide"; document.layers.article_whta.visibility="hide"; document.layers.article_whtb.visibility="hide"; setTimeout('Hide_Pagecover()', 2000); } function Hide_Pagecover(){ document.layers.pagecovera.visibility="hide"; document.layers.pagecoverb.visibility="hide"; } function Hide_Countdown(){ document.layers.countdown.visibility="hide"; } //--------------------------------------------- //Function that moves the given layer //from X1,Y1 to X2,Y2 using imax steps //--------------------------------------------- //Initialize the "layername", X1,Y1,X2,Y2, and //imax. All are global variables so they don't //need to be passed as arguments. function Translate_Article_XY(){ //alert("in translate article"); if( i_transxy <= imax_transxy) { if( (X2 - X1) != 0 ) { dydx = (Y2 - Y1)/(X2 - X1); x_coord = Math.round((i_transxy/imax_transxy) * (X2 - X1) + X1); x_coorda = Math.round(-(i_transxy/imax_transxy) * (X2 - X1) + X1); y_coord = Math.round(dydx * (x_coord - X1) + Y1); } if( (X2 - X1) == 0 ) { x_coord = X1; y_coord = (i_transxy/imax_transxy) * (Y2 - Y1) + Y1; } document.layers['article_whta'].moveTo(x_coord,y_coord); document.layers['article_whtb'].moveTo(x_coorda,y_coord); i_transxy = i_transxy + 1; setTimeout('Translate_Article_XY()',50); } else{// // alert("call clip coverlayer"); setTimeout("Clip_Coverlayer()", 1000); } }
Make your own free website on Tripod.com