
function showBox(topic) { 
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
	  //Non-IE
	  myWidth = window.innerWidth;
	  myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	  //IE 6+ in 'standards compliant mode'
	  myWidth = document.documentElement.clientWidth;
	  myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	  //IE 4 compatible
	  myWidth = document.body.clientWidth;
	  myHeight = document.body.clientHeight;
	}
	//alert(myHeight);

	//self.location.href="?topic="+topic;
	
	document.getElementById("darkenBkg").style.display = "block";
	document.getElementById("formContainer").style.display = "block";
	document.getElementById("darkenBkg").style.height = myHeight;
	//alert(document.getElementById("darkenBkg").offsetHeight);
	
	document.getElementById("topic").value = topic;
	
	//alert(topic); 
	
	// hide scrollbar
	document.documentElement.style.overflow = 'hidden';	 // firefox, chrome
	document.body.scroll = "no";	// ie only
	
  }
  
  
  function hideBox() { 

	document.getElementById("darkenBkg").style.display = "none";
	document.getElementById("formContainer").style.display = "none";
	//alert('show'); 
	
	// show scrollbar
	document.documentElement.style.overflow = 'visible';	 // firefox, chrome
	document.body.scroll = "yes";	// ie only

  }


function submit_form() {

	
	if(document.getElementById('name').value == "") {
		alert('Please enter your name');
		document.getElementById('name').focus();
		document.getElementById('name').style.border = "2px solid #FF0000";
		return;
	} 
	if(document.getElementById('email').value == "") {
		alert('Please enter your email address');
		document.getElementById('email').focus();
		document.getElementById('email').style.border = "2px solid #FF0000";
		return;
	}
	
	var filter = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
	if(!filter.test(document.getElementById('email').value)) {
		alert('Please enter a valid email address');
		document.getElementById('email').focus();
		document.getElementById('email').style.border = "2px solid #FF0000";
		return;
	}
	
	
	if(document.getElementById('company').value == "") {
		alert('Please enter your company name');
		document.getElementById('company').focus();
		document.getElementById('company').style.border = "2px solid #FF0000";
		return;
	}
	if(document.getElementById('topic').value == "") {
		alert('Please select a topic');
		document.getElementById('topic').focus();
		document.getElementById('topic').style.border = "2px solid #FF0000";
		return;
	}

	//document.form1.submit();
	document.getElementById("contact").submit();
}





//  KEYWORD POPUP

function getXMLHttp()
{
  var xmlHttp

  try
  {
    //Firefox, Opera 8.0+, Safari
    xmlHttp = new XMLHttpRequest();
  }
  catch(e)
  {
    //Internet Explorer
    try
    {
      xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e)
    {
      try
      {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
      catch(e)
      {
        alert("Your browser does not support AJAX!")
        return false;
      }
    }
  }
  return xmlHttp;
}



function MakeRequest(keyword)
{
  var xmlHttp = getXMLHttp();
  
  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4)
    {
      HandleResponse(xmlHttp.responseText);
    }
  }

  xmlHttp.open("GET", "includes/key_definition.php?n="+keyword, true); 
  xmlHttp.send(null);
}


function HandleResponse(response)
{
  document.getElementById('keyword').innerHTML = response;
  
	document.getElementById("darkenBkg2").style.display = "block";
	document.getElementById("keywordContainer").style.display = "block";
}




function showKeyword(n) { 
	
    MakeRequest(n);
	//alert('show'); 
	// hide scrollbar
	document.documentElement.style.overflow = 'hidden';	 // firefox, chrome
	document.body.scroll = "no";	// ie only

  }
  
  
  function hideKeyword() { 

	document.getElementById("darkenBkg2").style.display = "none";
	document.getElementById("keywordContainer").style.display = "none";
	//alert('show');
	document.documentElement.style.overflow = 'visible';	 // firefox, chrome
	document.body.scroll = "yes";	// ie only
  }






