

var cont = "";      // CONTAINS THE HTML CODE TO INSERT
var comlin1 = 0;  // CONTAINS THE COMMANDS
var comlin2 = 0;
var comlin3 = 0;
var comlin4 = 0;

// THE FIFO
var lastno1 = 0;  // holds the oldest
var lastno2 = 0;
var lastno3 = 0;
var lastno4 = 0;
var lastno5 = 0;
var lastno6 = 0;  // holds the newest

var gallery = 0
var picno = 21;
var min_picno = 1;
var max_picno = 50;
var direct = 1;
var speed = 6000;
var htim = 6;
var slon = 0;
var fail = 0;


var Displ;

var ownURLstorer = "";

var elstorer = 0;    // EMPTY LINES
var wstorer = 0;     // OWN WEBSITE
var advstorer = 0;   // ADVERTISING
var Xadvstorer = 0;  // PROTECTED ADVERTISING
var nextLink = "";   // Next link
var pilicou = 0; //	COUNTER ONLY FOR PICTURE LIST 

var vmaincont = "'maincont'";
var ecom = "--\end of comment\>";	//	ALLOWS HTML - COMMENTS WITHIN JAVASCRIPTS
/*
HOW TO USE			//	
   cont += ecom+ '\n';			//	MAKE A FINAL HTML COMMENT-TAG ->
				//	CONTINUE WITH YOUR JAVASCRIPT
//	FIRST SPLIT THE STRING VARIABLE cont TO A VARIABLE part - THIS PUT cont IN AN ARRAY part[0] ... part[x] AND REMOVES "\end of comment\>"
   part = cont.split("\end of comment\>");
//	THEN CONVERT THE ARRAY part BACK TO A STRING IN cont AND USE ">" AS DELIMITER
   cont = part.join(">");
//	FINALY DISPLAY THE STRING IN cont AS TEXT IN document.dHTML.code1.value
   document.dHTML.code1.value = cont;
//	AND AS HTML IN display_gall
   document.getElementById('display_gall').innerHTML = cont;
*/




//	THE MAIN ROUTINE
function startup()
{
   closeme('headerhost');
   parseCommandLine();
   window.setInterval('tint()',1000);
}

function closeme(whichLoc)
{
   if(!document.getElementById(whichLoc))
   {
       ;
   }
   else
   {
       document.getElementById(whichLoc).style.display = "none";
   }
}

function openme(whichLoc) {
  document.getElementById(whichLoc).style.display = "inline";
}

function tint()      // THE TIMER ROUTINE
{
  if ( slon == 0 )
  {
    return;
  }

  htim--;
  if ( htim == 0 )
  {
    chg_pic();
    htim = speed/1000;
  }
  else
  {
    cont += htim + ' sec.';
    document.getElementById('sl_shtime').innerHTML = cont;
    cont='';
  }
}

function time_p()
{
  speed += 1000;
  if ( speed > 40000 )
  {
    speed = 40000;
  }
}

function time_m()
{
  speed -= 1000;
  if ( speed < 5000 )
  {
    speed = 5000;
  }
}

function back_pic()
{
  direct = 0;
  chg_pic();
}

function forw_pic()
{
  direct = 1;
  chg_pic();
}

function chg_pic()
{
   if ( direct == 1 ) {
      picno++;
   }
   else {
      picno--;
   }
   if ( picno == max_picno )                       // PREPARE THE LINK TO NEXT GALLERY IF REQUESTED
   {
      if ( Displ[15] == " " )
      {
         ;
      }
      else
      {
         XDispl = Displ[15].split('~~');           // Split array entry Displ[15] and check advertising
         ng2show = parseInt(XDispl[0]);            // New gallery no.
         if ( Xadvstorer == 0 )                    // Store valid advertising only in the first occurence
         {
            Xadvstorer = advstorer;
         }
         var stadvup = XDispl[1];                  // u = Unprotected - advertise each company
                                                   // p = Protected - advertise only defined company

         if ( ng2show <= nview.length-1 )          // Displ[15] contains valid number
         {
            XDispl = nview[ng2show].split('||');   // Split the array entry
            if ( XDispl[0] == 0 )                  // Valid array entry - Prepare the new gallery
            {
               YDispl = nview[ng2show].split('||')  // Split the same array entry but now to Displ
               nextLink = 'new_gv.html?' +YDispl[4]+ ',' +ng2show+ ',' +wstorer+ ',';
               if ( stadvup == 'p' )               // Check protected advertising
               {
                  nextLink += YDispl[8];
               }
               else                                // Set unprotected advertising
               {
                  nextLink += Xadvstorer;
               }
            }
            else                                   // Invalid array entry
            {
               ;
            }
         }
         else                                      // Invalid array number
         {
            ;
         }
      }
   }
   if ( picno > max_picno )                        // CHECK AND ENABLE AUTOMATICAL GALLERY CHANGE
   {
      if ( Displ[15] == " " )
      {
         picno = min_picno;
      }
      else
      {
         XDispl = Displ[15].split('~~');           // Split array entry Displ[15] and check advertising
         ng2show = parseInt(XDispl[0]);            // New gallery no.
         if ( Xadvstorer == 0 )                    // Store valid advertising only in the first occurence
         {
            Xadvstorer = advstorer;
         }
         var stadvup = XDispl[1];                  // u = Unprotected - advertise each company
                                                   // p = Protected - advertise only defined company
         if ( ng2show <= nview.length-1 )          // Displ[15] contains valid number
         {
            XDispl = nview[ng2show].split('||');   // Split the array entry
            if ( XDispl[0] == 0 )                  // Valid array entry - Prepare the new gallery
            {
               Displ = nview[ng2show].split('||')  // Split the same array entry but now to Displ
               picno = parseInt(Displ[4]);         // Set pivno and picture show limiters
               min_picno = parseInt(Displ[4]);
               max_picno = (parseInt(Displ[4])+parseInt(Displ[5])) - 1;
               gallery = ng2show;                  // Change gallery but not own website
               if ( stadvup == 'p' )               // Check protected advertising
               {
                  advstorer = Displ[8];
               }
               else                                // Set unprotected advertising
               {
                  advstorer = Xadvstorer;
               }
            }
            else                                   // Invalid array entry
            {
               picno = min_picno;                  // Continue the old gallery
            }
         }
         else                                      // Invalid array number
         {
            picno = min_picno;                     // Continue the old gallery
         }
      }
   }
   if ( picno < min_picno )
   {
      picno = max_picno;
   }

//   THE NEW PAGE CONSTRUCTION BEGINS HERE

// CORRECT TITLE
//   CHECK IF A PICTURE LIST IS TO USE

   if ( Displ[1] == "pili://" )	//	USE PICTURE LIST
   {
      pilicou++;
      document.getElementsByTagName('title')[0].text = webt[wstorer]+ " " +nvpili[gallery][pilicou];
   }
   else			//	USE STANDARD
   {
      document.getElementsByTagName('title')[0].text = webt[wstorer]+ " " +Displ[1]+ " " +picno;
   }

// CORRECT BACKGROUND COLOR
   if ( wstorer == 4 || wstorer == 5 || wstorer == 7 || wstorer == 10 )
   {
      // chgbgcolor('mbody','#003A75');
      chgbgcolor('mbody','#400040');
   }
   mk_madver();            // MAKE MAIN ADVERTISING
   mk_ownws();             // MAKE OWN WEBSITE ADVERTISING
   // CORRECT MAIN HEADER
   document.getElementById('whoprese').innerHTML = webu[wstorer];
   if ( wstorer ==  4 || wstorer ==  10 )
   {
      document.getElementById('prese').innerHTML = 'presents - pr&auml;sentiert';
   }
   else
   {
      document.getElementById('prese').innerHTML = 'presents';
   }

// CORRECT HEADER TITLE
//   CHECK IF A PICTURE LIST IS TO USE
   if ( Displ[1] == "pili://" )	//	USE PICTURE LIST
   {
         document.getElementById('picname').innerHTML = nvpili[gallery][pilicou];
   }
   else			//	USE STANDARD
   {
      document.getElementById('picname').innerHTML = Displ[1]+ ' ' +picno;
   }


   if ( wstorer ==  4 || wstorer ==  10 )
   {
      document.getElementById('dclick').innerHTML = "F&uuml;r's n&auml;chste Bild ins Bild klicken";
   }
   else
   {
      document.getElementById('dclick').innerHTML = '&nbsp';
   }
   if ( picno % 5 == 0 )
   {
      mk_dllinks();        // WRITE DOWNLOAD LINKS
   }
   else                    // WRITE THANK YOU MESSAGE
   {
      mk_thyomsg();
   }




// NOW CHANGE THE MAIN PICTURE

//   CHECK IF A PICTURE LIST IS TO USE

   if ( Displ[1] == "pili://" )	//	USE PICTURE LIST
   {
       pilicou++;
       cont = '<a href="javascript: chg_pic();"><img name="mainp" src="' +nvpili[gallery][pilicou]+ '" alt="' +nvpili[gallery][(pilicou-1)]+ '" border="0" onload="if(this.width>950) {this.width=950;}; document.getElementById(';
       cont += "'dllink').scrollIntoView('true');";
       cont += '" />\n</a>';
   }
   else			//	USE STANDARD
   {
      cont='<a href="javascript: chg_pic();"><img name="mainp" src="' +Displ[2]+Displ[3];
      var corpicno = leading(picno);
      cont += corpicno;
//	ONLY FOR PICTURENAME  EXCEPTIONS
      if ( gallery == 5 && picno == 16 )
      {
         cont += 'x';
      }
      cont += '.jpg" alt="' +Displ[1]+ '" border="0" onload="if(this.width>950) {this.width=950;}; document.getElementById(';
      cont += "'dllink').scrollIntoView('true');";
      cont += '" />\n</a>';
   }

//  alert(document.getElementById('picholder').innerHTML + '\n' + cont);
   document.getElementById('picholder').innerHTML = cont;
   cont='';	//	CLEAR
   mk_neli();
   lili();
   mk_mfooter();
}

function leading(tp)
{
   var outtp = "";

   switch(Displ[6])
   {
      case "0":   return(tp); break;
      case "1":   if ( tp <= 9 ) { outtp = '0' +tp; return(outtp); }
                  else { return(tp); }
                  break;
      case "3":   if ( tp <= 9 ) { outtp = '000' +tp; return(outtp); }
                  else {
                     if ( tp <= 99 ) { outtp = '00' +tp; return(outtp); }
                     else {
                        if ( tp <= 999 ) { outtp = '0' +tp; return(outtp); }
                        else { return(tp); }
                     }
                  }
                  break;
      default:    if ( tp <= 9 ) { outtp = '00' +tp; return(outtp); }
                  else {
                     if ( tp <= 99 ) { outtp = '0' +tp; return(outtp); }
                     else { return(tp); }
                  }
                  break;
   }
}

function slide_on()
{
  slon = 1;
  cont = '<a style="font-size: 15px; font-weight: bold; text-decoration: none" href="javascript: slide_off();">Stop slideshow</a>';
  document.getElementById('sl_on_off').innerHTML = cont;
  cont='';
  cont += speed/1000 + ' sec.';
  document.getElementById('sl_shtime').innerHTML = cont;
  cont='';
}

function slide_off()
{
  slon = 0;
  cont = '<a style="font-size: 15px; font-weight: bold; text-decoration: none" href="javascript: slide_on();">Start slideshow</a>';
  document.getElementById('sl_on_off').innerHTML = cont;
  cont='';
  cont += speed/1000 + ' sec.';
  document.getElementById('sl_shtime').innerHTML = cont;
  cont='';
}



function rollTo(which)
{
   document.getElementById(which).scrollIntoView("true");
}

function parseCommandLine()
{
  if (location.href.indexOf("?") == -1)      //	CHECK IF THERE IS A QUESTIONMARK BEHIND THE URL
  {
    fail = 1;                               //	IF NOT - SHOW ERROR AND RETURN
    show_errr();
  }
//	IF YES	Parse any command line arguments
   var urlQuery = location.href.split("?");  // SPLIT THE THE URL WITH ?
                                             // urlQuery[0] CONTAINS THE URL BEFORE THE ?

   ownURLstorer = urlQuery[0]
   if ( ownURLstorer.indexOf("fc2.com") == -1 )
//   if ( ownURLstorer.indexOf("file:///") == -1 )
   {
      elstorer = 1;
   }
   else
   {
      elstorer = 0;
   }

                                             // urlQuery[1] CONTAINS THE URL AFTER THE ?	
   var urlTerms = urlQuery[1].split(",");    // SPLIT urlQuery WITH ,

   if ( urlTerms.length == 2 || urlTerms.length == 4 ) //	IF NOT 2 OR 4 - SHOW ERROR AND RETURN
   {
      if (urlTerms[0] != null)                // 1st ARGUMENT - START PICTURE TO DISPLAY
      {
         comlin1 = parseInt(urlTerms[0]);
      }
      if (urlTerms[1] != null)                  // 2nd ARGUMENT - GALLERY TO DISPLAY
      {
         comlin2 = parseInt(urlTerms[1]);
      }
      if ( isNaN(comlin1) == true || isNaN(comlin2) == true )
      {
         fail = 1;                         // IF ARG 1 OR 2 NOT A NUMBER
      }
      if ( comlin2 == 0 || comlin2 > nview.length-1 )
      {
         fail = 1;                         // IF ARG 2 == 0 OR ARG 2 > ARRAY.length-1
      }

      gallery = comlin2;
      cont="";
      Displ = nview[gallery].split('||');
      if ( Displ[0] == 1 || comlin1 < Displ[4] || comlin1 >= (parseInt(Displ[4])+parseInt(Displ[5])) )
      {
         fail = 1;                         // GALLERY HIDDEN-NOT EXISTING OR IF STARTPIC WRONG
      }
      picno = comlin1;
      min_picno = parseInt(Displ[4]);
      max_picno = (parseInt(Displ[4])+parseInt(Displ[5])) - 1;
      wstorer = Displ[7];                    // STORE OWN WEBSITE
      advstorer = Displ[8];                  // STORE COMPANY TO ADVERTISE

//   CHECK IF A PICTURE LIST IS TO USE
    if ( Displ[1] == "pili://" )	//	USE PICTURE LIST
    {
          pilicou = (comlin1*2) - 2;
    }

      
      if ( urlTerms.length == 4 )            //	READ 3rd AND 4th ARGUMENT
      {
         if (urlTerms[2] != null)            // 3rd ARGUMENT - OWN WEBSITE
         {
            comlin3 = parseInt(urlTerms[2]);
         }
         if (urlTerms[3] != null)            // 4th ARGUMENT - WHICH COMPANY TO ADVERTISE
         {
            comlin4 = parseInt(urlTerms[3]);
         }
         if ( isNaN(comlin3) == true || isNaN(comlin4) == true )
         {
            fail = 1;                     // IF ARG 3 OR 4 NOT A NUMBER
         }
         if ( comlin3 == 0 || comlin3 >  webt.length-1 )
         {
            fail = 1;                     // IF ARG 3 ( OWN WEBSITE ) == 0 OR ARG 3 > ARRAY.length-1
         }
         else                                // CHANGE OWN WEBSITE TO COMMANDLINE VALUE
         {
            wstorer  = comlin3;
         }
         if ( comlin4 == 0 || comlin4 >  adv.length-1 )
         {
            show_errr();                     // IF ARG 4 ( ADVERTISING ) == 0 OR ARG 4 > ARRAY.length-1
            return 0;
         }
         else
         {
            advstorer = comlin4;             // CHANGEE COMPANY TO ADVERTISE
         }
      }
   }
   else
   {
      show_errr();
      return 0;
   }
   if  ( elstorer == 1 )   // MAKE EMPTY LINE IF THE FILE ISN'T STORED AT fc2.com
   {
      mk_first();
   }
   if ( fail == 1 )
   {
      show_errr();
   }
   else
   {
      picno--;                // CORRECT picno FOR FIRST USE OF chg_pic

      chg_pic();              // DISPLAY THE CALLED PICTURE
   }

   if  ( elstorer == 1 )   // MAKE EMPTY LINE IF THE FILE ISN'T STORED AT fc2.com
   {
      mk_last();
   }
}
function mk_ownws()
{
   cont = "";
   cont += '<p style="margin-top: -8px;">' +webs[wstorer]+ '</p>\n';
   display('owdy');
}
function mk_mfooter()
{
   cont = "";

   var part = adv[advstorer][lastno2].split("||");
   if ( part[0] == 0 )
   {
      cont += '<p><a class="picbox" target="_blank" href="' +part[1]+ '"><img style="border: 0;" alt="" src="' +part[2]+ '" onload="javascript:if(this.width>950) { this.width=950; }"/><br />' +part[3]+ '</a></p>\n';
   }
   else
   {
      cont +=  part[1];
   }
   display('mfooter');
}
function mk_madver()
{
   cont = "";
   random_imglink(advstorer)  // GENERATE 3 RANDOM NUMBERS

   var part = adv[advstorer][lastno1].split("||");
   if ( part[0] == 0 )
   {
      cont += '<p><a class="picbox" target="_blank" href="' +part[1]+ '"><img style="border: 0;" alt="" src="' +part[2]+ '" onload="javascript:if(this.width>590) { this.width=590; }"/><br />' +part[3]+ '</a></p>\n';
   }
   else
   {
      cont +=  part[1];
   }
   display('mady');
}
function mk_dllinks()       // THE DOWNLOAD LINKS
{
   var col_DLL = Displ[9]+Displ[10]+Displ[11];
   cont = "";
   
   if ( col_DLL == "   " ) { ; }
   else
   {
      if ( Displ[9] == " " ) { ; }
      else
      {
         if ( Displ[10] == " " )
         {
            cont = '<p><a class="picbox" target="_blank" href="' +Displ[9]+ '">DOWNLOAD THIS GALLERY HERE</a></p>\n';
            if ( wstorer ==  4 || wstorer ==  10 )
            {
               cont += '<p><a class="picbox" target="_blank" href="' +Displ[9]+ '">Die Galerie hier downloaden</a></p>\n';
            }


         }
         else
         {
            cont += '<p><a style="color: #FFFFFF;" class="picbox" href="#" onclick="return false;">DOWNLOAD THIS GALLERY HERE</a></p>\n';
            cont += '<p><a class="picbox" target="_blank" href="' +Displ[9]+ '">PART 1</a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="picbox" target="_blank" href="' +Displ[10]+ '">PART 2</a>';
         }
         if ( Displ[11] == " " )
         {
            if ( wstorer ==  4 || wstorer ==  10 )
            {
               cont += '<p><a class="picbox" target="_blank" href="' +Displ[9]+ '">Die Galerie hier downloaden</a></p>\n';
               cont += '<p><a class="picbox" target="_blank" href="' +Displ[9]+ '">TEIL 1</a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="picbox" target="_blank" href="' +Displ[10]+ '">TEIL 2</a></p>';
            }
            else
            {
               cont += '</p>\n';
            }
         }
         else
         {
            cont += '&nbsp;&nbsp;&nbsp;&nbsp;<a class="picbox" target="_blank" href="' +Displ[11]+ '">PART 3</a></p>\n';
            if ( wstorer ==  4 || wstorer ==  10 )
            {
               cont += '<p><a class="picbox" target="_blank" href="' +Displ[9]+ '">Die Galerie hier downloaden</a></p>\n';
               cont += '<p><a class="picbox" target="_blank" href="' +Displ[9]+ '">TEIL 1</a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="picbox" target="_blank" href="' +Displ[10]+ '">TEIL 2</a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="picbox" target="_blank" href="' +Displ[11]+ '">TEIL 3</a></p>\n';
            }
         }
         display('dllink');
      }
   }
}
function mk_thyomsg()
{
   var col_DLL = Displ[12]+Displ[13]+Displ[14];
   cont = "";

   if ( col_DLL == "   " ) { cont = '&nbsp'; }        // IF COMPLETE EMPTY
   else
   {
      if ( Displ[12] == " " ) { cont = '&nbsp'; }    // IF NO LINK
      else
      {
         cont = '<a class="picbox" style="font-size: 15px;" target="_blank" href="' +Displ[12]+ '">';
         if ( Displ[13] == " " ) { ; } // IF NO PIC
         else                          // WRITE PIC
         {
            cont += '<img alt="Thank you picture" style="border: 0;" src="' +Displ[13]+ '" onload="javascript:if(this.width>298) { this.width=298; }" /><br />';
         }
         if ( Displ[14] == " " )       // IF NO TEXTLINK
         {
            if ( Displ[13] == " " )     // IF ALSO NO PIC CLOSE LINK
            {
               cont += 'A special thank you to ' +Displ[12]+ '</a>';
            }
            else                       // PIC WAS DEFINED CLOSE LINK WITHOUT TEXT
            {
               cont += '</a>';
            }
         }
         else                          // WRITE TEXTLINK AND CLOSE LINK
         {
            cont += Displ[14]+ '</a>';
         }
      }
   }
   display('dllink');
}
function mk_neli()
{
   cont = "&nbsp;";
   if ( Displ[15] == " " ) { ; }   // NO NEXT LINK
   else
   {
      if ( picno == max_picno )
      {
         cont = '<a class="picbox" style="font-size: 15px;" target="_self" href="' +nextLink+ '">Next gallery';
         if ( wstorer == 4 || wstorer == 10 )
         {
            cont += '<br />N&auml;chste Galerie';
         }
         cont += '</a>';
      }
   }
   display('neli');
}
function mk_first()
{
   cont += '<div class="lempty"><a class="picbox" href="javascript:rollTo(' +vmaincont+ ');">Click here or scroll down';
   if ( wstorer ==  4 || wstorer ==  10 )
   {
      cont += '<br />Hier klicken oder nach unten scrollen</h3>\n';
   }
   cont += '</a></div>\n';
   cont += '<div class="rempty"><a class="picbox" href="javascript:rollTo(' +vmaincont+ ');">Click here or scroll down';
   if ( wstorer ==  4 || wstorer ==  10 )
   {
      cont += '<br />Hier klicken oder nach unten scrollen</h3>\n';
   }
   cont += '</a></div>\n';
   cont += '<div class="clb">&nbsp;</div>\n';
   cont += '<div class="lempty"><a class="picbox" href="javascript:rollTo(' +vmaincont+ ');">Click here or scroll down';
   if ( wstorer ==  4 || wstorer ==  10 )
   {
      cont += '<br />Hier klicken oder nach unten scrollen</h3>\n';
   }
   cont += '</a></div>\n';
   cont += '<div class="rempty"><a class="picbox" href="javascript:rollTo(' +vmaincont+ ');">Click here or scroll down';
   if ( wstorer ==  4 || wstorer ==  10 )
   {
      cont += '<br />Hier klicken oder nach unten scrollen</h3>\n';
   }
   cont += '</a></div>\n';
   cont += '<div class="clb">&nbsp;</div>\n';
   display('firstd');
}
function mk_last()
{
   cont += '<div class="dlempty"><a class="picbox" href="javascript:rollTo(' +vmaincont+ ');">Click here or scroll up';
   if ( wstorer ==  4 || wstorer ==  10 )
   {
      cont += '<br />Hier klicken oder nach oben scrollen</h3>\n';
   }
   cont += '</a></div>\n';
   cont += '<div class="drempty"><a class="picbox" href="javascript:rollTo(' +vmaincont+ ');">Click here or scroll up';
   if ( wstorer ==  4 || wstorer ==  10 )
   {
      cont += '<br />Hier klicken oder nach oben scrollen</h3>\n';
   }
   cont += '</a></div>\n';
   cont += '<div class="clb">&nbsp;</div>\n';
   cont += '<div class="dlempty"><a class="picbox" href="javascript:rollTo(' +vmaincont+ ');">Click here or scroll up';
   if ( wstorer ==  4 || wstorer ==  10 )
   {
      cont += '<br />Hier klicken oder nach oben scrollen</h3>\n';
   }
   cont += '</a></div>\n';
   cont += '<div class="drempty"><a class="picbox" href="javascript:rollTo(' +vmaincont+ ');">Click here or scroll up';
   if ( wstorer ==  4 || wstorer ==  10 )
   {
      cont += '<br />Hier klicken oder nach oben scrollen</h3>\n';
   }
   cont += '</a></div>\n';
   cont += '<div class="clb">&nbsp;</div>\n';
   display('lastd');
}
function chgbgcolor(whichLoc,whichColor)
{
  document.getElementById(whichLoc).style.backgroundColor = whichColor;
}
function show_errr()
{
   document.getElementsByTagName('title')[0].text = "Sorry - It seems you are wrong. Please, visit YoungJapan.tk";
   chgbgcolor('mbody','#003A75');
   wstorer = 4;
   mk_first();
   cont = '<h2>Sorry</h2><p>&nbsp;</p><h2>It seems you are on a wrong page.</h2><h3>Es scheint Sie sind auf einer falschen Seite.</h3><p>&nbsp;</p><h2>Please, visit our portal<h2><h3>Bitte besuchen Sie unser Portal</h3><p>&nbsp;</p><h1><a target="_self" href="http://youngjapan.tk">YoungJapan.tk</a></h3><p>&nbsp;</p>\n';
   display('header');
   cont = '<p style="text-align: right; margin-right: 15px; font-size: 11px;">Akina Minami</p><img name="mainp" style="border: 0;" src="http://blog-imgs-19.fc2.com/g/i/r/girlsplanet/akina-minami_nn1.jpg" alt="Akina Minami" onload="javascript:if(this.width>940) {this.width=940;}" />';
   display('picall');
   lili();
   random_imglink(7);
   cont = "";
   var part = adv[7][lastno2].split("||");
   if ( part[0] == 0 )
   {
      cont += '<p><a class="picbox" target="_blank" href="' +part[1]+ '"><img style="border: 0;" alt="" src="' +part[2]+ '" onload="javascript:if(this.width>950) { this.width=950; }"/><br />' +part[3]+ '</a></p>\n';
   }
   else
   {
      cont +=  part[1];
   }
   display('mfooter');
   mk_last();
   rollTo('maincont');
}
function display (which)
{
   document.getElementById(which).innerHTML = cont;
   cont = "";
}
function random_imglink(whichAdv)   // GENERATES 3 ADVERTISINGS FOR A COMPANY
{
   var psel=0;

// CLEAR THE FIFO
   lastno1 = 0;
   lastno2 = 0;
   lastno3 = 0;

// GENERATE 3 RANDOM NUMBERS
   for ( var xx=1; xx<=3; xx++ )
   {
      do {
         psel = Math.floor( Math.random()* adv[whichAdv].length );
      } while ( psel == lastno1 || psel == lastno2 || psel == lastno3 || psel == 0 );

// MAKE THE FIFO
      lastno1 = lastno2;   // remove oldest
      lastno2 = lastno3;
      lastno3 = psel;      // add newest
   }
}
function lili()        // GENERAT LINKLIST
{
   var psel=0;
   var helpme = 0;
   cont = "";
   
   var llastno = new Array(6);
   for ( var xx=0; xx<=6; xx++ )      // CLEAR FIFO
   {
      llastno[xx] = -1;
   }
   for ( var xx=1; xx<=6; xx++ )    // GENERATE 6 RANDOM NUMBERS
   {
      do {
         psel = Math.floor( Math.random()* lilis.length );
      } while ( psel == llastno[1] || psel == llastno[2] || psel == llastno[3] || psel == llastno[4] || psel == llastno[5] || psel == llastno[6] || psel == wstorer || psel == 0 );

// MAKE THE FIFO
      llastno[1] = llastno[2];   // remove oldest
      llastno[2] = llastno[3];
      llastno[3] = llastno[4];
      llastno[4] = llastno[5];
      llastno[5] = llastno[6];
      llastno[6] = psel;      // add newest
   }
   for ( var xx=1; xx<=6; xx++ )    // WRITE 6 DIFFERENT LINKS
   {
      helpme = llastno[xx];
      cont += '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +lilis[helpme];
      if ( xx % 6 == 0 )
      {
         cont += '<br />&nbsp;<br />';
      }
   }
   display('tfooter');
}


