function SetAllCheckBoxes(FormName, FieldName, CheckValue)
{
	if(!document.forms[FormName])
		return;
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes)
		return;
	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes)
		objCheckBoxes.checked = CheckValue;
	else
		// set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++)
			objCheckBoxes[i].checked = CheckValue;
}

// This is the function for opening the error message div
function openErrorDiv(msg)
{
	openNewDiv('errorDiv');
	
	if (ns4)
	{
		document.errorMsgDiv.innerHTML = msg;
	}
	else if (ns6)
	{
		document.getElementById("errorMsgDiv").innerHTML = msg;
	}
	else if (ie4)
	{
		document.all.errorMsgDiv.innerHTML = msg;
	}
}
// This is the function for changing the opacity and making the new div visible
function openNewDiv(divId)
{
	if (ns4)
	{
		document.coverup.MozOpacity = .2;
		document.coverup.opacity = .2;
		document.layers[divId].visibility = "visible";
	}
	else if (ns6)
	{
		document.getElementById("coverup").style.MozOpacity = .2;
		document.getElementById("coverup").style.opacity = .2;
		document.getElementById(divId).style.visibility = "visible";
	}
	else if (ie4)
	{
		document.all.coverup.style.filter = "alpha(opacity=" + 20 + ")";
		document.all[divId].style.visibility = "visible";
	}
}
// This is the function for changing the opacity and making the new div hidden
function closeNewDiv(divId)
{
	if (ns4)
	{
		document.coverup.MozOpacity = 1
		document.coverup.opacity = 1;
		document.layers[divId].visibility = "hidden";
	}
	else if (ns6)
	{
		document.getElementById("coverup").style.MozOpacity = 1;
		document.getElementById("coverup").style.opacity = 1;
		document.getElementById(divId).style.visibility = "hidden";
	}
	else if (ie4)
	{
		document.all.coverup.style.filter = "alpha(opacity=" + 100 + ")";
		document.all[divId].style.visibility = "hidden";
	}
}
function CRMContactPopup(xUrl,xWinName) {
var winleft = (screen.width - 775) / 2;
var winUp = (screen.height - 675) / 2;
winProp = 'width=775,height=575,left='+winleft+',top='+winUp+',scrollbars=yes,resizable=1';
    newwindow = window.open(xUrl, xWinName, winProp );
	if (window.focus) {newwindow.focus()}
	return false;
}
  
function CRMContactPops(xUrl,xWinName) {
var winleft = (screen.width - 775) / 2;
var winUp = (screen.height - 675) / 2;
// Modified by Ethan Sudman on 8/26/08 because the smaller width of 775 caused the navigation bar to wrap
winProp = 'width=875,height=575,left='+winleft+',top='+winUp+',scrollbars=yes,resizable=1';
    newwindow = window.open(xUrl, xWinName, winProp );
	if (window.focus) {newwindow.focus()}
}  
   
function ExhibitorPopup(xUrl,xWinName) {
var winleft = (screen.width - 650) / 2;
var winUp = (screen.height - 500) / 2;
winProp = 'width=650,height=500,left='+winleft+',top='+winUp+',scrollbars=yes,resizable=1';
    newwindow = window.open(xUrl, xWinName, winProp );
	if (window.focus) {newwindow.focus()}
	return false;
}
function ExhibitorPops(xUrl,xWinName) {
var winleft = (screen.width - 650) / 2;
var winUp = (screen.height - 500) / 2;
winProp = 'width=650,height=500,left='+winleft+',top='+winUp+',scrollbars=yes,resizable=1';
    newwindow = window.open(xUrl, xWinName, winProp );
	if (window.focus) {newwindow.focus()}
}
function ChildPopup(xUrl,xWinName,x,y) {
var winleft = parent.screenLeft + 10;
var winUp = parent.screenTop + 10;
winProp = 'width='+x+',height='+y+',left='+winleft+',top='+winUp+',scrollbars=yes,resizable=1';
    newwindow = window.open(xUrl, xWinName, winProp );
	if (window.focus) {newwindow.focus()}
	return false;
}
function Popup(xUrl,xWinName,x,y) {
if (x == null)
{ 
var x = 500;
var y = 600;
}
var winleft = (screen.width - x) / 2;
var winUp = (screen.height - y) / 2;
winProp = 'width='+x+',height='+y+',left='+winleft+',top='+winUp+',scrollbars=yes,resizable=1';
    newwindow = window.open(xUrl.toString(), xWinName, winProp );
	if (window.focus) {newwindow.focus()}
	return false;
}
 
function Pops(xUrl,xWinName,x,y) {
if (x == null)
{ 
var x = 500;
var y = 600;
}
var winleft = (screen.width - x) / 2;
var winUp = (screen.height - y) / 2;
winProp = 'width='+x+',height='+y+',left='+winleft+',top='+winUp+',scrollbars=yes,resizable=1';
    newwindow = window.open(xUrl.toString(), xWinName, winProp );
	if (window.focus) {newwindow.focus()}
} 
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
 
function PopVid(xUrl,xWinName,x,y) {
if (x == null)
{ 
var x = 810;
var y = 620;
}
var winleft = (screen.width - x) / 2;
var winUp = (screen.height - y) / 2;
winProp = 'width='+x+',height='+y+',left='+winleft+',top='+winUp+',scrollbars=yes,resizable=1';
    newwindow = window.open(xUrl.toString(), xWinName, winProp );
	if (window.focus) {newwindow.focus()}
} 

function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}


function checkAll(checkname, exby) {
  for (i = 0; i < checkname.length; i++)
  checkname[i].checked = exby.checked? true:false
}
 
function space_pop(xUrl,xWinName,x,y) {
var winleft = (screen.width - x) / 2;
var winUp = (screen.height - y) / 2;
winProp = 'width='+x+',height='+y+',left='+winleft+',top='+winUp+',scrollbars=no,resizable=yes';
    newwindow = window.open(xUrl, xWinName, winProp );
	if (window.focus) {newwindow.focus()}
	return false;
}
    
function Wizard(xUrl,xWinName) {
var winleft = (screen.width - 725) / 2;
var winUp = (screen.height - 475) / 2;
winProp = 'width=725,height=475,left='+winleft+',top='+winUp+',scrollbars=yes,resizable=1';
    newwindow = window.open(xUrl, xWinName, winProp );
	if (window.focus) {newwindow.focus()}
	return false;
}

function getItem(e) { 
    if(typeof(e)!='string') return e;
    if(document.getElementById) e=document.getElementById(e);
    else if(document.all) e=document.all[e];
    else e=null;
    return e;
  }
  
  
function DD(id)
    {
        itm = getItem('TR'+id);
        if(!itm)
            return false;
        itm.style.display = '';
		itm = getItem('DS_'+id);
	    if(!itm)
            return false;
		itm.value = '1';
        return false;
}
function Pay_Fields(xfield,xsuffix)
    {
    		
		itm = getItem(xfield)
		xvalue = itm.value
		if (xvalue == "VISA"|xvalue == "AMEX"|xvalue == "MC"|xvalue == "DISC"|xvalue == "DINER") {HD("pay_amount"+xsuffix);HD("po_no"+xsuffix);HD("check_text"+xsuffix);HD('eft_text'+xsuffix);DD("cc_number"+xsuffix);DD("exp_date"+xsuffix);DD("cvv_code"+xsuffix);DD("card_name"+xsuffix);HD("check_no"+xsuffix);DD('merchant_key'+xsuffix);DD('manual_process'+xsuffix);DD('payment_date'+xsuffix)}
		if (xvalue == "PO") {HD("pay_amount"+xsuffix);DD("po_no"+xsuffix);HD("cc_number"+xsuffix);HD("exp_date"+xsuffix);HD("cvv_code"+xsuffix);HD("card_name"+xsuffix);HD("check_text"+xsuffix);HD('eft_text'+xsuffix);HD("check_no"+xsuffix);HD('merchant_key'+xsuffix);HD('manual_process'+xsuffix);HD('payment_date'+xsuffix)}
		if (xvalue == "CHECK") {DD("pay_amount"+xsuffix);HD("po_no"+xsuffix);HD("cc_number"+xsuffix);HD("exp_date"+xsuffix);HD("cvv_code"+xsuffix);HD("card_name"+xsuffix);HD('eft_text'+xsuffix);DD("check_text"+xsuffix);DD("check_no"+xsuffix);HD('merchant_key'+xsuffix);HD('manual_process'+xsuffix);DD('payment_date'+xsuffix)}
		if (xvalue == "LOCKBOX") {DD("pay_amount"+xsuffix);HD("po_no"+xsuffix);HD("cc_number"+xsuffix);HD("exp_date"+xsuffix);HD("cvv_code"+xsuffix);HD("card_name"+xsuffix);HD('eft_text'+xsuffix);DD("check_text"+xsuffix);DD("check_no"+xsuffix);HD('merchant_key'+xsuffix);HD('manual_process'+xsuffix);DD('payment_date'+xsuffix)}
		if (xvalue == "EFT") {DD("pay_amount"+xsuffix);HD("po_no"+xsuffix);HD("cc_number"+xsuffix);HD("exp_date"+xsuffix);HD("cvv_code"+xsuffix);HD("card_name"+xsuffix);HD("check_text"+xsuffix);DD('eft_text'+xsuffix);HD("check_no"+xsuffix);HD('merchant_key'+xsuffix);HD('manual_process'+xsuffix);DD('payment_date'+xsuffix)}
		if (xvalue == "CASH") {DD("pay_amount"+xsuffix);HD("po_no"+xsuffix);HD("cc_number"+xsuffix);HD("exp_date"+xsuffix);HD("cvv_code"+xsuffix);HD("card_name"+xsuffix);HD('eft_text'+xsuffix);HD("check_text"+xsuffix);HD("check_no"+xsuffix);HD('merchant_key'+xsuffix);HD('manual_process'+xsuffix);DD('payment_date'+xsuffix)}
		if (xvalue == "INVOICE") {HD("pay_amount"+xsuffix);HD("po_no"+xsuffix);HD("cc_number"+xsuffix);HD("exp_date"+xsuffix);HD("cvv_code"+xsuffix);HD("card_name"+xsuffix);HD('eft_text'+xsuffix);DD("check_text"+xsuffix);HD("check_no"+xsuffix);HD('merchant_key'+xsuffix);HD('manual_process'+xsuffix);HD('payment_date'+xsuffix)}
		if (xvalue == "BALANCE") {HD("pay_amount"+xsuffix);HD("po_no"+xsuffix);HD("cc_number"+xsuffix);HD("exp_date"+xsuffix);HD("cvv_code"+xsuffix);HD("card_name"+xsuffix);HD('eft_text'+xsuffix);DD("check_text"+xsuffix);HD("check_no"+xsuffix);HD('merchant_key'+xsuffix);HD('manual_process'+xsuffix);HD('payment_date'+xsuffix)}
        return false;
}
function HD(id)
    {
        itm = getItem('TR'+id);
        if(!itm)
            return false;
        itm.style.display = 'none';
		
		itm = getItem('DS_'+id);
	    if(!itm)
			 return false;
		itm.value = '0';
        return false;
}  

function HROW(id)
    {		
        itm = getItem(id);
        itm.style.display = 'none';
}  
function TD(xfield,ids)
    {
xElement = getItem(xfield);
var row_ids=ids.split(",");
var xindex=0;
while (xindex < row_ids.length)
{ 		
	var xx = row_ids[xindex];
        itm = getItem(xx);
		if (itm !== null) 
		{
		if(xElement.checked == true)
        itm.style.display = '';
		else
        itm.style.display = 'none';
		}
xindex+=1;
}		
}  
function HDIV(id)
    {
        itm = getItem(id);
        if(!itm) return false;
        itm.style.display = 'none';
}  
function DDIV(id)
    {
        itm = getItem(id);
        if(!itm) return false;
        itm.style.display = '';
}

function RFEE(ids,xmode,xvalue) {
var row_ids=ids.split(",");
var xdisplay1 = '';
var xdisplay2 = '';
var xindex=0;
while (xindex < row_ids.length)
{
if (xmode == 'hide') {xdisplay1 = 'none';xdisplay2 = ''} else {xdisplay1 = '';xdisplay2 = 'none'};
var xx = row_ids[xindex];
      itm = getItem(xx);
if (itm !== null) 
{
if (xvalue == true) {
itm.style.display = xdisplay1
} 
else {
itm.style.display = xdisplay2
}
};
field = "CB"+xx.substring(2,7);
      itm_field = getItem(field);
if (itm_field !== null && itm !== null) {
if (itm.style.display == 'none') {itm_field.checked = 0;itm_field.disabled = 0}
};
xindex+=1;
	}
   return false;
 }
function RS(ids,xmode,xvalue,xstatus) {
var row_ids=ids.split(",");
var xdisplay1 = "";
var xindex=0;
if (xmode == 'hide') {xdisplay1 = 'none'} else {xdisplay1 = ""};
if (xmode == 'toggle') { if (xstatus == true) {xdisplay1 = ""} else {xdisplay1 = 'none'}};
while (xindex < row_ids.length)
{ 
var xx = row_ids[xindex];
itm = getItem('ROW1'+xx+xvalue);
if (itm !== null) {itm.style.display = xdisplay1;} 
itm_field = getItem("DS"+xx.replace(/-/g,"_")+xvalue);
if (itm_field !== null) 
{
if (itm.style.display == 'none') {itm_field.value = 2} else {itm_field.value = 1}
}
itm = getItem('ROW2'+xx+xvalue);
if (itm !== null) {itm.style.display = xdisplay1} 
itm = getItem('ROW3'+xx+xvalue);
if (itm !== null) {itm.style.display = xdisplay1} 

xindex+=1;
	}
 }
 
function Show_Opt(id)
    {
        itm = getItem('K'+id);
        itm.style.display = '';
		if(itm.value == 'Blank') 
		itm.disabled = true;
		else
        itm.disabled = false;
        return false;
}  
function Hide_Opt(id)
    {
        itm = getItem('K'+id);
        itm.style.display = 'none';
        itm.disabled = true;
        return false;
}  

// sets layer z-index
function setZxIndex(id, z_index) {
	document.getElementById(id).style.zIndex = z_index;
}

/**
 * COMMON DHTML FUNCTIONS
 * These are handy functions I use all the time.
 *
 * By Seth Banks (webmaster at subimage dot com)
 * http://www.subimage.com/
 *
 * Up to date code can be found at http://www.subimage.com/dhtml/
 *
 * This code is free for you to use anywhere, just keep this comment block.
 */
/**
 * X-browser event handler attachment and detachment
 * TH: Switched first true to false per http://www.onlinetools.org/articles/unobtrusivejavascript/chapter4.html
 *
 * @argument obj - the object to attach event to
 * @argument evType - name of the event - DONT ADD "on", pass only "mouseover", etc
 * @argument fn - function to call
 */
function addEvent(obj, evType, fn){
 if (obj.addEventListener){
    obj.addEventListener(evType, fn, false);
    return true;
 } else if (obj.attachEvent){
    var r = obj.attachEvent("on"+evType, fn);
    return r;
 } else {
    return false;
 }
}
function removeEvent(obj, evType, fn, useCapture){
  if (obj.removeEventListener){
    obj.removeEventListener(evType, fn, useCapture);
    return true;
  } else if (obj.detachEvent){
    var r = obj.detachEvent("on"+evType, fn);
    return r;
  } else {
    alert("Handler could not be removed");
  }
}
/**
 * Code below taken from - http://www.evolt.org/article/document_body_doctype_switching_and_more/17/30655/
 *
 * Modified 4/22/04 to work with Opera/Moz (by webmaster at subimage dot com)
 *
 * Gets the full width/height because it's different for most browsers.
 */
function getViewportHeight() {
	if (window.innerHeight!=window.undefined) return window.innerHeight;
	if (document.compatMode=='CSS1Compat') return document.documentElement.clientHeight;
	if (document.body) return document.body.clientHeight; 
	return window.undefined; 
}
function getViewportWidth() {
	if (window.innerWidth!=window.undefined) return window.innerWidth; 
	if (document.compatMode=='CSS1Compat') return document.documentElement.clientWidth; 
	if (document.body) return document.body.clientWidth; 
	return window.undefined; 
}

/***********************************************
* Sticky Note script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
* Go to http://www.dynamicdrive.com/ for full source code
***********************************************/
//Specify display mode. 3 possible values are:
//1) "always"- This makes the fade-in box load each time the page is displayed
//2) "oncepersession"- This uses cookies to display the fade-in box only once per browser session
//3) integer (ie: 5)- Finally, you can specify an integer to display the box randomly via a frequency of 1/integer...
// For example, 2 would display the box about (1/2) 50% of the time the page loads.
var displaymode="always"
var enablefade="yes" //("yes" to enable fade in effect, "no" to disable)
var autohidebox=["yes", 5] //Automatically hide box after x seconds? [yes/no, if_yes_hide_after_seconds]
var showonscroll="yes" //Should box remain visible even when user scrolls page? ("yes"/"no)
var IEfadelength=1 //fade in duration for IE, in seconds
var Mozfadedegree=0.05 //fade in degree for NS6+ (number between 0 and 1. Recommended max: 0.2)
////////No need to edit beyond here///////////
if (parseInt(displaymode)!=NaN)
var random_num=Math.floor(Math.random()*displaymode)
function displayfadeinbox(){
var ie=document.all && !window.opera
var dom=document.getElementById
iebody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
objref=(dom)? document.getElementById("fadeinbox") : document.all.fadeinbox
var scroll_top=(ie)? iebody.scrollTop : window.pageYOffset
var docwidth=(ie)? iebody.clientWidth : window.innerWidth
docheight=(ie)? iebody.clientHeight: window.innerHeight
var objwidth=objref.offsetWidth
objheight=objref.offsetHeight
objref.style.left=docwidth/2-objwidth/2+"px"
objref.style.top=scroll_top+docheight/2-objheight/2+"px"
if (showonscroll=="yes")
showonscrollvar=setInterval("staticfadebox()", 50)
if (enablefade=="yes" && objref.filters){
objref.filters[0].duration=IEfadelength
objref.filters[0].Apply()
objref.filters[0].Play()
}
objref.style.visibility="visible"
if (objref.style.MozOpacity){
if (enablefade=="yes")
mozfadevar=setInterval("mozfadefx()", 90)
else{
objref.style.MozOpacity=1
controlledhidebox()
}
}
else
controlledhidebox()
}
function mozfadefx(){
if (parseFloat(objref.style.MozOpacity)<1)
objref.style.MozOpacity=parseFloat(objref.style.MozOpacity)+Mozfadedegree
else{
clearInterval(mozfadevar)
controlledhidebox()
}
}
function staticfadebox(){
var ie=document.all && !window.opera
var scroll_top=(ie)? iebody.scrollTop : window.pageYOffset
objref.style.top=scroll_top+docheight/2-objheight/2+"px"
}
function hidefadebox(){
objref.style.visibility="hidden"
if (typeof showonscrollvar!="undefined")
clearInterval(showonscrollvar)
}
function controlledhidebox(){
if (autohidebox[0]=="yes"){
var delayvar=(enablefade=="yes" && objref.filters)? (autohidebox[1]+objref.filters[0].duration)*1000 : autohidebox[1]*1000
setTimeout("hidefadebox()", delayvar)
}
}
function initfunction(){
setTimeout("displayfadeinbox()", 100)
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = ""
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset)
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function popup2(theURL,winName){
window.open(theURL,winName,"toolbar=no,titlebar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,fullscreen=no,scrollbars=yes,width=650,height=475,top=25,left="+(screen.width-650)/2);
}
function sp(booth) {
	ExhibitorPopup("profile.cfm?xtemplate=3&exhibitor="+booth,"exhibitor_profile");
}
function test_alert()
{
}
function toggle_image(obj,image1,image2)
    {
		if (obj.src.match(image1) == null) 
      		  obj.src = image1;
		else
      		  obj.src = image2;
			 
}  
function textCounter(field, countfield, maxlimit, type) {
		if (type == 1) { charCounter(field, countfield, maxlimit) }
		if (type == 2) { wordCounter(field, countfield, maxlimit) }
		if (type == 3) { wordCounter(field, countfield, maxlimit) }
	}
	
function textCount(field, countfield, maxlimit, type) {
		if (type == 1) { charCount(field, countfield, maxlimit) }
		if (type == 2) { wordCount(field, countfield, maxlimit) }
		if (type == 3) { wordCount(field, countfield, maxlimit) }
	}
function checkSubmit() {
	var submitcount = 0;
	if (submitcount == 0) {
		submitcount++;
		document.CharCount.submit();
	}
}	
	
function wordCounter(field, countfield, maxlimit) {
		var wentover = 0;
		obj = field;
		wordcounter = 1;
		// char-151 is n-dash don't count that as a word
		for (x=0; x < obj.value.length; x++) {
			if (obj.value.charAt(x) == " " && obj.value.charAt(x-1) != " " && obj.value.charAt(x-1) != char(151)) {
				wordcounter++;
			}
			if (wordcounter > (maxlimit)) {
				countfield.value = 0;
				obj.className = 'bglimit'; 
				wordwarn.innerText = "OVER THE LIMIT OF " + maxlimit + " WORDS WITH " + wordcounter + "!";
				wentover = 1;
			}
			else {
				countfield.value = (maxlimit) - wordcounter;
				if (wentover==1 && wordcounter <= maxlimit) {
					obj.className = '';
					wordwarn.innerText=" ";
					wentover=0;
				}
			}
		}
	}
	
function wordCount(textFieldId,counterFieldId, wordLimit){ 
     var numOfWords = textFieldId.value.split(" ").length;
	 if (wordLimit >= numOfWords){
     	counterFieldId.value = wordLimit - numOfWords; 
	}
	else {
		counterFieldId.value = 0;
		alert("The word limit is " + wordLimit + ".");
	}
}
function charCounter(field, countfield, maxlimit) {
		obj = field;
		if (obj.value.length > (maxlimit-1)) {
			countfield.value = 0;
			obj.className = 'bglimit';
			wordwarn.innerText = "OVER THE LIMIT OF " + maxlimit + " CHARACTERS!";
		}
		else {
			countfield.value = (maxlimit-1) - obj.value.length;
			if (wordwarn.innerText.length > 0)
			{
			wordwarn.innerText = "";
			obj.className = "";
			}
		}
	}
function charCount(field, countfield, maxlimit) {
		obj = field;
		if (obj.value.length > (maxlimit)) {
			countfield.value = 0;
			obj.className = 'bglimit';
			wordwarn.innerText = "OVER THE LIMIT OF " + maxlimit + " CHARACTERS!";
		}
		else {
			countfield.value = (maxlimit) - obj.value.length;
			if (wordwarn.innerText.length > 0)
			{
			wordwarn.innerText = "";
			obj.className = "";
			}
		}
	}
	
function showField(xValue,xfield)
{
var choice = xValue;
if(choice == "US"|choice == "")
{
getItem('state-list1'+xfield).style.display = "";
getItem('state-text'+xfield).style.display = "none";
itm = getItem('ST_state'+xfield);
if(itm) (itm.value = 1);
itm = getItem('ST_po_state'+xfield);
if(itm) (itm.value = 1);
}
else
{
getItem('state-list1'+xfield).style.display = "none";
getItem('state-text'+xfield).style.display = "";
itm = getItem('ST_state'+xfield);
if(itm) (itm.value = 2);
itm = getItem('ST_po_state'+xfield);
if(itm) (itm.value = 2);
}
}

//START : hiding, disable, show fees for feeshow custom tag 	
function Cloak1(ids,mode,hdr,xvalue,xsuffix) {
	var row_ids=ids.split(",");
	var xindex=0;
	while (xindex < row_ids.length)
 	{
		if (mode == 'hide') {mode1 = 'none';mode2 = ''} else {mode1 = '';mode2 = 'none'}
		var xx = "R"+row_ids[xindex];
        itm = getItem(xx);
		if (itm !== null) {if (xvalue == true) {itm.style.display = mode1} else {itm.style.display = mode2}
		};
		field = "FEE"+row_ids[xindex];
        itm_field = getItem(field);
		if (itm_field !== null) {if (itm.style.display == 'none') {itm_field.checked = 0;itm_field.disabled = 0}
		};
		xindex+=1;
  	}
	
	var xindex=0;
	xcheck_done_ids = "";
	while (xindex < row_ids.length)
 	{
//start check all the row for this fee and hide the hdr if all fee row are hidden		
	xheader = row_ids[xindex].substring(0,3)+xsuffix;
	if (xcheck_done_ids.match(xheader) == null)
	{	
	xcheck_done_ids = xcheck_done_ids.concat(xheader,"-");
	f = document.forms[0];
	xcounter = 0
	xhidden_row = 0
	for(i=0; i<f.elements.length;i++)
		{
		if(f.elements[i].type=="checkbox" && f.elements[i].id.substring(0,6)=="FEE"+xheader)
		{
		var xx = "R"+f.elements[i].id.substring(3,40);
        itm = getItem(xx);
		if (itm.style.display == 'none') {xhidden_row = xhidden_row + 1};
		xcounter = xcounter + 1;
		}
		}
		if (xcounter == xhidden_row) 
		{
		var xx = "HDR"+xheader;
        itm = getItem(xx);
		itm.style.display = "none";
		} else
		{
		var xx = "HDR"+xheader;
        itm = getItem(xx);
		itm.style.display = "";
		}
	}	
//end check all the row for this fee and hide the hdr if all fee row are hidden		
		
		xindex+=1;
  	}
	
     return false;
    }
	
function HideHdr(hdr)
{
  var oTable = 	getItem('fee_table')
  var rows=oTable.rows;
  for(var i=0;i<rows.length;i++)
  {	if (rows[i].id == hdr) {
 // 	alert(rows[i].id);
	rows[i].style.display = "none";
	};
//    if(i%2==0) {
//     rows[i].style.backgroundColor = "black";
//      rows[i].style.color = "white";
//    } else {
//      rows[i].style.backgroundColor = "white";
//     rows[i].style.color = "black";
//    }
  }
}		
	
	
function Cloak(currentCheckBox,xGroup_header,xradio_group)
{
itm = getItem(currentCheckBox);
f = document.forms[0];
for(i=0; i<f.elements.length;i++)
{
if(f.elements[i].type=="checkbox" && xradio_group !== 0 && f.elements[i].name.substring(0,6)==itm.name.substring(0,6))
{
if (f.elements[i].id==itm.id) {continue} else {f.elements[i].disabled=itm.checked;f.elements[i].checked=false;}
}
}
}
//END : hiding, disable, show fees for showfees custom tag 	
function gen_popup(theURL,winName,features) {window.open(theURL,winName,features)}

// raju 08/14/08 testing of ajax callback functions 
function ajax_callback(result)
{
	return
 }


