<!--


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;  }
    var ff=/a/[-1]=='a';
    if (ff) obj.height = Math.round(obj.height);
}

//functions of the justification block
//////////////////////////////////////
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 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;   
  }
}

// SignUpBlockOnHomePage
function checkSignUpForm(fObj) {
	if (!checkEmail(fObj.email.value)) { alert("Please enter your valid email address.");  fObj.email.focus();   return false; }
	return true;
}



	window.onload = function() {
                bookmarkinit();

    new EqualColumns('FV0', 'div', 'FV1', 'div','FV2', 'div', 'PV0', 'div', 'PV1', 'div', 'PV2', 'div', 'TV0', 'div', 'TV1', 'div', 'TV2', 'div');
		//new EqualColumns('markDivMP0', 'div', 'markDivMP1', 'div','markDivMP2', 'div', 'markDivMP3', 'div');
		new EqualColumns('markDivMP0', 'div', 'markDivMP1', 'div','markDivMP2', 'div');

		document.getElementById("threeVtab1").style.display = "none";
		document.getElementById("threeVtab2").style.display = "none";
		
		
		document.getElementById("FV1").style.display = "none";
		document.getElementById("FV2").style.display = "none";
		document.getElementById("PV1").style.display = "none";
		document.getElementById("PV2").style.display = "none";
		document.getElementById("TV1").style.display = "none";
		document.getElementById("TV2").style.display = "none";

		
		document.getElementById("three-video-mess").style.display = "none";
		document.getElementById("hid3V").style.height = "auto";
		document.getElementById("hid3V").style.visibility = "visible";


		document.getElementById("markDivMP1").style.display = "none";
		document.getElementById("markDivMP2").style.display = "none";
		
    //document.getElementById("markDivMP3").style.display = "none";		
		document.getElementById("most-popular-mess").style.display = "none";		
		document.getElementById("hidMP").style.height = "auto";
		document.getElementById("hidMP").style.visibility = "visible";

		//document.getElementById("body_id").style.visibility = "visible";
		
    
    changeMark3V(Math.round(Math.random() * 2)); 
		
		
		//rnd = Math.round(Math.random() * 2);
		
		rnd = Math.floor(Math.random()*3)

		changeMarkMP(rnd); 

		try {
			new EqualColumns('PZ1', 'div', 'PZ2', 'div','PZ3', 'div');
			document.getElementById("messPZ").style.display = "none";
			document.getElementById("markdivPZ1").style.display = "none";
			document.getElementById("markdivPZ2").style.display = "none";
			document.getElementById("hidPZ").style.visibility = "visible";
			document.getElementById("hidPZ").style.height = "auto";

			
			//changeMarkPZ(Math.round(Math.random() * 2));
			changeMarkPZ(1);
			enablePZ = true;
		}
		catch (e) {}

  doLoadBanner("banners-main");
  doLoadBanner("banners");
  doLoadBanner("banner4");
  doLoadBanner("banner3");


}
///////////////////////////////////////////////////
//end of functions of the justification block


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 = '' }
    } 
}

//-->
