window.adGen = function(i){
  if(!this.init){ this.init = 1; this.adIdx = 0; }
  return "ad" + (i?this.adIdx:++this.adIdx)
} 



window.backgrounds = function(){
  var list = [
    '/images/gray_if1/background1.gif',
    '/images/ic1.gif',
    '/images/ic2.gif',
    '/images/ic3.gif',
    '/images/ic4.gif',
    '/images/ic5.gif',
    ''];
  return list[parseInt(Math.random()*(list.length-1))];
}


window.domains_sale = function(){
  /* start domain search */
  var extensions = ''
    +'COM,INFO,NET,NET.BR,ME,FR,ORG,BIZ,COM.CO,NET.CO,'
    +'NOM.CO,IT,COM.BR,MOBI,MX,COM.ES,WS,US,NOM.ES,ES,ORG.ES,'
    +'CA,NL,ASIA,IN,COM.MX,AM,AT,BE,BZ,COM.BZ,CC,NET.BZ,DE,'
    +'EU,FM,GS,CO.IN,FIRM.IN,GEN.IN,IND.IN,NET.IN,ORG.IN,'
    +'JOBS,JP,MS,NU,CO.NZ,NET.NZ,ORG.NZ,TC,TK,TV,TW,COM.TW,'
    +'ORG.TW,IDV.TW,CO.UK,ME.UK,ORG.UK,VG'

  var html = ''
    +'<div id="domain_search" style="margin:0; padding:0;">'
    +'<form style="margin:0; padding:0;" method="post" '
    +' action="https://www.securepaynet.net/gdshop/registrar/search.asp?se=%2B&prog%5Fid=hosting411&from=rhp" '
    +' id="form1" name="form1" target="_blank"> '
    +'<table cellspacing="0" cellpadding="5" style="border:1px #eee solid; background:#cdd; white-space:nowrap;">'
    +'  <tr><td style="color:#000; border-right:1px #000 dotted; font-weight:bold;">'
    +'    DOMAIN&nbsp;NAME&nbsp;DEALS'
    +'  </td><td width="100%" style="color:#000; padding-left:10px;" nowrap>'
//    +'    <input type="hidden" name="checkAvail" value="1"> '
//    +'    <input type="hidden" name="JScriptOn" value="yes"> '
//    +'    <input type="hidden" name="submit1" value="Submit"> '
//    +'    <u>w</u>ww<b style="font-size:125%;color:#000;">.</b>'
//    +'    <input type="text" name="domainToCheck" maxlength="63" accesskey="w" style="border:1px #ccc solid;">'
//    +'    <b style="font-size:125%;color:#000;">.</b><select name="TLD"> '

//  var ext = extensions.split(/,/);
//  for(var i=0; i<ext.length; i++){
//    html += ''
//    +'<option value=".'+ext[i].toUpperCase()+'">'+ext[i].toLowerCase()
//  }

//  html += ''
//    +'    </select> '
//    +'    <input type="button" value="Price/Availability" id="submit1" name="spoof" onclick="this.form.submit()"> '
    +'    <input type="submit" value="Price/Availability"> '
    +'  </td>'
    +'</tr></table>'
    +'</form>'
    +'</div>'
  
  return (html)
}



window.header = function(){
  var html = ''

  html+='<link rel="stylesheet" type="text/css" href="template/template1.css">'

  +'<style></style>'
  +'<a name="start"></a>'

  +'<table width="100%" cellpadding="10" cellspacing="0" class="mainheading" style="position:fixed;height:20px;top:0px;">'
  +'  <tr>'
  +'    <td width="100%" nowrap>'

  +domains_sale()

  +'    </td><td width="380" nowrap>'

//  +'      <!-- Search Google -->'
//  +'      <form style="display:inline;" action="http://www.esqsoft.com/javascript/search-results.htm" id="cse-search-box">'
//  +'      <div>'
//  +'        <input type="hidden" name="cx" value="partner-pub-1157892973816149:hfy1pm-l4em" />'
//  +'        <input type="hidden" name="cof" value="FORID:11" />'
//  +'        <input type="hidden" name="ie" value="ISO-8859-1" />'
//  +'        <input type="text" name="q" size="33" />'
//  +'        <input type="submit" name="sa" value="Search" />'
//  +'      </div>'
//  +'    </form>'
//  +'    <sc'+'ript type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en"></sc'+'ript>'
//  +'      <!-- Search Google -->'

  +'    </td>'
  +'  </tr>'
  +'</table>'

  html += ''
  +'<table width="100%" cellspacing="0" cellpadding="0" style="height:100%;">'
  +'  <tr valign="top">'
  +'    <td class="mleft" align="center" style="padding:65px 15px 15px 15px;">'

  +'      <!-- start: left column -->'
//  +'      <div style="margin:10px;padding-top:30px;"><iframe id="a01e9d17" name="a01e9d17" src="http://hostagnostic.com/openads/adframe.php?n=a01e9d17&amp;clientid=3&amp;target=_blank" framespacing="0" frameborder="no" scrolling="no" width="120" height="240" allowtransparency="true"><a href="http://hostagnostic.com/openads/adclick.php?n=a01e9d17" target="_blank"><img src="http://hostagnostic.com/openads/adview.php?clientid=3&amp;n=a01e9d17" border="0" alt=""></a></iframe></div>'
//  +'      <div style="margin:10px;padding-top:30px;"><iframe id="ac39e60b" name="ac39e60b" src="http://hostagnostic.com/openads/adframe.php?n=ac39e60b&amp;clientid=4&amp;target=_blank" framespacing="0" frameborder="no" scrolling="no" width="120" height="60" allowtransparency="true"><a href="http://hostagnostic.com/openads/adclick.php?n=ac39e60b" target="_blank"><img src="http://hostagnostic.com/openads/adview.php?clientid=4&amp;n=ac39e60b" border="0" alt=""></a></iframe></div>'
//  +'      <div style="margin:10px;padding-top:30px;"><iframe id="aa424d13" name="aa424d13" src="http://hostagnostic.com/openads/adframe.php?n=aa424d13&amp;clientid=5&amp;target=_blank" framespacing="0" frameborder="no" scrolling="no" width="120" height="600" allowtransparency="true"><a href="http://hostagnostic.com/openads/adclick.php?n=aa424d13" target="_blank"><img src="http://hostagnostic.com/openads/adview.php?clientid=5&amp;n=aa424d13" border="0" alt=""></a></iframe></div>'

  +'<iframe id="3a0b38f74" name="a0b38f74" src="http://hostagnostic.com/openads/adframe.php?n=a0b38f74&amp;clientid=16&amp;target=_blank" framespacing="0" frameborder="no" scrolling="no" width="160" height="600" allowtransparency="true"><a href="http://hostagnostic.com/openads/adclick.php?n=a0b38f74" target="_blank"><img src="http://hostagnostic.com/openads/adview.php?clientid=16&amp;n=a0b38f74" border="0" alt=""></a></iframe>'

//  +'      <p><a href="http://'+(location.host||'linkscentral.8k.com')+'"><img src="http://esqsoft.com/ads/promote_website_88x31.gif" alt="promote your website free" width="88" height="33" border="0"></a>'

  if(location.host) html += ''
  +'      <!-- Start of StatCounter Code -->'
  +'      <sc'+'ript type="text/javascript" language="javascript">'
  +'      var sc_project=415686; '
  +'      var sc_partition=2; '
  +'      </sc'+'ript>'
  +'      <sc'+'ript type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></sc'+'ript>'
  +'      <!-- End of StatCounter Code -->'

  html += ''
  +'      <!-- end: left column -->'

  +'    </td>'
  +'    <td width="100%" class="mtable" style="padding-top:65px;">'

  +'      <!-- start: main column -->'
  +'      <img src="/fs_img/spacer.gif" width="750" height="1" style="visibility:hidden;">'

  return html
}


window.footer = function(isml){
  var html = ''
  +'    <!-- end: main column -->'
  +'    </td>'
  +'  </tr>'
  +'</table>'

  +'<!-- start: heading template -->'
  +'<div id="ivn_heading_template" style="display:none">'
  +'<table class="heading" width="100%" cellspacing="0" cellpadding="0">'
  +'  <tr>'
  +'    <td width="1"><a href=""><img src="images/gray_if1/arrow_green_right.gif" '
  +'    border="0" style="position:relative; top:-9px; margin-bottom:-20px; z-index: 99; filter: alpha(opacity=80);"'
  +'    ></a></td>'
  +'    <td width="100%" nowrap="1">__HEADING__</td>'
  +'    <td class="stat" nowrap="1">__LOADING__</td>'
  +'    </td>'
  +'  </tr>'
  +'</table>'
  +'</div>'
  +'<!-- end: heading template -->'
  +'<sc'+'ript src="images/gray_if1/ivans_headings.js"></sc'+'ript>'

  /* use random background */
    var bk = window.backgrounds(); if(!location.host) bk=bk.replace(/^\//,'');
    var obj = document.getElementsByTagName('body')[0]
    obj.style.backgroundImage = 'url("'+bk+'")';

  return html
}

window.makeBnnr = function(s) {
  /* trying to get around validation issue with attributes supported in older browsers but not a part of the dtd... not sure if this is good or bad karma--but visitors needs mean more than stuffy standards :-( */
  var html = ''
  switch(s){
  case '728X90':
    html = "<iframe id='a574d399' name='a574d399' src='http://hostagnostic.com/openads/adframe.php?n=a574d399&amp;clientid=6&amp;target=_blank' framespacing='0' frameborder='no' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://hostagnostic.com/openads/adclick.php?n=a574d399' target='_blank'><img src='http://hostagnostic.com/openads/adview.php?clientid=6&amp;n=a574d399' border='0' alt=''></a></iframe>"
    break;
  case '300X250':
    html = "<iframe id='a36c6698' name='a36c6698' src='http://hostagnostic.com/openads/adframe.php?n=a36c6698&amp;clientid=8&amp;target=_blank' framespacing='0' frameborder='no' scrolling='no' width='300' height='250' allowtransparency='true'><a href='http://hostagnostic.com/openads/adclick.php?n=a36c6698' target='_blank'><img src='http://hostagnostic.com/openads/adview.php?clientid=8&amp;n=a36c6698' border='0' alt=''></a></iframe>"
    break;
  case '468X60':
    html = ''
//    +'<!-- adsense -->'
//    +'<sc'+'ript type="text/javascript">'
//    +'google_ad_client = "pub-1157892973816149";'
//    +'google_ad_width = 468;'
//    +'google_ad_height = 60;'
//    +'google_ad_format = "468x60_as_rimg";'
//    +'google_cpa_choice = "CAAQq8WdzgEaCCQIMpsWzihvKNvD93M";'
//    +'</sc'+'ript>'
//    +'<sc'+'ript type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">'
//    +'</sc'+'ript>'
    break;
  }
  return html;
}

