function switchClass(id,clname) {
	document.getElementById(id).style.background = clname;
}

function hideDocumentElement(id) {
    var el = document.getElementById(id);
    if (el) el.style.display = 'none';
}
function showDocumentElement(id) {
    var el = document.getElementById(id);
    if (el) el.style.display = 'block';
}
function _get_div_to_move()
{
	if(document.getElementById('sub_content'))
	{
		return document.getElementById('sub_content');
	}
	if(document.getElementById('rght_panel'))
	{
		return document.getElementById('rght_panel');
	}
	if(document.getElementById('ad_300'))
	{
		return document.getElementById('ad_300');
	}
	return null;

}
var old_padding=0;
function hidediv(id) {
	try{
		document.getElementById(id).style.display = 'none';
		if(id.match(/dropdown/))
		{
			var div=_get_div_to_move();
			if(div)
			{
				div.style.paddingTop=old_padding;
			}
			
		}
	} catch(e){};
//	if(undefined === $(id)) return;
//	return $(id).hide();
}
function showdiv(id) {
	try{
		var el=document.getElementById(id)
		el.style.display = 'block';
		el.style['z-index'] = '99999';
		if(id.match(/dropdown/))
		{
			var offset=140;
			if(document.getElementById('ad_300'))
			{
				offset=30;
			}
			var h = el.offsetHeight -offset;
			if(h>0)
			{
				var div=_get_div_to_move();
				if(div)
				{
					old_padding=div.style.paddingTop;
					div.style.paddingTop=h+'px';
				}
			}
		}
		
	} catch(e){};
//	if(undefined === $(id)) return;
//	return $(id).show();

}
