function cw(){
  var maximum = 1004;
  var minimum = 740;
  document.getElementById('content').style.height='auto';
  document.getElementById('navcolumn').style.height='auto';
  document.getElementById('newslist').style.height='auto';
  logo=getChild(document.getElementById('header'), 'blockquote');
//  if(window.innerWidth){
//     var width = window.innerWidth;
//  }else if (document.body && document.body.clientWidth) {
     var width = document.body.clientWidth  
//  }
  if(width > maximum){width = maximum;}
  if(width < minimum){width = minimum;}
  a = document.getElementById('middle');
  b = document.getElementById('header');
  c = document.getElementById('footer');
  d = document.getElementById('content');
  var ua = navigator.userAgent.toLowerCase();
  if((ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1)){
    a.style.width = (width - 20)+ "px";
    b.style.width = (width - 19)+ "px";
    c.style.width = (width - 20)+ "px";
    d.style.width = (width - 391)+ "px";
    logo.style.width = (width - 379)+ "px";
  }else{
    a.style.width = (width - 20)+ "px";
    b.style.width = (width - 19)+ "px";
    c.style.width = (width - 20)+ "px";
    d.style.width = (width - 393)+ "px";
    logo.style.width = (width - 390)+ "px";
  }
    
  var m = 400;
    a = document.getElementById('content');
    b = document.getElementById('newslist');
    c = document.getElementById('navcolumn');
    var h = parseInt(a.clientHeight);
    if(h>m) m=h;
    var h = parseInt(b.clientHeight)+16;
    if(h>m) m=h;
    var h = parseInt(c.clientHeight)+16;
    if(h > m) m= h;
    a.style.height= m + "px";

}
function Debug(obj,objName) {
    var result = ""
    for (var i in obj) {
      result += objName + "." + i + " = " + obj[i] + "<BR>"
    }
    var debwin = window.open('', 'd_e_b_U_g');
    debwin.document.write('<html><body>' + result + '</body></html>');
    debwin.document.close();
}
function getChild(obj, nodename){
   for (var i in obj.childNodes){
     if(obj.childNodes[i].nodeName && obj.childNodes[i].nodeName.toUpperCase() == nodename.toUpperCase()) return obj.childNodes[i];
   }
   return false;
}
function showAd1(){
    if(document.getElementById('innerad1') && document.getElementById('innerad1').innerHTML !=''){
      var src=document.getElementById('innerad1');
      var ad=document.createElement('div');
      var cont=document.getElementById('content');
      ad.className="yand1";
      ad.innerHTML = src.innerHTML;
      src.innerHTML='';
      var cnt = cont.childNodes;      
      if(cnt.length && cnt.length > 0){ 
       var par = 0;
       for(var i=0;i<cnt.length;i++){
        if(cnt[i].tagName=='p'){
          if(par < 5){
            par++;
          }else{
            var target = cnt[i];
            cont.insertBefore(ad,target);
            return;
          }
        }    
       }
      }
    }
    cw();
}
window.onload=showAd1;
window.onresize=cw;