var currDir = null;

function showGlossary(id){

	if (currDir != null && currDir != id){
		document.getElementById(currDir).style.display = "none";
	}
	currDir = id;
	document.getElementById(id).style.display = "block";

}

function captureSize(size){
    try {
        url = "capturesize.aspx?sz=" + size;
        var xmlhttp = null;
        if (window.XMLHttpRequest) { // code for Mozilla, etc.
            xmlhttp = new XMLHttpRequest();
            if (xmlhttp) {
                //alert("About to load firefox [" + url + "].");
                xmlhttp.open("GET", url, false)
                xmlhttp.send(null);
            }
        }
        if (window.ActiveXObject) { // code for IE
            //alert("About to load IE [" + url + "].");
            xmlhttp = new ActiveXObject("MSXML.DOMDocument");
            xmlhttp.load(url);
        }
    } catch (exc) {
        alert(exc);
    }
}

function getCookie( name ) {
  var start = document.cookie.indexOf( name + "=" );
  var len = start + name.length + 1;
  if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
    return null;
  }
  if ( start == -1 ) return null;
  var end = document.cookie.indexOf( ";", len );
  if ( end == -1 ) end = document.cookie.length;
  return unescape( document.cookie.substring( len, end ) );
}

function setCookie( name, value, expires, path, domain, secure ) {
  var today = new Date();
  today.setTime( today.getTime() );
  if ( expires ) {
    expires = expires * 1000 * 60 * 60 * 24;
  }
  var expires_date = new Date( today.getTime() + (expires) );
  var set_cookie = name+"="+escape( value ) +
    ( ( expires ) ? ";expires="+expires_date.toGMTString() : "" ) + //expires.toGMTString()
    ( ( path ) ? ";path=" + path : "" ) +
    ( ( domain ) ? ";domain=" + domain : "" ) +
    ( ( secure ) ? ";secure" : "" );
  //alert(set_cookie);
  document.cookie = set_cookie;
}

var newwindow = ''; 

function openitup(url) {
	if (!newwindow.closed && newwindow.location) {
		newwindow.focus()
	}
	else {
		newwindow=window.open(url,'privacy','height=570,width=420,toolbar=0,directories=0,menubar=0,status=0,resizable=0,location=0,scrollbars=1');
		if (!newwindow.opener) newwindow.opener = self;
	}
	if (window.focus) {newwindow.focus()}
	return false;
}

function verify(){
    msg = "You have not completed your current registration!  Are you sure you want to cancel this registration in process and logout?";
    //all we have to do is return the return value of the confirm() method
    return confirm(msg);
    }


function verifyprev(){
    msg = "You have not completed your current registration!  You are chosing to go back to a previous page in the registration process. In order to process any changes you make in your registration on the previous page - you MUST click the Continue button on that page.";
    //all we have to do is return the return value of the confirm() method
    return confirm(msg);
    }

function verifymsg(msg) {
   return confirm(msg);
}

function disableEnterKey(e)
{
     var key;

     if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox

     if(key == 13)
          return false;
     else
          return true;
}

