<!--

try { document.execCommand("BackgroundImageCache", false, true); } catch(err) {}

function initAndEquals () {
//  try {	initPage();  } catch(e) {}
  try {	new EqualColumns('hp-top-stories','div','editors-n-signup-hp','div');  } catch(e) {}
  try {	ECPMTV();  } catch(e) {}
  try {	ECPZ();  } catch(e) {}
  try {	ECMP();	 } catch(e) {}
  
  try {  changePMTVTab(Math.floor(Math.random( ) * 3)+1);  } catch(e) {}
  try {  changePZTab(3);  } catch(e) {}
  try {  changeMPTab(Math.floor(Math.random( ) * 3)+1);  } catch(e) {}

  try {
    //doLoadBanner("banner_r1");
    //doLoadBanner("banner_r2");
    doLoadBanner("banner468");
    doLoadBanner("banner336");
    doLoadBanner("banners");
  } catch(e) {}
}

function doLoadBanner(idName) {
  var id = document.getElementById(String(idName));  
  if (id != null) {
    var innerContent = String(id.innerHTML).toLowerCase().replace(/<!--\/\/begin\/\//gi,"").replace(/\/\/end\/\/-->/gi,"");
    document.getElementById(String(idName)).innerHTML = innerContent;   
  }
}

function sizeImgWH(obj, _w, _h) {
	var tmpImg = new Image();
	tmpImg.src = obj.src;
	if (tmpImg.height > _h) { obj.height = _h; }
	if (tmpImg.width > _w) { obj.width = _w; }
}
function checkSignUpForm(fObj) {
	if (!checkEmail(fObj.email.value)) { alert("Please enter your valid email address.");  fObj.email.focus();   return false; }
	return true;
}
function bookmarkinit() {
var IE = navigator.appName.match(/(Microsoft Internet Explorer)/gi), 
    NS = navigator.appName.match(/(Netscape)/gi), 
    OP = navigator.appName.match(/(Opera)/gi), 
    BK = document.getElementById("bookmark");
    if (BK) {
    BK.onmouseout = function(){ 
       window.status = ''; 
       return true; 
    }
    if(IE && document.uniqueID){ 
       BK.onclick = function(){ 
          window.external.AddFavorite(location.href,document.title); 
       } 
       BK.onmouseover = function(){ 
          window.status='Click to add this page to your '+RegExp.$1+' favorites'; 
          return true; 
       } 
    } 
    else if(OP || IE && !document.uniqueID){ 
       BK.onclick = function(){ 
          alert('Your '+RegExp.$1+' browser requires that you\nPress Ctrl & T to Bookmark this page.'); 
       } 
       BK.onmouseover = function(){ 
          window.status='Your '+RegExp.$1+' browser requires that you Press Ctrl & T to Bookmark this page.'; 
          return true; 
       } 
    } 
    else if(NS){ 
       BK.onclick = function(){ 
          alert('Your '+RegExp.$1+' browser requires that you\nPress Ctrl & D to Bookmark this page.'); 
       } 
       BK.onmouseover = function(){ 
          window.status='Your '+RegExp.$1+' browser requires that you press Ctrl & D to Bookmark this page.'; 
          return true; 
       } 
    } 
    else{ BK.innerHTML = '' }
    } 
}

var eqCounter = 0;
function EqualColumns()
{
	this.eqa = 0;
	this.eqth = 0;
	this.eqtw = 0;

	var c, e, el;
    if (document.getElementById)
    {
        this.blocks = new Array();
        for (i = 0; i < arguments.length; i += 2)
        {
            el = null;
            c = document.getElementById(arguments[i]);
            if (c)
            {
                e = c.getElementsByTagName(arguments[i+1]);
                if (e)
                {
                    el = e[e.length-1];
                    if (!el.id)
                    {
                        el.id = "myeq" + (eqCounter++);
                    }
                }
            }
            if (c && el)
            {
                this.blocks.push(c);
                this.blocks.push(el);
            }
        }
        //setInterval("P7_eqT2()",10);
		this.startCalculate();
    }
}

EqualColumns.prototype.startCalculate = function() {
    if (this.eqth != document.body.offsetHeight || this.eqtw != document.body.offsetWidth)
    {
        this._startCalculate();
    }
}

EqualColumns.prototype._startCalculate = function() {
    var i, oh, h = 0, tg, el, np, dA = this.blocks, an = this.eqa;
    if (dA && dA.length)
    {
        for (i = 0; i < dA.length; i += 2)
        {
            dA[i+1].style.paddingBottom = '';
        }
        for (i = 0; i < dA.length; i += 2)
        {
            oh = dA[i].offsetHeight;
            h = (oh > h) ? oh : h;
        }
        for (i = 0; i < dA.length; i += 2)
        {
            oh = dA[i].offsetHeight;
            if (oh < h)
            {
                np = h - oh;
		dA[i+1].style.paddingBottom = np + "px";
            }
        }
        this.eqa = 1;
        this.eqth = document.body.offsetHeight;
        this.eqtw = document.body.offsetWidth;
    }
}

function ECPMTV() {

	new EqualColumns('PMTV11', 'div', 'PMTV12', 'div', 'PMTV21', 'div', 'PMTV22', 'div', 'PMTV31', 'div', 'PMTV32', 'div');
	
	if (document.getElementById("PMTVMess") != null)  document.getElementById("PMTVMess").style.display = "none"; 
	if (document.getElementById("PMTV12") != null) document.getElementById("PMTV12").style.display = "none";

	if (document.getElementById("PMTV2") != null) document.getElementById("PMTV2").style.display = "none";
	if (document.getElementById("PMTV22") != null) document.getElementById("PMTV22").style.display = "none";

	if (document.getElementById("PMTV3") != null) document.getElementById("PMTV3").style.display = "none";
	if (document.getElementById("PMTV32") != null) document.getElementById("PMTV32").style.display = "none";

	if (document.getElementById("PMTVBlock") != null) {
   document.getElementById("PMTVBlock").style.height = "auto";
	 document.getElementById("PMTVBlock").style.visibility = "visible";
	}	
try { 	new EqualColumns('exclusive-wrapper-padd','kbd','now-playing','kbd');  } catch(e) {}
}
function ECPZ() {
	new EqualColumns('PZTab1', 'div', 'PZTab2', 'div','PZTab3', 'div');
	
	if (document.getElementById("PZMess") != null) document.getElementById("PZMess").style.display = "none";
	if (document.getElementById("PZTab2") !=null ) document.getElementById("PZTab2").style.display = "none";
	if (document.getElementById("PZTab3") != null) document.getElementById("PZTab3").style.display = "none";
	
	if (document.getElementById("PZBlock") !=null) {
   document.getElementById("PZBlock").style.height = "auto";
	 document.getElementById("PZBlock").style.visibility = "visible";
	}
	
try {	new EqualColumns('product-zone','kbd','ems-tools-network','kbd');  } catch(e) {}
}
function ECMP() {
	new EqualColumns('MPTab1', 'div', 'MPTab2', 'div', 'MPTab3', 'div');
	
	if (document.getElementById("MPMess") !=null)  document.getElementById("MPMess").style.display = "none";
	if (document.getElementById("MPTab2") !=null) document.getElementById("MPTab2").style.display = "none";
	if (document.getElementById("MPTab3") !=null) document.getElementById("MPTab3").style.display = "none";
	
	if (document.getElementById("MPBlock") !=null) {
	 document.getElementById("MPBlock").style.height = "auto";
	 document.getElementById("MPBlock").style.visibility = "visible";
	}
}

-->
