
function ValidateEmail(tbEmail)
{        
    if(!tbEmail.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi))
    {
        alert("Not a correct email address");
        return false;
    }
    
    return true;
}

function KeyDownHandler(btn, e)
{
  // process only the Enter key
  if({ 13:1}[e.which||e.keyCode])
  {
    // cancel the default submit
    e.returnValue=false;
    e.cancel = true;
    // submit the form by programmatically clicking the specified button
    btn.click();
  }
}

function validateSearch(tbSearch, tbDefaultValue)
{	
	if(tbSearch.value == '') 
	{	  
	  return false;
	}		
	if(tbSearch.value == tbDefaultValue) 
	{	  
	  return false;
	}	
	return true;
}

function ClickToPrint()
{
        docPrint=window.open("","Print");
        docPrint.document.open();
        docPrint.document.write('<html><head><title>Scandinavian International Management Institute</title>');
        docPrint.document.write('<style media="all" type="text/css">@import "/css/all.css";</style></head><body style="background:#fff;" onLoad="self.print()">');
        docPrint.document.write('<div class="news-box" style="padding:10px 10px 10px 10px; width:500px;"><div style="width:480px;"><img src="/images/SIMI-printform.gif" /></div><br/><div style="width:480px; margin-left:10px;">');
        docPrint.document.write(document.getElementById("printbox").innerHTML); 
        docPrint.document.write('</div></div></body></html>');
        docPrint.document.close(); 
        docPrint.focus();
}