var MAX_DUMP_DEPTH = 10;
function dumpObj(obj, name, indent, depth) {
  if (depth > MAX_DUMP_DEPTH) return indent + name + ": <Maximum Depth Reached>\n";
  if (typeof obj == "object") {
         var child = null;
         var output = indent + name + "\n";
         indent += "\t";
         for (var item in obj)
         {
               try {
                      child = obj[item];
               } catch (e) {
                      child = "<Unable to Evaluate>";
               }
               if (typeof child == "object") {
                      output += dumpObj(child, item, indent, depth + 1);
               } else {
                      output += indent + item + ": " + child + "\n";
                       }
                 }
                 return output;
          } else {
                 return obj;
          }
   }
       
function hideShow(div,icon,swaptext,title)
{ 
	if(document.getElementById(div).style.display == 'none')
	{ 
		document.getElementById(div).style.display = '';
		if (typeof(document.images[icon].src)!== 'undefined') {
			document.images[icon].src = '/_resources/images/xtree/hide.gif';
		}
		document.getElementById(swaptext).innerText = 'Hide ' + title;	
	}
	else
	{
		document.getElementById(div).style.display = 'none';
		document.images[icon].src = '/_resources/images/xtree/show.gif';
		document.getElementById(swaptext).innerText = 'Show ' + title;	
	}
} 
function toggleShow(div) {
	if(document.getElementById(div).style.display == 'none')
	{ 
		document.getElementById(div).style.display = ''; 
	}
	else
	{
		document.getElementById(div).style.display = 'none'; 
	}
	
}
function cancel() {
	 history.go(-1);
}
function goback() {
	 history.go(-1);
}
function gohere(gotoURL) {
	 window.location = gotoURL;	
}
function hov(loc,cls){
   if(loc.className)
      loc.className=cls;
}
function checkAll(field)
{
for (i = 0; i < field.length; i++)
	field[i].checked = true ;
}
function uncheckAll(field) {
 
	for (i = 0; i < field.length; i++)
		field[i].checked = false ;
}
function unselectAll(field) {  
			field.selectedIndex = 0;	 
}
function del(gotoURL) {
	if(confirm('Are you sure want to delete this?')) 		
		{
		location = gotoURL;
		}
	return;
	}
function archive(gotoURL) {
	if(confirm('Are you sure want to archive this?')) 		
		{
		location = gotoURL;
		}
	return;
}
