function generate_address( username, hostname, gif )
{
	var domain = ".ee";
	var atsign = "&#64;";
	var addr = username + atsign + hostname + domain;
	document.write( 
	"<" + "a" + " " + "href=" + "mail" + "to:" + addr + ">" +
	gif +
	"<\/a>");
}

function popIm(id,d){
	//14.06.2006 SF
	if (!d)
	    window.open("http://www.omega.ee/Showimage.php?id="+id+"&l=an","popIm","top=10,left=20,resizable=no,width=200,height=200,status=no,location=no,menubar=no,scrollbars=yes")    
	else
	    window.open("Showimage.php?id="+id,"popIm","top=10,left=20,resizable=no,width=200,height=200,status=no,location=no,menubar=no,scrollbars=yes")
}

function popSpecialIm(id,module){
	window.open("Showimage.php?id="+id+"&module="+module,"popIm","top=10,left=20, resizable=no,width=200,height=200,status=no,location=no,menubar=no,scrollbars=yes")
}

function popUserRegForm(addValues){
	window.open("Register.php?"+addValues,"popUp","top=10,left=20,resizable=no,width=700,height=500,status=no,location=no,menubar=no,scrollbars=yes")
}

function checkInt(field, minInt, maxInt){
	var value=parseInt(field.value);
	field.value=value
	if((value<minInt) || (!value))
		field.value=minInt;
	else if(value>maxInt)
		field.value=maxInt;
}

function popWin(url,he,wi){
	if(he<=0)he = '400';
	if(wi<=0)wi = '355';
	
	var kyssa=window.open(url,'','scrollbars=yes,width='+wi+',height='+he+',resizable=yes,top=20,left=150');	
}

function popGal(id){
	window.open('galerii.php?lang={VAR:lang}&id='+id,'','resizable=no,width=600,height=650,status=no,location=no,menubar=no,scrollbars=yes')
}

function showFile(id){
	height = '300';
	width = '300';
	window.open('showFile.php?id='+id,'','scrollbars=yes,width='+width+',height='+height+',resizable=yes,top=50,left=200');
}

function popTerm(id,lang){
	window.open('popTerm.php?id='+id+'&lang='+lang,'','resizable=no,width=400,height=200,status=no,location=no,menubar=no,scrollbars=yes')
}
