function rendermail(user, domain, classname){
  var1=user;
  var2=domain;
  var3=var1+'@'+var2;
  emailE=(var3);
  document.write ('<a class="'+ classname +'" href="mailto:' + emailE + '">' + emailE + '<\/a>');
}

function StartClientMail(user, domain){
  var1=user;
  var2=domain;
  var3=var1+'@'+var2;
  emailE=(var3);
  document.location.href='mailto:' + emailE;
}

function flipDiv( divid, clickdiv ){

	if (document.getElementById(divid).style.display == 'none' ){
		document.getElementById(divid).style.display = 'block';
	}
	else {
		document.getElementById(divid).style.display = 'none';
	}
	
	if (document.getElementById(clickdiv).style.display == 'none' ){
		document.getElementById(clickdiv).style.display = 'block';
	}
	else {
		document.getElementById(clickdiv).style.display = 'none';
	}
	
}

function onEnter( evt, frm )
{
	var keyCode = null;

	if( evt.which ) {
		keyCode = evt.which;
	} else if( evt.keyCode ) {
		keyCode = evt.keyCode;
	}
	if( 13 == keyCode ) {
		frm.btnEnter.click();
		return false;
	}
	return true;
}

function getPrintPage(){
	if(document.getElementById('AjrPrintContent') != null){
		var pageP = window.open('/print.asp','Print','width=660, height=650, scrollbars=1, resizable=0')
	}
}

function printPage(){

	window.document.title = window.opener.document.title;

	var sOut;
	sOut = '';

	if (window.opener.document.getElementById('AjrPrintContent')) {
	  sOut = sOut + window.opener.document.getElementById('AjrPrintContent').innerHTML;
	}

	if (window.opener.document.getElementById('AjrPrintContent2')) {
	  sOut = sOut + '<div style="margin-top: 30px;">' + window.opener.document.getElementById('AjrPrintContent2').innerHTML + '</div>';
	}

	document.getElementById('AjrPrintContent').innerHTML = sOut;
	document.body.style.backgroundImage='none';
	document.body.style.backgroundColor='#ffffff';

	window.print();
}

function resetfieldclasses(me){
	for ( var i=0;i<me.elements.length;i++ )
	{
		if(me.elements[i].name != ''){
			if( me.elements[i].type=='text' )
			{
			me.elements[i].style.border='1px solid #e2e2e2';
			}
		}		
	}
}

function redalert(me){
	me.style.border='1px solid red';
	me.focus();
}

function setSelectedIndex( me, valsearch )
{
  for (i = 0; i< me.options.length; i++)
  {
    if (me.options[i].value == valsearch)
    {
      me.options[i].selected = true;
      me.options[i].style.backgroundColor = '#dddddd';
      break;
    }
  }
  return;
}

function showhidediv(id){
	if (document.getElementById(id)){
		if(document.getElementById(id).style.display=='none'){
			document.getElementById(id).style.display='block';
		} else {
			document.getElementById(id).style.display='none';
		}
	}
}
