function cEnter(e,f){
	var keynum;
	var keychar;
	var numcheck;
	
	if(window.event){ // IE
		keynum = e.keyCode;
	} else if(e.which){ // Netscape/Firefox/Opera
		keynum = e.which;
	}
	if (keynum==13)
	{
		f();
	}
//	alert(f);
	return false;
}

function openSmall(file, width, height){
	var top=0, left=0;
	if(width > screen.width-10 || height > screen.height-28) scroll = "yes";
	if(height < screen.height-28) top = Math.floor((screen.height - height)/2-14);
	if(width < screen.width-10) left = Math.floor((screen.width - width)/2-5);
	width = Math.min(width, screen.width-10);	
	height = Math.min(height, screen.height-28);
	window.open(file, '',"resizable=yes, scrollbars=yes,width="+width+",height="+height+",left="+left+",top="+top);
}


function show_hide(div){
	if(obj=document.getElementById(div)){
		if (obj.style.display=='none')
		{
			obj.style.display='block';
		} else {
			obj.style.display='none';
		}
	}
}
function hide(div){
	if(obj=document.getElementById(div)){
		obj.style.display='none';
	}
}
function show(div){
	if(obj=document.getElementById(div)){
		obj.style.display='block';
	}
}

function addElement(domain) {
  var ni = document.getElementById('moreEmails');
  if (ni.style.display=='none') {
	  ni.style.display='block';
  }
  var numi = document.getElementById('moreEmails');
  var num = (document.getElementById('moreEmails').value -1)+ 2;
  numi.value = num;
  var newdiv = document.createElement('div');
  var divIdName = 'my'+num+'Div';
  newdiv.setAttribute('id',divIdName);
  newdiv.setAttribute('style','padding:3px 0px 3px 20px;');
  
  newdiv.innerHTML = '<input type="text" name="emails[]" value="">@'+domain;
  
  ni.appendChild(newdiv);
}