setInterval(updatesizes,50);

function updatesizes()
{

    if (document.body!==null) {
			
  	var body = document.getElementsByTagName('html')[0];
	document.getElementsByTagName('body')[0].style.height=(parseInt(document.getElementsByTagName('body')[0].style.height)-50)+'px';
	
	if(body.scrollHeight > body.offsetHeight)
	{
		(document.getElementsByTagName('body')[0]).style.height = body.scrollHeight+"px";
	}
	else 
	{
// 			alert("execute");
		(document.getElementsByTagName('body')[0]).style.height = body.clientHeight+"px";
	}
    }
}
String.prototype.capitalize = function(){
   return this.replace( /(^|\s)([a-z])/g , function(m,p1,p2){ return p1+p2.toUpperCase(); } );
  };
  
window.onload=function()
{
	if($$('.body_with_submenu')[0])
	{
		var objaray = Array();
		var subbody = $$('.body_with_submenu')[0];
		var inner = document.createElement('div');
		inner.setAttribute("ID", "inner");
// 		inner.className = "box boxwidth_946";
		while(subbody.firstChild)
		{
			objaray.push(subbody.removeChild(subbody.firstChild));
		}
		for(var i=0; i<objaray.length; ++i)
		{
			inner.appendChild(objaray[i]);
		}
		subbody.appendChild(inner);
		
		var bottom = document.createElement('div');
		bottom.className = "bottom_round";
		subbody.appendChild(bottom);
	}
	
  $$('.box').each(
      function (obj) 
      {
	// insert a top div (class: boxtop)
	// insert a bottom div (class: boxbottom)
	// check height of contents; if <200 change background-image to box-gradient-1 if >400 change to box-gradient-3
	var top = document.createElement('div');
	top.className = "boxtop";
	var bottom = document.createElement('div');
	bottom.className = "boxbottom";
	obj.insertBefore(top, obj.firstChild);
	obj.appendChild(bottom);
      }
	     )
}

function onblur_js(obj)
{
	if((obj.value).length < 1)
	{
		obj.removeClassName("black-text");
		obj.value = (obj.name).capitalize();
	}
}
function onfocus_js(obj)
{
	var value_text = (obj.value).toLowerCase();
	if(value_text=="name" || value_text=="email" || value_text=="phone")
	{
		obj.value = "";
	}
	obj.removeClassName("black-text");
	obj.addClassName("black-text");
}

