/*var scnWid,scnHei;
	if (self.innerHeight) // all except Explorer
	{
		scnWid = self.innerWidth;
		scnHei = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		scnWid = document.documentElement.clientWidth;
		scnHei = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		scnWid = document.body.clientWidth;
		scnHei = document.body.clientHeight;
	}*/
function class_call()
{
	//alert(screen.width+'x'+screen.height);
	var height=screen.height;
	//alert("to " + document.getElementById("left_bottom_end_md").style.height);
	//alert(document.getElementById("body_div").style.height);
	document.getElementById("body_div").style.minHeight=(height) + 'px';
	//alert(document.getElementById("body_div").style.minHeight+"value");
}
	
/*var scnWid,scnHei;
//alert(+" to "+);
scnWid = screen.width;
scnHei = screen.height;

	if (self.innerHeight) // all except Explorer
	{
		self.innerWidth = scnWid;
		self.innerHeight = scnHei;
		window.moveTo(0,0);
		alert("moved");
		window.resizeTo(screen.width, screen.height);
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		document.documentElement.clientWidth = scnWid;
		document.documentElement.clientHeight = scnHei;
	}
	else if (document.body) // other Explorers
	{
		document.body.clientWidth = scnWid;
		document.body.clientHeight = scnHei;
	}*/
//body.style.minHeight=screen.height;
//alert(document.body.height);
function openAsset(str_var,obj)
	{
		if (obj.className == 'plus')
		{
			obj.className = 'minus';
			if (navigator.appName == "Microsoft Internet Explorer")
				document.getElementById(str_var+'_2').style.display = 'inline'; 
			else
				document.getElementById(str_var+'_2').style.display= 'table-row'; 
		}
		else
		{
			obj.className = 'plus';
			document.getElementById(str_var+'_2').style.display = 'none';
		}
	}
function hideTable(id)
{
	//alert(id);
	if(id=="table_recent")
	{
	document.getElementById('table_recent').style.display = 'inline';
	document.getElementById('table_new').style.display = 'none';
	document.getElementById('recent').className= 'blue_r';
	document.getElementById('new').className= 'blue_n';
	}
	if(id=="table_new")
	{
	document.getElementById('table_new').style.display = 'inline';
	document.getElementById('table_recent').style.display = 'none';
	document.getElementById('recent').className= 'blue_n';
	document.getElementById('new').className= 'blue_r';
	}
}

// BOI, followed by one or more whitespace characters, followed by EOI.
var reWhitespace = /^\s+$/
// BOI, followed by one or more characters, followed by @,
// followed by one or more characters, followed by ., 
// followed by one or more characters, followed by EOI.
var reEmail = /^.+\@.+\..+$/
var mPrefix = "You did not enter a value into the "
var mSuffix = " field. This is a required field. Please enter it now."
var iEmail = "This field must be a valid email address (like foo@bar.com). Please reenter it now."
var defaultEmptyOK = false
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
 var reInteger = /^\d+$/
// Check whether string s is empty.
function isEmpty(s)
{   
	return ((s == null) || (s.length == 0))
}
// Returns true if string s is empty or 
// whitespace characters only.
function isWhitespace (s)
{   // Is s empty?
    return (isEmpty(s) || reWhitespace.test(s));
}
// isEmail (STRING s [, BOOLEAN emptyOK])
// 
// Email address must be of form a@b.c -- in other words:
// * there must be at least one character before the @
// * there must be at least one character before and after the .
// * the characters @ and . are both required
//
// For explanation of optional argument emptyOK,
// see comments of function isInteger.
function isEmail (s)
{   
	if (isEmpty(s)) 
       if (isEmail.arguments.length == 1) return defaultEmptyOK;
       else return (isEmail.arguments[1] == true);
    
    else {
       return reEmail.test(s)
    }
}
function isFloat (s)

{   if (isEmpty(s)) 
       if (isFloat.arguments.length == 1) return defaultEmptyOK;
       else return (isFloat.arguments[1] == true);

    return reFloat.test(s)
}
function isInteger (s)

{   var i;

    if (isEmpty(s)) 
       if (isInteger.arguments.length == 1) return defaultEmptyOK;
       else return (isInteger.arguments[1] == true);

    return reInteger.test(s)
}

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }  
  windowFeatures = 'width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1'
  popUpWin = window.open( URLStr, 'popUpWin', windowFeatures ) ; 
}
function popUpWindow1(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }  
  windowFeatures = 'width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+',toolbar=1,location=1,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1'
  popUpWin = window.open( URLStr, 'popUpWin', windowFeatures ) ; 
}

function resize()
{
var height=document.getElementById("center_container_md").offsetHeight;
//alert("rezing " + document.getElementById("left_bottom_end_md").offsetHeight );
document.getElementById("left_bottom_end_md").style.height=(height)+'px';
document.getElementById("right_bottom_end_md").style.height=(height)+'px';
//alert("to " + document.getElementById("left_bottom_end_md").style.height);
//alert("to " + document.getElementById("right_bottom_end_md").style.height);
//alert("completed");
}
//window.onload=resize;

var dhtmlgoodies_slideSpeed =15;	// Higher value = faster
var dhtmlgoodies_timer = 3;	// Lower value = faster

var objectIdToSlideDown = false;
var dhtmlgoodies_activeId = false;
var dhtmlgoodies_slideInProgress = false;

function showHideContent(e,inputId)
{
	if(dhtmlgoodies_slideInProgress)return;
	dhtmlgoodies_slideInProgress = true;
	if(!inputId)inputId = this.id;
	inputId = inputId + '';
	var numericId = inputId.replace(/[^0-9]/g,'');
	var answerDiv = document.getElementById('dhtmlgoodies_a' + numericId);

	objectIdToSlideDown = false;
	
	if(!answerDiv.style.display  || answerDiv.style.display=='none'){		
		if(dhtmlgoodies_activeId &&  dhtmlgoodies_activeId!=numericId){			
			objectIdToSlideDown = numericId;
			slideContent(dhtmlgoodies_activeId,(dhtmlgoodies_slideSpeed*-1));
		}else{
			
			answerDiv.style.display='block';
			answerDiv.style.visibility = 'visible';
			
			slideContent(numericId,dhtmlgoodies_slideSpeed);
		}
	}else{
		slideContent(numericId,(dhtmlgoodies_slideSpeed*-1));
		dhtmlgoodies_activeId = false;
	}	
}

function slideContent(inputId,direction)
{
	
	var obj =document.getElementById('dhtmlgoodies_a' + inputId);
	var contentObj = document.getElementById('dhtmlgoodies_ac' + inputId);
	height = obj.clientHeight;
	if(height==0)height = obj.offsetHeight;
	height = height + direction;
	rerunFunction = true;
	if(height>contentObj.offsetHeight){
		height = contentObj.offsetHeight;
		rerunFunction = false;
	}
	if(height<=1){
		height = 1;
		rerunFunction = false;
	}

	obj.style.height = height + 'px';
	var topPos = height - contentObj.offsetHeight;
	if(topPos>0)topPos=0;
	contentObj.style.top = topPos + 'px';
	if(rerunFunction){
		setTimeout('slideContent(' + inputId + ',' + direction + ')',dhtmlgoodies_timer);
	}else{
		if(height<=1){
			obj.style.display='none'; 
			if(objectIdToSlideDown && objectIdToSlideDown!=inputId){
				document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.display='block';
				document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.visibility='visible';
				slideContent(objectIdToSlideDown,dhtmlgoodies_slideSpeed);				
			}else{
				dhtmlgoodies_slideInProgress = false;
			}
		}else{
			dhtmlgoodies_activeId = inputId;
			dhtmlgoodies_slideInProgress = false;
		}
	}
	resize();
}

function initShowHideDivs()
{
	var divs = document.getElementsByTagName('DIV');
	var divCounter = 1;
	for(var no=0;no<divs.length;no++){
		if(divs[no].className=='category_list'){
			divs[no].onclick = showHideContent;
			divs[no].id = 'dhtmlgoodies_q'+divCounter;
			var answer = divs[no].nextSibling;
			while(answer && answer.tagName!='DIV'){
				answer = answer.nextSibling;
			}
			answer.id = 'dhtmlgoodies_a'+divCounter;	
			contentDiv = answer.getElementsByTagName('DIV')[0];
			contentDiv.style.top = 0 - contentDiv.offsetHeight + 'px'; 	
			contentDiv.className='sub_category_list_content';
			contentDiv.id = 'dhtmlgoodies_ac' + divCounter;
			answer.style.display='none';
			answer.style.height='1px';
			divCounter++;
		}		
	}
	resize();
	
}
window.onload = initShowHideDivs;
