function hideSection(ojbect) {
	unsetOption();
	if (document.layers && document.layers[ojbect]) {
	  document.layers[ojbect].display = 'none';
 	} else {
    if (document.all) {
			var allDivs = document.all.tags("DIV");
			for (var i=0; i < allDivs.length; i++) {
				allDivs[i].style.display = 'none';
			}	
    	document.all[ojbect].style.display = 'none';
    } else {
			var allDivs = document.getElementsByTagName("DIV");
			for (var i=0; i < allDivs.length; i++) {
				allDivs[i].style.display = 'none';
			}	
			document.getElementById(object).style.display = 'none';
		}
  }
}

function showSection(section) {

var pstrsection = 'ml' + section;
var pstrbutton = 'btn' + section;

setOption(pstrbutton);

if (document.layers && document.layers[pstrsection]) {
  document.layers[pstrsection].display = 'block';
} else {
	if (document.all) {
		var allDivs = document.all.tags("DIV");
		for (var i=0; i < allDivs.length; i++) {
			allDivs[i].style.display = 'none';
		}	
		try {
			document.all[pstrsection].style.display = 'block';
		} catch (e) {
		}
	} else {
		var allDivs = document.getElementsByTagName("DIV");
		for (var i=0; i < allDivs.length; i++) {
			allDivs[i].style.display = 'none';
		}	
		try {
			document.getElementById(pstrsection).style.display = 'block';
		} catch (e) {
		}
	}
}
}

function openPopup(pstrpage,pintheight,pintwidth) {
var pstrURL, pinttop, pintleft;
pstrURL="enl_"+pstrpage+".htm";
pinttop = (screen.availHeight/2-(pintheight/2));
pintleft = (screen.availWidth/2-(pintwidth/2));
if (navigator.appName == 'Microsoft Internet Explorer') 
	{window.open(pstrURL,pstrpage, "directories=no, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, height="+pintheight+", width="+pintwidth+", top="+pinttop+", left="+pintleft+"");}
else
	{popupwindow=window.open(pstrURL,pstrpage,'resizable,scrollbars,height='+pintheight+',width='+pintwidth+'');}
}


function openSample(pstrPageCode) {
var pstrURL, pinttop, pintleft;
pstrURL="/pop_sample/"+pstrPageCode;
pinttop = (screen.availHeight/2-275);
pintleft = (screen.availWidth/2-325);
if (navigator.appName == 'Microsoft Internet Explorer') 
	{window.open(pstrURL,"SamplePopup", "directories=no, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, height=550, width=650, top="+pinttop+", left="+pintleft+"");}
else
	{popupwindow=window.open(pstrURL,'SamplePopup','resizable,scrollbars,height=550,width=650');}
}

function openPopupPage(pstrPageCode) {

	var pobjWindow, pintTop, pintLeft;
	
	pintTop = (screen.availHeight/2-200);
	pintLeft = (screen.availWidth/2-275);
	var pstrURL="/pop_other/"+pstrPageCode;

	if (navigator.appName == 'Microsoft Internet Explorer') {
		pobjWindow = window.open(pstrURL, "EnlCmsPopup", "directories=no, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, height=400, width=550,top="+pintTop+",left="+pintLeft);
	}	else {
		pobjWindow = window.open(pstrURL, "EnlCmsPopup",'resizable,scrollbars,height=400,width=550');
	}
	pobjWindow.focus();
}

function openGenericSample(pstrURL, pstrpage) {
var pinttop, pintleft;
pinttop = (screen.availHeight/2-275);
pintleft = (screen.availWidth/2-390);
if (navigator.appName == 'Microsoft Internet Explorer') 
	{window.open(pstrURL,pstrpage, "directories=no, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, height=550, width=780, top="+pinttop+", left="+pintleft+"");}
else
	{popupwindow=window.open(pstrURL,pstrpage,'resizable,scrollbars,height=550,width=780');}
}

function setOption(button){

if (button=='btnImportMessage') {
	button = 'btnImport';
}
unsetOption();
if (document.all) {
   document.all(button).className = "optionsrowon";}
else if (document.getElementById) {
   document.getElementById(button).className = "optionsrowon";}
window.focus();
}

//each page needs to provide it's own version of the unset option method if using div tags - see maillist.jsp

function login(pstrLoginId) {

	var pstrURL
	pstrURL=JSPServer+"enl_login.jsp";
	if (!pstrLoginId==undefined) {
		pstrURL = pstrURL+"?LoginId="+pstrLoginId;
	}
  if (navigator.appName == 'Microsoft Internet Explorer') 
    mwinLogin = window.open(pstrURL,"Login", "directories=no, location=no, scrollbars=no, menubar=no, resizable=yes, status=no, toolbar=no, height=280, width=390, top=100, left=75");
  else
    mwinLogin=window.open(pstrURL,'Login','resizable,scrollbars=no,height=280,width=390');
    
	if(!mwinLogin) {
		alert(NoPopupsAlertMessage);
	} else {
	  mwinLogin.focus();
	}
}

function openHelp(pstrHelpId) {
	var pstrURL, pinttop, pintleft;
	pstrURL="/enl_help_popup.jsp?HelpId="+pstrHelpId;
	pinttop = (screen.availHeight/2-240);
	pintleft = (screen.availWidth/2-300);
	if (navigator.appName == 'Microsoft Internet Explorer') 
		{window.open(pstrURL,"help", "directories=no, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, height=480, width=600,top="+pinttop+",left="+pintleft);}
	else
		{helpwindow=window.open(pstrURL,'help','resizable,scrollbars,height=480,width=600');}
}


function openHelpManual(pstrPageCode){
	pinttop = (screen.availHeight/2-240);
	pintleft = (screen.availWidth/2-300);
	
	if (navigator.appName == 'Microsoft Internet Explorer') 
		{window.open("/help/" + pstrPageCode,"helpmanual", "directories=no, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, height=600, width=800,top="+pinttop+",left="+pintleft);}
	else
		{helpwindow=window.open("/help/" + pstrPageCode,'helpmanual','resizable,scrollbars,height=600,width=800');}
	
}

function openResellerManual(pstrPageCode){
	pinttop = (screen.availHeight/2-240);
	pintleft = (screen.availWidth/2-300);
	
	if (navigator.appName == 'Microsoft Internet Explorer') 
		{window.open("/resellermanual/" + pstrPageCode,"resellermanual", "directories=no, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, height=600, width=800,top="+pinttop+",left="+pintleft);}
	else
		{helpwindow=window.open("/resellermanual/" + pstrPageCode,'resellermanual','resizable,scrollbars,height=600,width=800');}
	
}


function turnOn(imageName) {
  if (document.images) {
    document[imageName].src = eval(imageName + "on.src");
  }
}

function turnOff(imageName) {
  if (document.images) {
    document[imageName].src = eval(imageName + "off.src");
  }
}

function setPageSize(){
var pintHeight;
if (self.innerHeight) // all except Explorer
{
	pintHeight=(self.innerHeight-200);
	document.getElementById('maintable').style.height=pintHeight;
}
else if (document.documentElement && document.documentElement.clientHeight)	// Explorer 6 Strict Mode
{
	pintHeight=(document.documentElement.clientHeight-200);
	document.getElementById('maintable').style.height=pintHeight;
}
else if (document.body) // other Explorers
{
	pintHeight=(document.body.clientHeight-200);
	document.getElementById('maintable').style.height=pintHeight;
}
}

function getFormGroup(name) {
	return document.getElementsByName(name);
}

function getRadio(name) 
{elements = getFormGroup(name);
if (elements)
/* loop over all the radio buttons */
	for (i = 0; i < elements.length; i++)
	if (elements[i].checked)
		return elements[i];
	
		/* either no group by that name was foundor none were selected */
		return null;	
}

function getRadioValue(name) {
	element = getRadio(name);
	
	if (element) 
		return element.value;
	
	/* there must not have been a radio buttonselected */
	return '';
	 
	}


















