function fnTrapKD(btn, event)
{
 if (document.all)
 {
  if (event.keyCode == 13){
    FirePostBack(btn, event);
  }
 }
 else if (document.getElementById){
  if (event.which == 13){
   FirePostBack(btn, event);
  }
 }
 else if(document.layers){
  if(event.which == 13){
   FirePostBack(btn, event);
  }
 }
}

function FirePostBack(btn, event){
    // if you get an error here check that the code for 
    // SetDefaultButton in the ac/utils/utils.vb file
    // contains ' around the name for the button client id.
    event.returnValue=false;
    event.cancel = true;
    var postbackid = btn;
    while (postbackid.indexOf('_') > -1)
    {
        postbackid = postbackid.replace('_', '$');
    }  
    __doPostBack(postbackid,'');
}

// Navigate to a url on enter click
function fnTrapKDURL(btn, event, URL)
{
 if (document.all)
 {
  if (event.keyCode == 13){   
    window.location.href = URL;
  }
    if (event.keyCode == 1){   
      window.location.href = URL;
  }
 }
 else if (document.getElementById){
  if (event.which == 13){
   window.location.href = URL;
  }
  if (event.which == 1){
     window.location.href = URL;
  }
 }
 else if(document.layers){
  if(event.which == 13){
    window.location.href = URL;
  }
    if(event.which == 1){
      window.location.href = URL;
  }
 }
}

// click a button on enter key
function fnTrapKDClick(btn, event)
{
 if (document.all)
 {
  if (event.keyCode == 13){
    btn.click();
  }
 }
 else if (document.getElementById){
  if (event.which == 13){
   btn.click();
  }
 }
 else if(document.layers){
  if(event.which == 13){
   btn.click();
  }
 }
}



function mailThisUrl(){
	//var u = window.location;
	window.location = "mailto:?subject=" + escape(document.title) + "&body=I thought you would find this interesting: " + escape(document.URL);
}

function SetTooltip(sID)
{
    var sURL = '/pages/conferences/speakerdetail.aspx?id=' + sID;
    var sDiv = "#Speaker" + sID;
    
    //alert(sURL);
    //alert(sDiv);
    
    $(sDiv).jHelperTip({
	    trigger: "hover",
	    source: "ajax",
	    type: "GET", 
	    url: sURL,
	    data: 'name=Kean&age=63',
	    loadingImg: '/images/shd/ajax-loader.gif',
	    loadingText: 'loading...',
	    autoClose: false, 
	    opacity: 0.9,
	    topOff: 15,
	    leftOff: -370
    });
}
