function isWhitespaceOrBlank(s) {
   // Test for strings containing only whitespace.
   var re = /\S+/;
   return (!re.test(s) || isBlank(s));
}


function eventEmailKeypress(e) {
      if (bw.ns4 || bw.ns6) {
        intKey=e.which;
      } else {
        intKey=event.keyCode;
      }
      if (intKey==13) {
         openEvEmailWin("/2_events/EvEmailConferenceDetails.jsp", document.secondaryForm);
         return false;
      }
}

function openEvHelpWin(href) {
   window.open(href,'_blank','height=600,width=670,scrollbars=yes');
}

function openEvEmailWin(href, formName) {
	
   if (formName != null) {
	
   		var finalHREF = null;
   		//var email = document.secondaryForm.emailConfDetails.value;
   		var email = formName.emailConfDetails.value;
   		
   		if (email !=null) {
   			finalHREF = href + "?email=" + email; 
   			
   			if (formName.emailFirstName)
   			{
   				var emailFirstName = formName.emailFirstName.value;
   				var emailLastName = formName.emailLastName.value;
   				var emailAddr = formName.emailAddr.value;
   				var emailEventTitle = formName.emailEventTitle.value;
   				var emailEventUrl = formName.emailEventUrl.value;
   				finalHREF += 
   				 "&emailFirstName=" + emailFirstName +
   				 "&emailLastName=" + emailLastName + 
   				 "&emailAddr=" + emailAddr +
   				 "&emailEventTitle=" + emailEventTitle + 
   				 "&emailEventUrl=" + emailEventUrl;
   			}
			window.open(finalHREF,'_blank','height=425,width=490,scrollbars=yes');	
   		}
   } else {
   		window.open(href,'_blank','height=425,width=490,scrollbars=yes');
   }
}

function openEmailWin(href, formName) {
	
   if (formName != null) {
	
   		var finalHREF = null;
   		//var email = document.secondaryForm.emailConfDetails.value;
   		var email = formName.emailConfDetails.value;
   		
   		if (email !=null) {
   			finalHREF = href + "?email=" + email; 
   			
   			if (formName.emailFirstName)
   			{
   				var emailFirstName = formName.emailFirstName.value;
   				var emailLastName = formName.emailLastName.value;
   				var emailAddr = formName.emailAddr.value;
   				var emailEventTitle = formName.emailEventTitle.value;
   				var emailEventUrl = formName.emailEventUrl.value;
   				finalHREF += 
   				"&emailFirstName=" + emailFirstName +
   				"&emailLastName=" + emailLastName + 
   				"&emailAddr=" + emailAddr + 
   				"&emailEventTitle=" + emailEventTitle + 
   				"&emailEventUrl=" + emailEventUrl;
   			}
			window.open(finalHREF,'_blank','height=485,width=660,scrollbars=yes');	
   		}
   } else {
   		window.open(href,'_blank','height=485,width=660,scrollbars=yes');
   }
}

function openPrivPolicy(href) {
   window.open(href,'_blank','height=600,width=670,scrollbars=yes');
}

function openSpeakerBio(href) {
   window.open(href,'_blank','height=620,width=450,scrollbars=yes');
}

function openCCardWin(href) {
   window.open(href,'manageCcWindow','height=625,width=580,scrollbars=yes,resizable=0');
}

function openEvContactUsWin(href) {
   window.open(href,'_blank','height=352,width=670,scrollbars=yes');
}

function openContactUsWin(href) {
   window.open(href,'_blank','height=650,width=350,scrollbars=yes');
}

function openTermsWin(href) {
   window.open(href,'_blank','height=320,width=600,scrollbars=no');
}

function openAgendaPopUp(href) {
   window.open(href,'_blank','height=400,width=630,scrollbars=yes');
}

function openRecieptWin(href) {
   window.open(href,'manageCcWindow','height=650,width=590,scrollbars=yes,resizable=0');
}

function setPointer(theRow, thePointerColor, theNormalBgColor)
{
    var theCells = null;

    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    var currentColor = null;
    var newColor     = null;
    // Opera does not return valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].setAttribute('bgcolor', newColor, 0);
        } // end for
    }
    else {
        currentColor = theCells[0].style.backgroundColor;
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].style.backgroundColor = newColor;
        }
    }

    return true;
}
  
  var browserName = navigator.appName;

  function greyAll(hide) {
//ie check starts
   if(browserName == "Microsoft Internet Explorer")
   {
    if (navigator.appVersion.toLowerCase().indexOf('msie') != -1)
    {
      if (hide != "true")
      {
        if (availableComponents && !ccUsed){
          z = 0;
          
          if (document.all.creditCardRadio.length != null)		
          {
            for(n = 0; n < document.all.creditCardRadio.length; n++){
              if(document.all.creditCardRadio[n].checked == true){
                z++;
              }
            }
          }
          else
          {
            if (document.all.creditCardRadio.checked == true)
            {
              z = 1;
            }
          }
          
          if(z < 1){
 
            document.creditCardHeader.src="/2_events/images/creditcardgrey_header2.gif";
            for(i = 0; i < document.all.greyOut.length; i++){
              document.all.greyOut[i].style.color='#999999';
            }
            for(i = 0; i < document.all.greyForm.length; i++){
              document.all.greyForm[i].style.backgroundColor='#eeeeee';
              document.all.greyForm[i].style.color='#999999';
              document.all.greyForm[i].disabled=true;
            }
          }
          else{
			   
            document.creditCardHeader.src="/2_events/images/creditcard_header2.gif";
            for(i = 0; i < document.all.greyOut.length; i++){
              document.all.greyOut[i].style.color='#000000';
            }
            for(i = 0; i < document.all.greyForm.length; i++){
              document.all.greyForm[i].style.backgroundColor='#ffffff';
              document.all.greyForm[i].style.color='#000000';
              document.all.greyForm[i].disabled=false;
            }
          }
        }
        else
        {
			 
          document.creditCardHeader.src="/2_events/images/creditcardgrey_header2.gif";
          for(i = 0; i < document.all.greyOut.length; i++){
            document.all.greyOut[i].style.color='#999999';
          }
          for(i = 0; i < document.all.greyForm.length; i++){
            document.all.greyForm[i].style.backgroundColor='#eeeeee';
            document.all.greyForm[i].style.color='#999999';
            document.all.greyForm[i].disabled=true;
           }
         }
       }
     }

   }//ie check ends
         /////////////////////////////////////netscape code starts/////////////////////////////
  if (browserName == "Netscape")
   {
     if (hide != "true")
      {
        if (availableComponents && !ccUsed){
          z = 0;
          
          if (document.mainForm.creditCardRadio.length != null)		
          {
            for(n = 0; n < document.mainForm.creditCardRadio.length; n++){
              if(document.mainForm.creditCardRadio[n].checked == true){
                z++;
              }
            }
          }
          else
          {
             if (document.mainForm.creditCardRadio.checked == true)
             {
              z = 1;
             }

          }
          
          if(z < 1){
			   
              document.creditCardHeader.src="/2_events/images/creditcardgrey_header2.gif";
              for(i = 0; i < document.getElementById('greyOut').length; i++){
		      document.mainForm.greyOut[i].style.color='#999999';
            }
           
		      for(i = 0; i < document.mainForm.greyForm.length; i++){
              document.mainForm.greyForm[i].style.backgroundColor='#eeeeee';
              document.mainForm.greyForm[i].style.color='#999999';
              document.mainForm.greyForm[i].disabled=true;
            }
          }
          else{
			
              document.creditCardHeader.src="/2_events/images/creditcard_header2.gif";
			  for(i = 0; i < document.getElementById('greyOut').length; i++){
			  document.mainForm.greyOut[i].style.color='#000000';
            }
            
			  for(i = 0; i <document.mainForm.greyForm.length; i++){
              document.mainForm.greyForm[i].style.backgroundColor='#ffffff';
              document.mainForm.greyForm[i].style.color='#000000';
              document.mainForm.greyForm[i].disabled=false;
            }
          }
        }
        else
        {
            document.creditCardHeader.src="/2_events/images/creditcardgrey_header2.gif";
            for(i = 0; i < document.mainForm.greyOut.length; i++){
            document.mainForm.greyOut[i].style.color='#999999';
          }
           
			for(i = 0; i < document.mainForm.greyForm.length; i++){
            document.mainForm.greyForm[i].style.backgroundColor='#eeeeee';
            document.mainForm.greyForm[i].style.color='#999999';
            document.mainForm.greyForm[i].disabled=true;
          }
        }
      }
    
   }//netscape check ends
      ////////////////////////////netscape code ends/////////////////////////

}//function ends