<!--//

//var popUpWidth = parseInt(document.getElementById('booth'+e.id).value.length) *3;
var popUpWidth = 200;//parseInt(popUp.style.width);set default
var popUpHeight = 70;//parseInt(popUp.style.height);
//BEGIN DISABLE RIGHT CLICK 
var message="Sorry, right-click has been disabled"; 
/////////////////////////////////// 
function clickIE() {if (document.all) {(message);return false;}} 
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) { 
if (e.which==2||e.which==3) {(message);return false;}}} 
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} 
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} 

document.oncontextmenu=new Function("return false") 
//--END OF DISABLE RIGHT CLICK
// Browser Detection Javascript

function getBrowserVersion() {
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("opera") != -1) return 'Opera';
if (agt.indexOf("staroffice") != -1) return 'Star Office';
if (agt.indexOf("webtv") != -1) return 'WebTV';
if (agt.indexOf("beonex") != -1) return 'Beonex';
if (agt.indexOf("chimera") != -1) return 'Chimera';
if (agt.indexOf("netpositive") != -1) return 'NetPositive';
if (agt.indexOf("phoenix") != -1) return 'Phoenix';
if (agt.indexOf("firefox") != -1) return 'Firefox';
if (agt.indexOf("safari") != -1) return 'Safari';
if (agt.indexOf("skipstone") != -1) return 'SkipStone';
if (agt.indexOf("msie") != -1) return 'IE';
if (agt.indexOf("netscape") != -1) return 'Netscape';
if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
if (agt.indexOf('\/') != -1) {
if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
return navigator.userAgent.substr(0,agt.indexOf('\/'));}
else return 'Netscape';} else if (agt.indexOf(' ') != -1)
return navigator.userAgent.substr(0,agt.indexOf(' '));
else return navigator.userAgent;
}
//END BROWSER DETECTION FUNCTION

var offsetxpoint=-190 //Customize x offset of tooltip
var offsetypoint=-200 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
/*if (ie||ns6)
var popUpObj=document.all? document.all["exNameBox"] : document.getElementById? document.getElementById("exNameBox") : ""
*/
function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}


//*****BEGIN SCROLLING OFFSET FUNCTIONS

function f_scrollLeft() {
	return f_filterResults (
		window.pageXOffset ? window.pageXOffset : 0,
		document.documentElement ? document.documentElement.scrollLeft : 0,
		document.body ? document.body.scrollLeft : 0
	);
}
function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}
//****END SCROLLING OFFSET FUNCTIONS
//added 8-4-11 by JKyle
//booth price is displayed based on variable set in _vtConfig
//added per APAP request
var boothTotalCost;
var blnDisplayCost = 'false';
if (document.getElementById('txtDisplayBoothPrice')){
    if(document.getElementById('txtDisplayBoothPrice') != ''){
        blnDisplayCost = document.getElementById('txtDisplayBoothPrice').value.toLowerCase();
    }
}

//***SHOW getPopUpText FUNCTION 
function getPopUpText(e,bMsg){
   
    
    var popText;
    if(document.getElementById('booth'+e.id))
	{
	    
		//alert(parseInt(document.body.scrollHeight));
		var boothSize = document.getElementById('boothSize'+e.id).value;
		var boothCost = document.getElementById('boothCost'+e.id).value;
		
		var boothCorners;
		var boothCornerFee;
		var boothCornerCostTotal;
		//var boothTotalCost;
		if(document.getElementById('boothCorners'+e.id)){
		    boothCorners = document.getElementById('boothCorners'+e.id).value.toLowerCase();
		    if(isNaN(boothCorners)){
		       boothCorners = 0;
		    }
		}
		else{
		  boothCorners  = 0;
		}  
		
		if(document.getElementById('txtBoothCornerFee')){
		    boothCornerFee = document.getElementById('txtBoothCornerFee').value;
		}
		else{
		    boothCornerFee = 0;
		}
		
		if (!(boothCost=='' && boothCost==0)){
		    //check number of corners
		    boothCornerCostTotal = boothCorners*boothCornerFee;
		    if(boothCorners>0 && boothCornerFee > 0){
		        boothCornerCostTotal = parseInt(boothCorners) * parseInt(boothCornerFee);
		    }
		    else{
		        boothCornerCostTotal = 0;
		    }
		 
		   //need to strip out commas from boothCost value
		   boothCost = boothCost.replace(',','');
		    if(boothCost == 0){
		        boothTotalCost = '';
		    }
            else{
                 boothTotalCost = formatCurrency(parseInt(boothCornerCostTotal) + parseInt(boothCost));
		   
		        if((parseInt(boothCornerCostTotal) + parseInt(boothCost))==0){
		        boothTotalCost = '';
		        }
		        else{
		        //removed because booth cost cannot be calculated without regtype information that has
		        //been defined via CIACI ver 2+
		        //for clients that have different prices based on reg or member type, we have to hide this
		        if(blnDisplayCost == 'true'){
		            boothTotalCost = boothTotalCost = '<br>Price: ' + boothTotalCost.replace('.00','');
		        }
		        else{
		            boothTotalCost = '';//boothTotalCost = '<br>Price: ' + boothTotalCost.replace('.00','');
		        }
		    
		    }
        }	  
	}
	else{
		    boothTotalCost = '';
	}
	if(bMsg == false){
		    popText=document.getElementById('booth'+e.id).value +'<br>Booth '+ e.id + '<br>Size: ' + boothSize + boothTotalCost;
	}
	else{
	    popText = msg;
	}
}
else{
    popText = 'This booth is still available';
}
return(popText);
}//end function	
//***END getPopUpText FUNCTION
//************************

//***BEGIN SHOWPOPUP FUNCTION
function ddrivetip(thetext, thecolor, thewidth){
var popUpObj=document.getElementById('exNameBox');
if (ns6||ie){
if (typeof thewidth!="undefined") popUpObj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") popUpObj.style.backgroundColor=thecolor
popUpObj.innerHTML=thetext
enabletip=true
return false
}
}

function showExhibitor(e,msg,xPos,yPos){
    var popUpColor;
    if(document.getElementById('txtPopUpColor')){
        popUpColor = document.getElementById('txtPopUpColor');
    }
    else{
        popUpColor = 'gold';
    }
    var bMsg = false;
    if(msg == null || msg == ''){
        bMsg = false;
    }
    else{
    bMsg = true;
    }
    var popText = getPopUpText(e,msg)
    //size popup based on number of characters
    //added by JK, 5-15-09
    if(boothTotalCost==''){
        if(popText.length <= 50){
            popUpWidth = 120;
        }
        else if(popText.length > 50 && popText.length <= 70){
            popUpWidth = 200;
        }
        else if(popText.length > 70 && popText.length <=100){
        popUpWidth = 310;
       }
       else if(popText.length > 100){
        popUpWidth = 340;
       }
    }
    else{
        popUpWidth = 120;
    }
   
        
  
    //return false;
    ddrivetip(popText,popUpColor,popUpWidth)
    
    positionPopUp(e)
}
//***BEGIN positinoPopUp FUNCTION
function positionPopUp(e){
var popUpObj=document.getElementById('exNameBox');
var scrollXOffset = parseInt(f_scrollLeft   ())
var scrollYOffset = parseInt(f_scrollTop   ())
if(!(boothTotalCost=='')){//move message up
   offsetypoint =  -200;
}
//alert('scrollXOffset: ' +scrollXOffset + '\nscrollYOffset: ' +scrollYOffset);

if (enabletip){
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//var curX=(ns6)?e.pageX : event.clientX+scrollXOffset;
//var curY=(ns6)?e.pageY : event.clientY+scrollYOffset;

//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20
//var topEdge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<popUpObj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
popUpObj.style.left=ie? ietruebody().scrollLeft+event.clientX-popUpObj.offsetWidth+"px" : window.pageXOffset+e.clientX-popUpObj.offsetWidth+"px"
else if (curX<leftedge)
popUpObj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
popUpObj.style.left=curX+offsetxpoint+"px"
//alert('scrollYOffset: ' + scrollYOffset+ 'curY: '+curY);
//same concept with the vertical position
if (curY-popUpObj.offsetHeight<ietruebody().scrollTop-offsetypoint){
   //alert('high');
    popUpObj.style.top=ie? ietruebody().scrollTop+event.clientY+popUpObj.offsetHeight+offsetypoint+50+"px" : window.pageYOffset+e.clientY+popUpObj.offsetHeight+offsetypoint+50+"px"
    }
    else if(bottomedge<popUpObj.offsetHeight)
    popUpObj.style.top=ie? ietruebody().scrollTop+event.clientY-popUpObj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-popUpObj.offsetHeight-offsetypoint+"px"
    else
    popUpObj.style.top=curY+offsetypoint+"px"
    popUpObj.style.visibility="visible"
    }
    }
//***END positionPopUp FUNCTION

//****CREATE POPUP**********
positionPopUp()
//**************************


function mouseOutCmd(){
var popUpObj=document.getElementById('exNameBox');
if (ns6||ie){
enabletip=false;
popUpObj.style.visibility="hidden";
popUpObj.style.left="-1600px";
popUpObj.style.backgroundColor='';
popUpObj.style.width='';
}
}

function formatCurrency(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
return (((sign)?'':'-') + '$' + num + '.' + cents);
}
function openExhibitorPage(id,url)
{
    
	if(!(url==null) && !(url==''))
	{
		location.href=url+'?venID='+id;
	}
}
document.onmousemove=positionPopUp
//-->
