if (typeof(roothtml_) == 'undefined' || roothtml_ == null) {
	var roothtml_	= '/';
}
function ShowHide(sObjectID) {
	witchDIV = document.getElementById('expandable-content'+sObjectID);
	witchIMG = document.getElementById('images'+sObjectID);
	if (witchDIV.style.display == 'block') {
		witchDIV.style.display = 'none'
		if (witchIMG != null)
		witchIMG.src=roothtml_+'images/sectclos.gif';
	} else {
		witchDIV.style.display = 'block'
		if (witchIMG != null)
		witchIMG.src=roothtml_+'images/sectopen.gif';
	}
	return false;
}

function ShowHideInline(sObjectID) {
	witchDIV = document.getElementById('expandable-content'+sObjectID);
	witchIMG = document.getElementById('images'+sObjectID);
	if (witchDIV.style.display == 'inline') {
		witchDIV.style.display = 'none'
		if (witchIMG != null)
		witchIMG.src=roothtml_+'images/sectclos.gif';
	} else {
		witchDIV.style.display = 'inline'
		if (witchIMG != null)
		witchIMG.src=roothtml_+'images/sectopen.gif';
	}
	return false;
}

var flagOpen = false;
if (lastposition > 0) {
	lastposition++;
}
function OpenCloseAll() {
	witchIMG = document.getElementById('OpenCloseAllImages');
	if (flagOpen == true) {
		flagOpen = false;
		witchIMG.src=roothtml_+'images/collapseclos.gif';
		srcimg = roothtml_+'images/sectclos.gif';
		displaystatus	= 'none';
	} else {
		flagOpen = true;
		witchIMG.src=roothtml_+'images/collapseopen.gif';
		srcimg = roothtml_+'images/sectopen.gif';
		displaystatus	= 'block';
	}
	if (lastposition > 0) {
		for (var i = 1; i < lastposition ; i++) {
			witchIMG = document.getElementById('images'+i);
			if (witchIMG != null)
			{
				witchIMG.src=srcimg;
				witchDIV = document.getElementById('expandable-content'+i);
				witchDIV.style.display = displaystatus
			}
		}
	}
	return false;
}
function ChangeImgForLister(imgID,flagForOnMouseOut) {
	if (imgID) {
		witchIMG = document.getElementById('images'+imgID);
		witchDIV = document.getElementById('expandable-content'+imgID);
		if (witchDIV.style.display != 'block') {
			if (flagForOnMouseOut) {
				witchIMG.src=roothtml_+'images/sectclos.gif';
			} else {
				witchIMG.src=roothtml_+'images/sectclosa.gif';
			}
		} else {
			if (flagForOnMouseOut) {
				witchIMG.src=roothtml_+'images/sectopen.gif';
			} else {
				witchIMG.src=roothtml_+'images/sectopena.gif';
			}
		}
	} else {
		witchIMG = document.getElementById('OpenCloseAllImages');
		if (flagForOnMouseOut) {
			if (flagOpen == true) {
				witchIMG.src=roothtml_+'images/collapseopen.gif';
			} else {
				witchIMG.src=roothtml_+'images/collapseclos.gif';
			}
		} else {
			witchIMG.src=roothtml_+'images/collapseload.gif';
		}
	}
}

function wrappedLine(sLine) {

	var MAX_LINE_LENGTH = 32;

	var aWords = sLine.split(' ');
	var sFinal = '';
	var sTmp = '';
	
	var i = 0;
	for (i = 0; i < aWords.length; i++) {
		if (aWords[i].length > MAX_LINE_LENGTH){
			sTmp = '';
			var pos = 0;
			var relpos = 0;
			
			for (pos = 0; pos < aWords[i].length; pos++){
				if (relpos < MAX_LINE_LENGTH){
					sTmp += aWords[i].charAt(pos);
					relpos++;
				}
				else {
					sTmp += ' ' + aWords[i].charAt(pos);
					relpos = 0;
				}
			}
			sFinal += ' ' + sTmp;
		}
		else {
			sFinal += ' ' + aWords[i];
		}
		
	}
	return sFinal;
}



// function to check all and uncheck all
function checkAll(checkname, exby) {
  for (i = 0; i < checkname.length; i++)
  checkname[i].checked = exby.checked? true:false
}




function dump(arr,level) {
var dumped_text = "";
if(!level) level = 0;

//The padding given at the beginning of the line.
var level_padding = "";
for(var j=0;j<level+1;j++) level_padding += "    ";

if(typeof(arr) == 'object') { //Array/Hashes/Objects
 for(var item in arr) {
  var value = arr[item];
 
  if(typeof(value) == 'object') { //If it is an array,
   dumped_text += level_padding + "'" + item + "' ...\n";
   dumped_text += dump(value,level+1);
  } else {
   dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
  }
 }
} else { //Stings/Chars/Numbers etc.
 dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
}
return dumped_text;
} 





var i = 0;
//window.alert(document.forms.length);
for (i = 0; i < document.forms.length; i++)
{
	oSummary = document.forms[i];
	if (oSummary.id.match(/summary_/)){
		oSummary.innerHTML = wrappedLine(oSummary.innerHTML);
	}
}

//window.alert(wrappedLine('JStestJStestJStestJStestJStestJS testJStestJStestJStestJStestJStes tJStestJStestJStestJStestJStestJS test'));
