function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Introduceti, va rog, adresa dvs. de mail!")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Introduceti, va rog, adresa dvs. de mail!")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Introduceti, va rog, adresa dvs. de mail!")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Introduceti, va rog, adresa dvs. de mail!")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Introduceti, va rog, adresa dvs. de mail!")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Introduceti, va rog, adresa dvs. de mail!")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Introduceti, va rog, adresa dvs. de mail!")
		    return false
		 }

 		 return true					
	}

function ValidateEmail(){
	var emailID=document.inv.email
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Introduceti, va rog, adresa de E-mail!")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }


function validare(url,message) {

var r = confirm(message);
if(r)
{ 
    document.location=(url);
} 
else { return false  }
 }

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=485,height=225,left = 250,top = 380');");
}

function popUp_chat(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=700,height=660,left = 250,top = 380');");
}

function popUp_admin(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=800,height=400,left = 140,top = 112');");
}

// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = false;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style><link href="../style.css" rel="stylesheet" type="text/css">');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=150-(document.body.clientWidth-document.images[0].width);');
writeln('height=200-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
writeln('</head><body bgcolor="#FFFFFF" scroll="no" align="center" onload="reSizeToImage();doTitle();self.focus()">')
writeln('<table cellpadding="0" width="100%" height="100%" cellspacing="0" border="0"><tr><td align="center" valign="middle"><img name="George" src='+imageURL+' style="display:block;" border="1"></td></tr></table></body></html>');
close();		
}}