var AdBrite_Title_Color = '0000FF';
var AdBrite_Text_Color = '000000';
var AdBrite_Background_Color = 'FFFFCC';
var AdBrite_Border_Color = 'CCCCCC';
var AdBrite_URL_Color = '008000';

function info()
{
  document.write("<H5><I>SexyDesktop</i> does not host images, it provides categorised links to content on external sites found through Google Images, celebrity forums, other wallpaper sites or submitted by visitors and is not responsible for the content of those sites or the adverts that appear on them. Links open in a new window. SexyDesktop does not include any topless or nude images.</H5>");
}

function nav(pagecount, thispage, celebid)
{

  if (pagecount == 1) return;

  document.write("<TABLE cellpadding=4 width=\'100%\' bgcolor=\'#FFFFCC\'><TR><TD>");

  document.write("</b>This is <b> Pg " + thispage + "</b> ");

  if (thispage != 1) {
    document.write("<a href=\'./" + celebid);
    if ((thispage - 1) != 1) document.write("-" + (thispage - 1));
    document.write(".htm\'> <b>&lt;Prev</b> </a>");
  }

  if (thispage != pagecount) document.write("<a href=\'./" + celebid + "-" + (thispage + 1) + ".htm\'> <b>Next&gt;</b> </a>");
  document.write(" Go to: <font size=1>");

  max = 0;
  startpg = 1;
  navtext = "";
  if (pagecount > 15) startpg = thispage - 6;
  if (startpg < 1) startpg = 1;
  if ((startpg + 15) > pagecount) startpg = pagecount - 15;

  for (u=1;u<=pagecount;u++)
  {
    if (u != thispage) {
      navtext = navtext + "<a href=\'./" + celebid;
      if (u != 1) navtext = navtext  + "-" + u;
      navtext = navtext + ".htm\'> <b>" + u + "</b> </a>|";
      max++;
    }
    if ((max == 15) && (u != (pagecount - 1)) && (u != pagecount)) {
      navtext = navtext.substr(0, navtext.length - 1) + " ... ";
      u = pagecount - 1;
    }
    if ((u == 1) && (startpg > 1)) {
      navtext = navtext.substr(0, navtext.length - 1) + " ... ";
      u = startpg;
    }
  }

  if (navtext.substr(navtext.length - 1, 1) == "|") navtext = navtext.substr(0, navtext.length - 1);
  document.write(navtext);
  document.write("</font></td></tr></table>");
}

function showrelevant(divnum, whichres)
{
  if (whichres == 0) {
    document.getElementById('norm' + divnum).style.visibility = 'visible';
    document.getElementById('wide' + divnum).style.visibility = 'hidden';
    }
   else {
    document.getElementById('norm' + divnum).style.visibility = 'hidden';
    document.getElementById('wide' + divnum).style.visibility = 'visible';
  }
}

function socials(sitepage, celebname)
{
  document.write("<a href=\'http://del.icio.us/post?url=http://www.sexydesktop.co.uk/" + sitepage + ".htm&title=" + celebname + " at SexyDesktop\' target=\'_new\'>Bookmark with Delicious</a><br>");
  document.write("<a href=\'http://digg.com/submit?url=http://www.sexydesktop.co.uk/" + sitepage + ".htm&title=" + celebname + " at SexyDesktop\' target=\'_new\'>Bookmark with Digg</a><br>");
  document.write("<a href=\'http://reddit.com/submit?url=http://www.sexydesktop.co.uk/" + sitepage + ".htm&title=" + celebname + " at SexyDesktop' target='_new'>Bookmark with Reddit</a><br>");
  document.write("<a href=\'http://www.facebook.com/sharer.php?u=http://www.sexydesktop.co.uk/" + sitepage + ".htm\' target=\'_new\'>Bookmark with Facebook</a><br>");
  document.write("<a href=\'http://www.stumbleupon.com/submit?url=http://www.sexydesktop.co.uk/" + sitepage + ".htm&title=" + celebname + " at SexyDesktop\' target=\'_new\'>Bookmark with StumbleUpon</a><br>");
}

function checkout()
{
  for (x in co)
  {
    co[x][1] = co[x][1].replace(/@iv/, '.imagevenue.com/loc');
    document.write("<table height=144 cellspacing=0 cellpadding=4>");
    document.write("<tr onMouseOver=\"this.className=\'hi\'\" onMouseOut=\"this.className=\'norm\'\">");
    document.write("<td width=164 align=\'center\' valign=\'top\'>");
    document.write("<a href=\'" + co[x][0] + ".htm\'>");
    document.write("<img border=0 width=160 height=120 src=\'http://img" + co[x][1] + "lo.jpg\'><BR>");
    document.write(co[x][2] + "</a></td></tr></table><BR>");
  }
}

function thumbs(celebid)
{
  newrow = 0 
  thumbsperrow = 2;
  document.write("<table width='100%'>");

  // Figure out if the screen is widescreen; if so, show widescreen thumbs as default;
  defnormal = 'visible';
  defwide = 'hidden';
  if ((screen.width / screen.height) >= 1.6) {
    defnormal = 'hidden';
    defwide = 'visible';
  }

  for (x in l)
  {
    for (y=0;y<=6;y++)
    {
      if (l[x][y] != undefined) l[x][y] = l[x][y].replace(/@iv/, '.imagevenue.com');
    }
    for (y=0;y<=6;y++)
    {
      if (l[x][y] != undefined) l[x][y] = l[x][y].replace(/@id/, '_' + celebid);
    }
    if (newrow == 0) {
      document.write("<tr>");
    }

    document.write("<td align='center' valign='top'>");
    document.write("<table height=154 cellspacing=0 cellpadding=4>");
    document.write("<tr onMouseOver=\"this.className=\'hi\'\" onMouseOut=\"this.className=\'norm\'\">");
    document.write("<td width=160 align=\'center\' valign=\'top\'>");

    if (l[x][0] == "skins") {
      if (l[x][1] == "") {
        document.write("<a href=\'http://www.skins.be\'>");
        document.write("<img border=0 width=160 height=120 src=\'../thumbs-@/1.jpg\'>");
        document.write("<br>Skins.be : Hot model and celebrity wallpapers for your desktop</a><br><br>");
        document.write("<a href=\'http://de.skins.be\'><img src=\'http://img.skins.be/img/flags/de.gif\' border=0></a> ");
        document.write("<a href=\'http://www.skins.be\'><img src=\'http://img.skins.be/img/flags/us_uk.gif\' border=0></a> ");
        document.write("<a href=\'http://es.skins.be\'><img src=\'http://img.skins.be/img/flags/es.gif\' border=0></a> ");
        document.write("<a href=\'http://nl.skins.be\'><img src=\'http://img.skins.be/img/flags/nl.gif\' border=0></a>"); }
       else {
        document.write("<a href=\'http://www.skins.be/" + l[x][1] + "\'>");
        document.write("<img border=0 width=160 height=120 src=\'../thumbs-@/1.jpg\'>");
        document.write("<br>" + l[x][3] + " wallpapers for " + l[x][2] + " at Skins.be</a><br><br>");
        document.write("<a href=\'http://de.skins.be/" + l[x][1] + "\'><img src=\'http://img.skins.be/img/flags/de.gif\' border=0></a> ");
        document.write("<a href=\'http://www.skins.be/" + l[x][1] + "\'><img src=\'http://img.skins.be/img/flags/us_uk.gif\' border=0></a> ");
        document.write("<a href=\'http://es.skins.be/" + l[x][1] + "\'><img src=\'http://img.skins.be/img/flags/es.gif\' border=0></a> ");
        document.write("<a href=\'http://nl.skins.be/" + l[x][1] + "\'><img src=\'http://img.skins.be/img/flags/nl.gif\' border=0></a>"); }
      }

     else {

      if (l[x][6] != undefined) {
        document.write("<a href=\'" + l[x][0] + "\'>");
        document.write("<img border=0 width=160 height=120 src=\'http://img" + l[x][2] + "lo.jpg\'>");
        document.write("<BR><B>Check out<BR>" + l[x][6] + "</b></a>");
        }
       else {
        if (l[x][4].substr(1,1) == "Z") l[x][5] = "1920x1200";
        if (l[x][4].substr(1,1) == "Y") l[x][5] = "1680x1050";
        if (l[x][4].substr(1,1) == "X") l[x][5] = "1440x900";
        if (l[x][4].substr(1,1) == "W") l[x][5] = "1280x800"; 

        if (l[x][4].substr(1,1) == " ") {
          document.write("<div id=\'norm" + x + "\' style=\'visibility: visible; position: absolute;\'>");
          l[x][1] = "";
          }
         else {
          document.write("<div id=\'norm" + x + "\' style=\'visibility: " + defnormal + "; position: absolute;\'>");
        }

        if (l[x][4].substr(0,1) == "Z") l[x][4] = "1920x1440";
        if (l[x][4].substr(0,1) == "Y") l[x][4] = "1600x1200";
        if (l[x][4].substr(0,1) == "X") l[x][4] = "1280x960";
        if (l[x][4].substr(0,1) == "W") l[x][4] = "1152x864"; 
        if (l[x][4].substr(0,1) == "V") l[x][4] = "1024x768";

        document.write("<a target='_new' href=\'http://img" + l[x][0] + "lo.jpg\'>");
        document.write("<img border=0 style=\'border-top: 1px solid gray; border-left: 1px solid gray; border-right: 1px solid black; border-bottom: 1px solid black;\' alt=\'" + l[x][4] + "\' src=\'http://img" + l[x][2] + "lo.jpg\'></a></div>");
        if (l[x][1] != "") {
          document.write("<div id=\'wide" + x + "\' style=\'visibility: " + defwide + "; position: absolute;\'>");
          document.write("<a target='_new' href=\'http://img" + l[x][1] + "lo.jpg\'>");
          document.write("<img border=0 style=\'border-top: 1px solid gray; border-left: 1px solid gray; border-right: 1px solid black; border-bottom: 1px solid black;\' alt=\'" + l[x][5] + "\' src=\'http://img" + l[x][3] + "lo.jpg\'></a></div>");
        }
        document.write("<div style=\'font-size:0;height:126px;\'></div>");
        if (l[x][1] == "") {
          document.write("<a target='_new' href=\'http://img" + l[x][0] + "lo.jpg\'>Standard</a>"); }
         else { 
          document.write("<a target='_new' href=\'http://img" + l[x][0] + "lo.jpg\' onMouseOver=\"showrelevant(\'" + x + "\', 0);\">Standard</a>");
          document.write(" | <a target='_new' href=\'http://img" + l[x][1] + "lo.jpg\' onMouseOver=\"showrelevant(\'" + x + "\', 1);\">Widescreen</a>");
        }
      }
    }

    document.write("</td></tr></table>");

    document.write("</td>");
    newrow = newrow + 1;
    if (newrow == thumbsperrow) {
      document.write("</tr>");
      newrow = 0;
    }

  }

  document.write("</table></center>");

}
