function doBodyOnLoad () {
  if ( isInKJFrame() == false ) {
     return;
  }

  try {
     top.document.title= document.title;

     var obj = document.getElementById('masthead');
     obj.style.visibility = "hidden";
     obj.style.display = "none";

     obj = document.getElementById('Top1');
     obj.style.visibility = "hidden";
     obj.style.display = "none";

     obj = document.getElementById('Top2');
     obj.style.visibility = "hidden";
     obj.style.display = "none";

     obj = document.getElementById('menu6');
     obj.style.visibility = "visible";

     obj = document.getElementById('pageWrapper');
     obj.style.margin= "0"
  } catch (ex) {}
}
function doBodyBegin () {
}
function doBodyEnd () {
document.writeln('<!-- Kontera ContentLink(TM);-->');
document.writeln('<script type="text/javascript">');
document.writeln('var dc_AdLinkColor = "blue" ;');
document.writeln('var dc_UnitID = 14 ;');
document.writeln('var dc_PublisherID = 40162 ;');
document.writeln('var dc_adprod = "ADL" ;');
document.writeln('</script>');
document.writeln('<script type="text/javascript" src="http://kona.kontera.com/javascript/lib/KonaLibInline.js">');
document.writeln('</script>');
document.writeln('<!-- Kontera ContentLink(TM) -->');
document.writeln('<script type="text/javascript" src="http://tcr.tynt.com/javascripts/Tracer.js?user=cl1vHAqkGr3RzQab7jrHcU&s=50"></script>');
}
function doPageHeading () {
}

function doFooter () {
  document.writeln('&copy; 2002-2006, KickJava.com.');

  return;

  document.write("<img height=0 width=0 border=0 src=\"http://w0.extreme-dm.com/0.gif?tag=kickjava&j=n\"/>");
  document.write("<img height=0 width=0 border=0 src=\"http://gostats.com/gogi/count.pl?mn=kickjava&pg=multiple\"/>");
}

function doTop11 () {
  if ( isInKJFrame() ) {
     return;
  }

  //if (top.location.href.toLowerCase().indexOf("books") > 0 ) {
  //  return false;
  //}

  document.writeln('<script type="text/javascript"><!--');
  document.writeln('google_ad_client = "pub-3815439110720945";');
  document.writeln('google_alternate_ad_url = "http://2020ok.com/cmn/adbrite.html";');
//  document.writeln('google_alternate_color = "FFFFFF";');
  document.writeln('google_ad_width = 336;');
  document.writeln('google_ad_height = 280;');
  document.writeln('google_ad_format = "336x280_as";');
  document.writeln('google_ad_type = "text_image";');
  document.writeln('google_ad_channel ="7912509089";');
  document.writeln('google_color_border = "FFFFFF";');
  document.writeln('google_color_bg = "FFFFFF";');
  document.writeln('google_color_link = "003399";');
  document.writeln('google_color_text = "000000";');
  document.writeln('google_color_url = "000000";');
  document.writeln('//--></script>');
  document.writeln('<script type="text/javascript"');
  document.writeln('  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">');
  document.writeln('</script>');
}
function doTop12 () {
  if ( isInKJFrame() ) {
     return;
  }

  //if (top.location.href.toLowerCase().indexOf("books") > 0 ) {
  //  return false;
  //}

  document.writeln('<script type="text/javascript"><!--');
  document.writeln('google_ad_client = "pub-3815439110720945";');
  document.writeln('google_alternate_ad_url = "http://2020ok.com/cmn/adbrite.html";');
//  document.writeln('google_alternate_color = "FFFFFF";');
  document.writeln('google_ad_width = 336;');
  document.writeln('google_ad_height = 280;');
  document.writeln('google_ad_format = "336x280_as";');
  document.writeln('google_ad_type = "text_image";');
  document.writeln('google_ad_channel ="7912509089";');
  document.writeln('google_color_border = "FFFFFF";');
  document.writeln('google_color_bg = "FFFFFF";');
  document.writeln('google_color_link = "003399";');
  document.writeln('google_color_text = "000000";');
  document.writeln('google_color_url = "000000";');
  document.writeln('//--></script>');
  document.writeln('<script type="text/javascript"');
  document.writeln('  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">');
  document.writeln('</script>');
}
function doTop21 () {
}
function doTop22 () {
}
function doBottom10 () {
}
function doBottom11 () {
}
function doBottom12 () {
}
function doBottom13 () {
}
function doBottom14 () {
}
function doBottom15 () {
}
function doBottom16 () {
}
function doBottom17 () {
}
function doBottom18 () {
}
function doBottom19 () {
}
function doBottom20 () {
}
function doBottom21 () {
}
function doBottom22 () {
}
function doBottom23 () {
}
function doBottom24 () {
}
function doBottom25 () {
}
function doBottom26 () {
}
function doBottom27 () {
}
function doBottom28 () {
}
function doBottom29 () {
    if (top.location.href.toLowerCase().indexOf("/books/") > 0 ) {
    	document.writeln('<DIV STYLE="visibility:hidden;width:0;height:0"><IFRAME SRC="http://2020ok.com/cmn/okStats.php?' + top.location.href.toLowerCase() + '" WIDTH=0 HEIGHT=0></IFRAME></DIV>');
    }
}

function doContentColumn1 () {
//  document.writeln("<iframe src='http://digg.com/api/diggthis.php?u=http://digg.com/linux_unix/5000_Free_Linux_Computer_Programming_books_by_Tag_Cloud' height='100' width='80' frameborder='0' scrolling='no'></iframe>");
}
function doContentColumn2 () {
  document.writeln('<script type="text/javascript"><!--');
  document.writeln('google_ad_client = "pub-3815439110720945";');
  document.writeln('google_alternate_color = "FFFFFF";');
  document.writeln('google_ad_width = 468;');
  document.writeln('google_ad_height = 15;');
  document.writeln('google_ad_format = "468x15_0ads_al";');
  document.writeln('google_ad_channel ="7390865129";');
  document.writeln('google_color_border = "FFFFFF";');
  document.writeln('google_color_bg = "FFFFFF";');
  document.writeln('google_color_link = "003399";');
  document.writeln('google_color_text = "000000";');
  document.writeln('google_color_url = "000000";');
  document.writeln('//--></script>');
  document.writeln('<script type="text/javascript"');
  document.writeln('  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">');
  document.writeln('</script>');
}
function doContentColumn3 () {
document.writeln('<script type="text/javascript">');
document.writeln('<!-- ');
document.writeln('microsoft_adunitid="1841"; ');
document.writeln('microsoft_adunit_width="600"; ');
document.writeln('microsoft_adunit_height="250";  ');
document.writeln('microsoft_adunit_legacy="true";//--> ');
document.writeln('</script> ');
document.writeln('<script type="text/javascript" src="http://adsyndication.msn.com/delivery/getads.js" ></script>');
}
function doContentColumn4 () {
}
function doContentColumn5 () {
}

function doRightColumn1 () {
//  document.writeln('<A href="/cmn/hosting.html" target="_top">Live Reports on Hosting Companies</A>&nbsp;&nbsp;');
}
function doRightColumn2 () {
  document.writeln('<A href="http://2020ok.com/5.htm" target="_top">Free Books</A>&nbsp;&nbsp;');
  document.writeln('<A href="http://expert-talk.com/tips/376/women-and-bad-boys-what-is-the-attraction-291376.htm">Women &amp; Bad Boys</A>&nbsp;&nbsp;');
  document.writeln('<A href="http://expert-talk.com/tips/568/downloading-mp3-39s-made-easy-201568.htm">Downloading MP3</A>&nbsp;&nbsp;');  
  document.writeln('<A href="http://expert-talk.com/tips/376/how-video-can-be-used-effectively-online-236376.htm">Online Video</A>&nbsp;&nbsp;');  
  document.writeln('<A href="http://2020ok.com/200_Amazing_FREE_Magazines">Free Magazines</A>&nbsp;&nbsp;');
  document.writeln('<A href="http://expert-talk.com/tips/222/dating-advice-love-shouldn-39t-hurt-237222.htm">Dating</A>&nbsp;&nbsp;');  
  document.writeln('<A href="http://expert-talk.com/tips/968/internet-chat-rooms-are-we-missign-the-point-201968.htm">Chat Rooms</A>&nbsp;&nbsp;');  
  document.writeln('<a href="http://121wow.com" target="_top"><img src="http://121wow.com/121wow_long.gif" alt="121 WOW!" border=0></img></a>');
  document.writeln('<script type="text/javascript"><!--');
  document.writeln('google_ad_client = "pub-3815439110720945";');
  document.writeln('google_alternate_ad_url = "http://2020ok.com/cmn/adbrite.html";');
//  document.writeln('google_alternate_color = "FFFFFF";');
  document.writeln('google_ad_width = 336;');
  document.writeln('google_ad_height = 280;');
  document.writeln('google_ad_format = "336x280_as";');
  document.writeln('google_ad_type = "text_image";');
  document.writeln('google_ad_channel ="4071836146";');
  document.writeln('google_color_border = "FFFFFF";');
  document.writeln('google_color_bg = "FFFFFF";');
  document.writeln('google_color_link = "003399";');
  document.writeln('google_color_text = "000000";');
  document.writeln('google_color_url = "000000";');
  document.writeln('//--></script>');
  document.writeln('<script type="text/javascript"');
  document.writeln('  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">');
  document.writeln('</script>');
}

function doRightColumn3 () {
}
function doRightColumn4 () {
  document.writeln('<script type="text/javascript"><!--');
  document.writeln('  amazon_ad_tag = "kickjava-20";  amazon_ad_width = "300";  amazon_ad_height = "250";  amazon_color_link = "003399";  amazon_color_price = "000000";  amazon_color_logo = "FFFFFF";  amazon_ad_logo = "hide";  amazon_ad_border = "hide";');
  document.writeln('//--></script>');
  document.writeln('<script type="text/javascript" src="http://www.assoc-amazon.com/s/ads.js"></script>  ');

//  document.writeln('<iframe src="http://rcm.amazon.com/e/cm?t=kickjava-20&o=1&p=20&l=qs1&f=ifr" width="300" height="90" frameborder="0" scrolling="no"></iframe>   ');
}
function doRightColumn5 () {
}


function removeFrame() {
  if (window.location.href != window.top.location.href) {
     window.top.location.replace(window.location.href);
  }
}

function searchExample(className, methodName) {
  var url = 'http://kickjava.com/cmn/googlesearch.html?cx=016019849777797803616%3Asbkqcucs8tc&cof=FORID%3A9&q=' + className + '%2B'+ methodName;
  window.top.location.replace(url);
}


function isInKJFrame() {
  try {
    if (top.location.href.toLowerCase().indexOf("kickjava") < 0 ) {
      return false;
    }

  if (top.frames.length == 0) {
    return false;
  }

  if (top.window == this.window) {
    return false;
  }

  return true;

  } catch (ex) {
    return false;
  }
}


function openPopup(contents) {
 var divWindow = document.getElementById('divWindow');
 divWindow.innerHTML = contents;

  if (isInKJFrame()) {
     divWindow.style.left = 0 + 'px';
     divWindow.style.top =  0 + 'px';
  }
  else {
     divWindow.style.left = 200 + 'px';
     divWindow.style.top =  190 + 'px';
  }


 window.scroll(divWindow.style.left, divWindow.style.top);

 divWindow.style.visibility = "visible";
 divWindow.style.display = "block";
}

function closePopup() {
   var divWindow = document.getElementById('divWindow');
   divWindow.innerHTML = '';
   divWindow.style.visibility = "hidden";
   return false;
}


function submitCode(aID,pType,aName, kjClass) {
 var pcName1=kjClass.replace(/\//g, ".");
 var aName1='<B>' + aName.replace(/\(/, "</B>(") + '</B>';

 openPopup(
  '<div style="background-color: #FDFFCA; border-width: 2px;  border-style: solid; border-color: #ffcc33;">' +
  '<br>' +
  '<FORM NAME="frmCode" action=/cmn/submit.php method="post">'+
  '<INPUT TYPE=hidden NAME="aID" VALUE="'+aID+'">' +
  '<INPUT TYPE=hidden NAME="aName" VALUE="'+aName1+'">' +
   aName1+' of '+pcName1+'<HR>' +
  'Your name or email here (optional):<BR>' +
  '<input TYPE=text NAME="tAuthor" VALUE="" size=70><BR>' +
  'Title of your submission: <BR>' +
  '<input TYPE=text NAME="tTitle" VALUE="" size=70><BR>' +
  'Type or paste your code snippet or comments here:<BR>' +
  '<TEXTAREA NAME="tCODE" ROWS=12 COLS=70 WRAP=OFF style="font-family: Courier; font-size: 12px;"></TEXTAREA> <BR> <BR>' +
  '<INPUT TYPE=BUTTON NAME="Submit Code" VALUE="SUBMIT" onclick="return submitDone();">' +
  '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
  '<INPUT TYPE=BUTTON NAME="Cancel" VALUE="Cancel" onclick="return closePopup();">' +
  '</FORM>' +
  '</div>'
  );

 return false;
}

function submitDone() {
   document.frmCode.submit();
   openPopup(
  '<div style="background-color: #FDFFCA; border-width: 2px;  border-style: solid; border-color: #ffcc33;">' +
   '<br/>' +
   'Thank you for sharing your code with your community. <br/>' +
   'Your code will be published within 24 hours.<br/><br/>' +
  '<INPUT TYPE=BUTTON NAME="Close" VALUE="Close" onclick="return closePopup();">' +
  '</div>'
  );

   return false;
}


function rateCode(aID, tID,pType,aName, kjClass) {

 var pcName1=kjClass.replace(/\//g, ".");
 var aName1='<B>' + aName.replace(/\(/, "</B>(") + '</B>';
 var anchorDIV = aID;

  openPopup(
  '<div style="background-color: #FDFFCA"; border-width: 2px;  border-style: solid; border-color: #ffcc33;>' +
  '<br>' +
  aName1+' of '+pcName1+'<HR>' +
  '<form name="frmRate" method="post" action=/cmn/rate.php>' +
  '<input type="hidden" name="tID" value="' + tID + '">' +
  '<table width="100%" cellpadding="1" cellspacing="0" border="0">' +
  '  <tr>' +
  '    <td align="center" valign="middle" bgcolor="#00594B">' +
  '  <table width="100%" cellpadding="3" cellspacing="0" border="0">' +
  '    <tr>' +
  '      <td bgcolor="#00594B" colspan="7"><b><font color="white">Rate This Code Snippet</font></b></td>' +
  '    </tr>' +
  '    <tr bgcolor="FFFFEE">' +
  '      <td bgcolor="FFFFEE" align="center"><b>Not at all useful</b></td>' +
  '      <td bgcolor="FFFFEE"><input type="radio" name="tRate" value="1" onclick="return rateDone();">&nbsp;<b>1</b></td>' +
  '      <td bgcolor="FFFFEE"><input type="radio" name="tRate" value="2" onclick="return rateDone();">&nbsp;<b>2</b></td>' +
  '      <td bgcolor="FFFFEE"><input type="radio" name="tRate" value="3" onclick="return rateDone();">&nbsp;<b>3</b></td>' +
  '      <td bgcolor="FFFFEE"><input type="radio" name="tRate" value="4" onclick="return rateDone();">&nbsp;<b>4</b></td>' +
  '      <td bgcolor="FFFFEE"><input type="radio" name="tRate" value="5" onclick="return rateDone();">&nbsp;<b>5</b></td>' +
  '      <td bgcolor="FFFFEE" align="center"><b>Extremely useful</b></td>' +
  '    </tr>' +
  '  </table>' +
  '</table>' +
  '</form>' +
  '<INPUT TYPE=BUTTON NAME="Cancel" VALUE="Cancel" onclick="return closePopup();">' +
  '</div>'
  );


 return false;

}

function rateDone() {
   document.frmRate.submit();
   closePopup();
   return false;
}

function openBook(bookID) {
   var divWindow = document.getElementById('divWindow');
   divWindow.innerHTML = '<IFRAME SRC="http://2020ok.com/cmn/okStats.php?http://bookid/' + bookID + '.htm" WIDTH=0 HEIGHT=0></IFRAME>';
 
//   link = '/cmn/freeBooks.php?bookID='+bookID;
   link=getURL(bookID);

   if (link.indexOf("2020ok.com") > 0 )  {
     link=link.replace(/2020ok.com/, "KickJava.com/books");
   }

   kjBook=window.open(link,'kjBook', 'width='+screen.availWidth*0.85+',height='+screen.availHeight+',left='+screen.availWidth*0.14+',top=0,location=1,menubar=1,toolbar=1,scrollbars=1,resizable=1');
   kjBook.focus();
}

function javaDoc(type, api, kjClass) {
   var link = "";

//http://java.sun.com/javame/reference/apis.jsp

   if (type == 'A') { //Mobile Media API 1.2
      //link = "http://bf.monis.ch/prog/java/midp/midp-2-mmapi/" + kjClass + ".html#" + api;
      link = "http://java.sun.com/javame/reference/apis/jsr135/" + kjClass + ".html#" + api;
   }
   else if (type == 'B') { //Personal Basis Profile 1.1.2
      //link = "http://altair.snu.ac.kr/~seungil/research/pbp-spec/" + kjClass + ".html#" + api;
      link = "http://java.sun.com/javame/reference/apis/jsr217/" + kjClass + ".html#" + api;
   }
   else if (type == 'C') { //Java Card
      link = "http://www11.in.tum.de/Java/javacard/" + kjClass + ".html#" + api;
   }
   else if (type == 'D') { //Connected Device Configuration 1.1.2
      //link = "http://www11.in.tum.de/Java/j2sdkme/j2me-cdc/" + kjClass + ".html#" + api;
      link = "http://java.sun.com/javame/reference/apis/jsr218/" + kjClass + ".html#" + api;
   }
   else if (type == 'E') { //Java EE
      link = "http://java.sun.com/j2ee/1.4/docs/api/" + kjClass + ".html#" + api;
   }
   else if (type == 'F') { //Foundation 1.1.2
      //link = "http://www11.in.tum.de/Java/j2sdkme/j2me-foundation/" + kjClass + ".html#" + api;
      link = "http://java.sun.com/javame/reference/apis/jsr219/" + kjClass + ".html#" + api;
   }
   else if (type == 'L') { //CLDC 1.1
      //link = "http://www11.in.tum.de/Java/j2sdkme/cldcapi/" + kjClass + ".html#" + api;
      link = "http://java.sun.com/javame/reference/apis/jsr139/" + kjClass + ".html#" + api;
   }
   else if (type == 'M') { //MIDP 2.0
      //link = "http://www.j2medev.com/api/midp/" + kjClass + ".html#" + api;
      link = "http://java.sun.com/javame/reference/apis/jsr118/" + kjClass + ".html#" + api;
   }
   else if (type == 'N') { //LOCATION
      link = "http://www-users.cs.umn.edu/~czhou/docs/jsr179/lapi/" + kjClass + ".html#" + api;
   }
   else if (type == 'P') { //Java Phone
      link = "http://www11.in.tum.de/Java/javaphone/" + kjClass + ".html#" + api;
   }
   else if (type == 'Q') { //Personal Profile 1.1.2
      //link = "http://www.tcnj.edu/~massimi2/ppapi/" + kjClass + ".html#" + api;
      link = "http://java.sun.com/javame/reference/apis/jsr216/" + kjClass + ".html#" + api;
   }
   else if (type == 'T') { //JavaTV 1.1
      //link = "http://www11.in.tum.de/Java/jtvspec/" + kjClass + ".html#" + api;
      link = "http://java.sun.com/javame/reference/apis/jsr927/" + kjClass + ".html#" + api;
   }
   else { //type == 'S' Java SE
      link = "http://java.sun.com/j2se/1.5.0/docs/api/" + kjClass + ".html#" + api;
   }

   kjWin=window.open(link,'kjWin', 'width='+screen.availWidth*0.85+',height='+screen.availHeight*0.4+',top='+screen.availHeight*0.5+',left='+screen.availWidth*0.1+',toolbar=1,scrollbars=1,resizable=1');
    try {
       kjWin.focus();
    } catch (ex) {}

   return false;
}

function printXY() {
  alert(
  '(Top, Left, Height, Width) \n' +
  'document: (?, ?, ' + document.height + ',' + document.width +')\n' +
  'screen: (?, ?,  ' + screen.height + ', ' + screen.width +')\n' +
  'Availscreen: (' + screen.availTop + ', ' + screen.availLeft + ', ' + screen.availHeight + ', ' + screen.availWidth +')\n' +
  'InnerWindow: (?, ?,  ' + window.innerHeight + ', ' + window.innerWidth +')\n' +
  'OuterWindow: (?, ?,  ' + window.outerHeight + ', ' + window.outerWidth +')\n' +
  'WindowScreen: (' + window.screenX + ', ' + window.screenY + ', ?, ? )\n' +
  'WindowPageOffset: (' + window.pageXOffset + ', ' + window.pageYOffset + ', ?, ? )\n'
  )

}


