
function EnterToTab(event) { // use as onKeyDown handler to change enter to tab for IE
	if(event.keyCode==13 && !event.which) event.keyCode=9;
}
			
function EnterTo(event) { // use as onKeyPress handler to quash enter for FF, others..
	if(event.which==13) {event.stopPropagation(); event.preventDefault();}
}

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 - 975) / 2;
var winUp = (screen.height - 675) / 2;
winProp = 'width=975,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 - 975) / 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=975,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,url=no,location=no';
    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 setImageOpacity(xField,xopacity)
{
	itmImage=getItem(xField);
	if (itm) {
		itmImage.style.MozOpacity = xopacity / 100;
		itmImage.style.opacity = xopacity / 100;
		browser_detect = navigator.userAgent.toLowerCase();
		if (browser_detect.indexOf("msie") + 1) 
			itmImage.filters.alpha.opacity = xopacity;
	}
}
function resetCC()
{
	itm=getItem('cc_VISA');
	if (itm)
		setImageOpacity('cc_VISA',15);
	itm=getItem('cc_MC');
	if (itm)
		setImageOpacity('cc_MC',15);
	itm=getItem('cc_AMEX');
	if (itm)
		setImageOpacity('cc_AMEX',15);
	itm=getItem('cc_DISC');
	if (itm)
		setImageOpacity('cc_DISC',15);
	itm=getItem('cc_DINER');
	if (itm)
		setImageOpacity('cc_DINER',15);
	itm=getItem('cc_ENROUTE');
	if (itm)
		setImageOpacity('cc_ENROUTE',15);
	itm=getItem('cc_JCB');
	if (itm)
		setImageOpacity('cc_JCB',15);
	itm=getItem('cc_IMPAC');
	if (itm)
		setImageOpacity('cc_IMPAC',15);
	itm=getItem('cc_CARTE');
	if (itm)
		setImageOpacity('cc_CARTE',15);
}
function CCTypeID(xField,xsuffix)
{
			resetCC();
			itm = getItem(xField);
			xvalue = itm.value;
			char1 = xvalue.substring(0,1);
			char2 = xvalue.substring(0,2);
			char3 = xvalue.substring(0,3);
			char4 = xvalue.substring(0,4);
			itmPay = getItem('payment_method'+xsuffix);
			
            if (char1 == '4') {
				itmPay.Value = 'VISA';
				itm=getItem('cc_VISA');
				if (itm)
					setImageOpacity('cc_VISA',100);
			}
           
            if (char2 == '34' || char2 == '37') {
				itmPay.Value = 'American Express';
				itm=getItem('cc_AMEX');
				if (itm)
					setImageOpacity('cc_AMEX', 100);
			}
           
            if (char2 == '51' || char2== '52' || char2== '53' || char2== '54' || char2== '55') {
				itmPay.Value = 'MasterCard';
				itm=getItem('cc_MC');
				if (itm)
					setImageOpacity('cc_MC', 100);
			}
 			
			if (char4 == '6011') {
				itmPay.Value = 'DISC';
				itm=getItem('cc_DISC');
				if (itm)
					setImageOpacity('cc_DISC', 100);
			}
			if (char4 == '2014' || char4 == '2149') {
				itmPay.Value = 'ENROUTE';
				itm=getItem('cc_ENROUTE');
				if (itm)
					setImageOpacity('cc_ENROUTE', 100);
			}
			if (char4 == '2131' || char4 == '1800' || char1 == '3') {
				itmPay.Value = 'JCB';
				itm=getItem('cc_JCB');
				if (itm)
					setImageOpacity('cc_JCB', 100);
			}
			if (char3 == '300' || char3 == '301'|| char3 == '302'|| char3 == '303'|| char3 == '304'|| char3 == '305' || char2 == '36' || char2 =='38') 
			{
				itmPay.Value = 'DINER';
				itm=getItem('cc_DINER');
				if (itm)
					setImageOpacity('cc_DINER', 100);
			}
			
           
}
function Pay_Fields(xfield,xsuffix)
    {
    		
		itm = getItem(xfield)
		xvalue = itm.value
		if (xvalue == "CreditCard"|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);HD('batch_number'+xsuffix);DD('address1_bill'+xsuffix);DD('city_bill'+xsuffix);DD('state_bill'+xsuffix);DD('zip_code_bill'+xsuffix);DD('billing_address'+xsuffix);DD('country_bill'+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);HD('batch_number'+xsuffix);HD('address1_bill'+xsuffix);HD('city_bill'+xsuffix);HD('state_bill'+xsuffix);HD('zip_code_bill'+xsuffix);HD('billing_address'+xsuffix);HD('country_bill'+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);DD('batch_number'+xsuffix);change_label("check_no"+xsuffix,'Check Number');HD('address1_bill'+xsuffix);HD('city_bill'+xsuffix);HD('state_bill'+xsuffix);HD('zip_code_bill'+xsuffix);HD('billing_address'+xsuffix);HD('country_bill'+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);DD('batch_number'+xsuffix);HD('address1_bill'+xsuffix);HD('city_bill'+xsuffix);HD('state_bill'+xsuffix);HD('zip_code_bill'+xsuffix);HD('billing_address'+xsuffix);HD('country_bill'+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);DD('batch_number'+xsuffix);HD('address1_bill'+xsuffix);HD('city_bill'+xsuffix);HD('state_bill'+xsuffix);HD('zip_code_bill'+xsuffix);HD('billing_address'+xsuffix);HD('country_bill'+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);DD('batch_number'+xsuffix);HD('address1_bill'+xsuffix);HD('city_bill'+xsuffix);HD('state_bill'+xsuffix);HD('zip_code_bill'+xsuffix);HD('billing_address'+xsuffix);HD('country_bill'+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);HD('batch_number'+xsuffix);HD('address1_bill'+xsuffix);HD('city_bill'+xsuffix);HD('state_bill'+xsuffix);HD('zip_code_bill'+xsuffix);HD('billing_address'+xsuffix);HD('country_bill'+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);HD('batch_number'+xsuffix);HD('address1_bill'+xsuffix);HD('city_bill'+xsuffix);HD('state_bill'+xsuffix);HD('zip_code_bill'+xsuffix);HD('billing_address'+xsuffix);HD('country_bill'+xsuffix)}
		if (xvalue == "VOUCHER") {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);DD('batch_number'+xsuffix);change_label("check_no"+xsuffix,'Voucher Number');HD('address1_bill'+xsuffix);HD('city_bill'+xsuffix);HD('state_bill'+xsuffix);HD('zip_code_bill'+xsuffix);HD('billing_address'+xsuffix);HD('country_bill'+xsuffix)}
		if (xvalue == "INVOICED") {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);DD('batch_number'+xsuffix);change_label("check_no"+xsuffix,'Invoice Number');HD('address1_bill'+xsuffix);HD('city_bill'+xsuffix);HD('state_bill'+xsuffix);HD('zip_code_bill'+xsuffix);HD('billing_address'+xsuffix);HD('country_bill'+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 change_label(id,xlabel)
    {
        itm = getItem('TD'+id);
        if(!itm)
            return false;
        itm.innerHTML = xlabel;
        return false;
}  

function HROW(id)
    {		
        itm = getItem(id);
        itm.style.display = 'none';
}  


function TD(xfield,ids,xmode)
    {
xElement = getItem("ID_" + xfield);
var row_ids=ids.split(",");
var xindex=0;
while (xindex < row_ids.length)
{ 		
		var xx = row_ids[xindex];
		var xchecked_mode = ""; 
		var xunchecked_mode = "none"; 
		if (xmode == "not") {xchecked_mode = "none"; xunchecked_mode = "";}	

        itm = getItem(xx);
		if (itm !== null) 
		{
		if(xElement.checked == true)
		{
        itm.style.display = xchecked_mode;
		xfield = getItem('DS_'+xx.substring(2));	
		if (xfield !== null) {xfield.value = '1'};
		}
		else
		{
        itm.style.display = xunchecked_mode;
		xfield = getItem('DS_'+xx.substring(2)); 
		if (xfield !== null) {xfield.value = '0'};
		}
		}
xindex+=1;
}		
}  

function Toggle_Pulldown(xfield,ids,xkey_list,xmode)
    {
xElement = getItem(xfield).value;
var row_ids=ids.split(",");
var xindex=0;
while (xindex < row_ids.length)
{ 		
		var xx = row_ids[xindex];
		var xchecked_mode = ""; 
		var xunchecked_mode = "none"; 
		if (xmode == "not") {xchecked_mode = "none"; xunchecked_mode = "";}	

        itm = getItem(xx);
		if (itm !== null) 
		{
		if(xkey_list.indexOf(xElement) != -1)
		{
        itm.style.display = xchecked_mode;
		xfield = getItem('DS_'+xx.substring(2));	
		if (xfield !== null) {xfield.value = '1'};
		}
		else
		{
        itm.style.display = xunchecked_mode;
		xfield = getItem('DS_'+xx.substring(2)); 
		if (xfield !== null) {xfield.value = '0'};
		}
		}
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;
}

// open links in parent window (from child)
function loadinparent(url){
	self.opener.location = url;
}


/***********************************************
* 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);
}

//added inv_mast_key to cause exhibitor profile to react to setup parameters from live map popup, Justin, 10/9/09 for ST 108500
inv_mast_key='y';

function sp(booth) {
	ExhibitorPopup("profile.cfm?xtemplate=3&inv_mast_key="+inv_mast_key+"&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 toggle_label(obj,label1,label2)
    {
		if (obj.value.match(label1) == null) 
      		  obj.value = label1;
		else
      		  obj.value = label2;
			 
}  

function toggle_row(obj,image1,image2,xrow)
{

	xItem = getItem(xrow);
	if (xItem !== null) 
		{
		if(xItem.style.display == "none")
		{
        xItem.style.display = '';
		}
		else
		{
        xItem.style.display = 'none';
		}
		}

		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 cWhitespace = ' \t\n\r';
    var nState = 0; // 0 - start, 1 - whitespace, 2 - word
	var numOfWords = 0;
	var cText = textFieldId.value;
	var n;
	var nLength = cText.length;
	var c;
	for (n = 0; n < nLength; n++) {
		c = cText.charAt(n);
		switch (nState) {
			case 0:
			case 1:
				if (cWhitespace.indexOf(c) == -1) {
					numOfWords++;
					nState = 2;
				} else {
					nState = 1;
				}
				break;
				
			case 2:
				if (cWhitespace.indexOf(c) != -1) {
					nState = 1;
				}
				break;
		}
	}	
	 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,xrequired_flag)
{

var choice = xValue;
/* 11/4/2011 - Ami added for ST D10404 */
if(choice == "US"|choice == "" |choice=="CA")
{
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);
// start sagar 07-15-2010 required field is set only if it is required because the zip code was getting set by default even if the required field is not mark read. 
if (xrequired_flag == "yes")
{
itm = getItem('TDzip_code'+xfield);
if(itm) (itm.className = "cellReq");
}
//end sagar
}
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 Jeff 01-26-2010, added these lines to turn the state field from required red to cellGrad like other non-required fields
itm = getItem('state'+xfield+'_td');
if(itm) (itm.className = "cellGrad");
// end jeff
itm = getItem('TDzip_code'+xfield);
if(itm) (itm.className = "cellGrad");
}
}

//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	
	/* 03/09/2011 - ami commented the line below because he header did not work correctly when on the guest or with a suffix*/	
	//adding the suffix back when deciding the actual display of the header (ST 125059) 
	//xheader = row_ids[xindex].substring(0,3)+xsuffix;
	xheader = row_ids[xindex].substring(0,3);
	if (xcheck_done_ids.match(xheader) == null)
	{	
	xcheck_done_ids = xcheck_done_ids.concat(xheader,"-");
	f = document.forms[0];
	xcounter = 0 //total no. of fees within a header
	xhidden_row = 0 //total hidden fees within a header
	for(i=0; i<f.elements.length;i++)
		{
		
		if((f.elements[i].type=="checkbox" || f.elements[i].type=="text") && f.elements[i].id.substring(0,6)=="FEE"+xheader)
		{
			//var xx = "R"+f.elements[i].id.substring(3,40);
			//ami replaced the above statement with lines below for ST 122935
			//the above line was not true for all the form elements hence the modification by adding right attributes to 
			//every form variable assiciated with fee. look for esKey and esDisrow in feeshow tag.
			
			//replace the -'s in key id ; /-/ = regular expression ; g = global (replace all accurences)
			xkeyId = f.elements[i].getAttribute("eskey").replace(/-/g,""); 
			var xx ="R"+xheader + xkeyId + f.elements[i].getAttribute("esDisRow")+xsuffix;
			
			itm = getItem(xx);
			if (itm !== null) 
			{
				if (itm.style.display == 'none') 
				{
					xhidden_row = xhidden_row + 1
				};
			}
			xcounter = xcounter + 1;
			
		}
		
		}//end of for
		//ami added the suffix to the header to look at teh right field
		xheader = row_ids[xindex].substring(0,3)+xsuffix;
		if (xcounter == xhidden_row) //this means if all the fee within a header are hidden then hide teh row
		{
			var xx = "HDR"+xheader;
        	itm = getItem(xx);
			if (itm !== null) {itm.style.display = "none";}
		}
		else
		{
			var xx = "HDR"+xheader;
      	  	itm = getItem(xx);
			if (itm !== null) {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,xform_name)
{
if (xform_name == null) {xform_number=0} else {xform_number=1};
itm = getItem(currentCheckBox);
f = document.forms[xform_number];

for(i=0; i<f.elements.length;i++)
{
if (f.elements[i].type == "checkbox") {
	var xname = itm.name.substring(0, 6);
	if (f.elements[i].name.substring(0, 6) == xname && "disabl" !== xname) {
		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 SessionConflict(currentCheckBox,xmode)
{
itm = getItem(currentCheckBox);
/*
10/28/2011 - Ami commented the original code and replaced the code with following for construct. ST A10101
*/
for(idate=1; idate<5; idate++)
{
		if (itm.getAttribute("esStart" + idate) != null) {
			var xd1 = new Date(itm.getAttribute("esStart" + idate));
			var xd2 = new Date(itm.getAttribute("esEnd" + idate));
			
			f = document.forms[0];
			for (i = 0; i < f.elements.length; i++) {
				var e = f.elements[i];
				if (e.type == "checkbox" && e.id !== itm.id) {
					var xname = e.name.substring(0, 8);
					if (xname != "disabled") {
						for(xdate=1;xdate<5;xdate++) {
							if(e.getAttribute("esStart"+xdate) != null){
								var x1 = new Date(e.getAttribute("esStart"+xdate));
								var x2 = new Date(e.getAttribute("esEnd"+xdate));
								if ((xd1 >= x1 && xd1 < x2) || (xd2 > x1 && xd2 <= x2) || (xd1 <= x1 && xd2 >= x2)) {
										e.disabled = itm.checked
										/* 11/4/2011 - Ami added code to collapse the conflicting session originally for ST 125598*/
										if (xmode == 'hide') {
											var xx = "R" + e.name;
											xitm = getItem(xx);
											if (xitm !== null) {
												if (itm.checked) {
													xitm.style.display = "none";
													e.checked = 0;
												}
												else 
													xitm.style.display = "";
											}
										}
								}
							}
						}
						
						
					};
				}
			}
		}
}

/*

var xd1 = new Date(itm.getAttribute("esStart"));
var xd2 = new Date(itm.getAttribute("esEnd"));
f = document.forms[0];
for(i=0; i<f.elements.length;i++)
{
var e = f.elements[i];
if (e.type == "checkbox" && e.id !== itm.id) {
	var xname = e.name.substring(0,8);
	if (xname != "disabled") {
		var x1 = new Date(e.getAttribute("esStart"));
		var x2 = new Date(e.getAttribute("esEnd"));
		if ((xd1 >= x1 && xd1 < x2) || (xd2 > x1 && xd2 <= x2) || (xd1 <= x1 && xd2 >= x2)) {
			e.disabled = itm.checked
			}
	};
}
}
*/

}
//END : session datetime conflict checking 	

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
 }

function div_content(div_name,content){
		div_object = document.getElementById(div_name);
		div_object.innerHTML = content;
		return
	}


<!--
/* OS / Browser Detect. Written by Joe McCormack. www.virtualsecrets.com */
var net_browser = 0;
function wbrowsertype() {
/*
__ net_browser flag values based on OS/Browser __
0 = Undetermined OS / Browser
17 = Undetermined OS / Browser
MAC OS:
2 = Unknown Browser
3 = Internet Explorer
4 = Safari
5 = Firefox
6 = Netscape
7 = Opera
8 = Camino
9 = Firebird
26 = Google Chrome
WINDOWS OS:
10 = Unknown Browser
11 = Internet Explorer
12 = Firefox
13 = Netscape
14 = Opera
15 = Camino
16 = Firebird
25 = Google Chrome
UNKNOWN OS:
17 = Unknown Browser
18 = Safari
19 = Internet Explorer
20 = Firefox
21 = Netscape
22 = Opera
23 = Camino
24 = Firebird
27 = Google Chrome
*/
var btfound = 0; browser_detect = navigator.userAgent.toLowerCase();
if ((browser_detect.indexOf("konqueror") + 1)) { btfound = 1; net_browser = 1; }
if ((browser_detect.indexOf("mac_powerpc") + 1)) { btfound = 1; net_browser = 3; }
if (btfound == 0) {
// MAC OS
if ((browser_detect.indexOf("macintosh") + 1)) {
if ((browser_detect.indexOf("safari") + 1)) { btfound = 1; net_browser = 4; }
else if ((browser_detect.indexOf("firefox") + 1)) { btfound = 1; net_browser = 5; }
else if ((browser_detect.indexOf("netscape") + 1)) { btfound = 1; net_browser = 6; }
else if ((browser_detect.indexOf("opera") + 1)) { btfound = 1; net_browser = 7; }
else if ((browser_detect.indexOf("camino") + 1)) { btfound = 1; net_browser = 8; }
else if ((browser_detect.indexOf("firebird") + 1)) { btfound = 1; net_browser = 9; }
else if ((browser_detect.indexOf("chrome") + 1)) { btfound = 1; net_browser = 26; }
else { btfound = 1; net_browser = 2; }
}
// Windows OS
if ((browser_detect.indexOf("windows") + 1) && btfound == 0) {
if ((browser_detect.indexOf("msie") + 1)) { btfound = 1; net_browser = 11; }
else if ((browser_detect.indexOf("firefox") + 1)) { btfound = 1; net_browser = 12; }
else if ((browser_detect.indexOf("netscape") + 1)) { btfound = 1; net_browser = 13; }
else if ((browser_detect.indexOf("opera") + 1)) { btfound = 1; net_browser = 14; }
else if ((browser_detect.indexOf("camino") + 1)) { btfound = 1; net_browser = 15; }
else if ((browser_detect.indexOf("firebird") + 1)) { btfound = 1; net_browser = 16; }
else if ((browser_detect.indexOf("chrome") + 1)) { btfound = 1; net_browser = 25; }
else { btfound = 1; net_browser = 10; }
}
// Unknown OS
if (btfound == 0) {
if ((browser_detect.indexOf("safari") + 1)) { net_browser = 18; }
else if ((browser_detect.indexOf("msie") + 1)) { net_browser = 19; }
else if ((browser_detect.indexOf("firefox") + 1)) { net_browser = 20; }
else if ((browser_detect.indexOf("netscape") + 1)) { net_browser = 21; }
else if ((browser_detect.indexOf("opera") + 1)) { net_browser = 22; }
else if ((browser_detect.indexOf("camino") + 1)) { net_browser = 23; }
else if ((browser_detect.indexOf("firebird") + 1)) { net_browser = 24; }
else if ((browser_detect.indexOf("chrome") + 1)) { net_browser = 27; }
else { net_browser = 17; }
}
}
/* In most cases, Google Chrome will behave the same as Firefox. If not you can remove these value overwrites. */
if (net_browser == 25) { net_browser = 12; }
else if (net_browser == 26) { net_browser = 5; }
else if (net_browser == 27) { net_browser = 20; }
}
//-->

	
