function ShowBBB() { popupWin = window.open('http://www.bbbonline.org/cks.asp?id=251000095', 'Participant','location=yes,scrollbars=yes,width=450,height=300'); window.name = 'opener'; } 
function ShowThawte() {	certDetailsUrlWithReferer = "https://www.thawte.com/cgi/server/certdetails.exe?referer=" + window.location; thewindow = window.open(certDetailsUrlWithReferer, "newWindow", config="height=500,width=516,toolbar=no,menubar=no," + "scrollbars=yes,resizable=no,location=no,directories=no,status=yes");}


function openWindow(sURL) {
    newWin=window.open(sURL, 'Chat', 'width=550,height=600,resizable=yes,scrollbars=yes');
    newWin.focus();
}

function popit(fullurl,w,h,scroll,resizer) {
	var myname="eee33";LeftPosition=0;TopPosition=20;
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=' + resizer;
	awin=window.open(fullurl,myname,settings);
	awin.opener = self;
	awin.focus();
} 
	
function invite() {
 	urlprep = "invite/invite.cfm?gourl=" + escape(document.location.href);
 	newWin=window.open(urlprep, 'invite', 'width=500,height=353,resizable=no,scrollbars=no');
	newWin.focus();
}

function isWhitespace (s)

{   var i;

    // Is s empty?
    if (isEmpty(s)) return true;

    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {
  // Check that current character isn't whitespace.
  var c = s.charAt(i);

  if (whitespace.indexOf(c) == -1) return false;
    }

    // All characters are whitespace.
    return true;
}

function isPhone(string) {
    if (!string) return false;
    var Chars = "0123456789-+)(x ";
    var digitChars = "0123456789";
  var strLen =  string.length;
  if(strLen > 18)
    return false;
  if(strLen < 7)
    return false;
  var digitCount = 0;
    for (var i = 0; i < string.length; i++) {
       if (digitChars.indexOf(string.charAt(i)) > -1)
     digitCount = digitCount + 1;
    }
  if(digitCount < 6)
    return false;
    for (var i = 0; i < string.length; i++) {
       if (Chars.indexOf(string.charAt(i)) == -1)
          return false;
    }
    return true;
}

function isCC(string) {
    var Chars = "0123456789 ";
  var digitChars = "0123456789";
  var strLen =  string.length;
    var digitCount = 0;

    if (!string) return false;
  if (strLen < 14 || strLen > 19) return false;
    for (var i = 0; i < string.length; i++) {
      if (digitChars.indexOf(string.charAt(i)) > -1) digitCount = digitCount + 1;
      }
  if (digitCount < 15 || digitCount > 16 ) return false;
    for (var i = 0; i < string.length; i++) {
      if (Chars.indexOf(string.charAt(i)) == -1)
        return false;
      }
    return true;
}

function isEmail (s){
    var part_email=s.substring(s.indexOf("@")+1);
	if (part_email.match(/@+/) || part_email.match(/;/) || part_email.match(/,/))
	   {return false;}
  
    if (!s) return false;
    var i = 1;
    var sLength = s.length;
    while ((i < sLength) && (s.charAt(i) != "@")){ i++; }
    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    while ((i < sLength) && (s.charAt(i) != ".")) { i++; }

    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}


function isNumeric(str){
  var len= str.length;
  if (len==0)
    return false;
  //else
  var p=0;
  var ok= true;
  var ch= "";
  while (ok && p<len)
  {
    ch= str.charAt(p);
    if (('0'<=ch && ch<='9'))
      p++;
    else
      ok= false;
  }
  return ok;
}


	function popitup(mypage,w,h,scroll) {
		var myname="hbswin"
		pos=""
		if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
		if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
		else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
		settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
		awin=window.open(mypage,myname,settings);
		awin.opener = self;
	} 
	
	
	function trim(strInput) {
	// Trims all leading and trailing spaces from input string
	    var blnNonBlank;
	    var strTemp = '';
	    var strOutput = '';

	    blnNonBlank = false;
	    for (i=strInput.length-1; -1<i; i--) {
	        if ( (blnNonBlank) || (strInput.charAt(i) != ' ') ) {
	            strTemp = strInput.charAt(i) + strTemp;   //prepend char to front of Temp string
	            blnNonBlank = true;
	        }
	    }

	    blnNonBlank = false;
	    for (i=0; i<strTemp.length; i++) {
	        if ( blnNonBlank || (strTemp.charAt(i) != ' ') ) {
	            strOutput = strOutput + strInput.charAt(i);   //append char to end of Output string
	            blnNonBlank = true;
	        }
	    }

	    return strOutput;
	}
var ids=new Array('a2','a3','a4','a5','a6','a7','a8');

function switchid(id){	
	hideallids();
	showdiv(id);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}

function changemenu(id)
{
	if(document.getElementById)
	{
		document.getElementById(id).style.color = '#CC0000';
	}
}

function enable_state(state, country)
{
	if(country.value == "United States")
	{
		//enable state
		state.disabled = false;
	}
	else
		//disable state
		state.disabled = true;
	return;
}
	
