function refreshParent($name) {
  
	document.getElementById('popup_changes').submit();
	window.opener.location.href = window.opener.location.href;

  	if (window.opener.progressWindow)
		
  	{
    	window.opener.progressWindow.close()
  	}
  	window.close();
  	
}

function CloseParent() {
  
  window.close();
  
}

function change_Main(url,theWidth,theHeight){
var theTop=(screen.height/2)-(theHeight/2);
var theLeft=(screen.width/2)-(theWidth/2);
var features=
'height='+theHeight+',width='+theWidth+',top='+theTop+',left='+theLeft+",scrollbars=yes";
theWin=window.open(url,'',features);
}



function pic_open(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop) {  // v4.01

	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">');
	newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' alt=\"'+alt+'\">');
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus(); 

}

function printf(url_address) {

	 var URL, url_address;
	 URL = "print.php?print=page"+url_address;	 
	 window.open(URL, 'NewPopup','scrollbars=yes, height=600, width=800 , left=50 , top=50');

}

function calCheck(lang) 
{
	var lang;
	var name = document.getElementById('name').value;
	var email= document.getElementById('email').value;
	
	if(name == "")
	{
		if(lang == 'estonian')
		{
			alert('Palun täida kõik kohustuslikud väljad !');
		}
		else if(lang == 'russian')
		{
			alert('??????????, ????????? ??? ??????????? ????');
		}
		else
		{
			alert('Please, feel the "name" field');
		}

		return false;
	}
	else if(email == "")
	{
		if(lang == 'estonian')
		{
			alert('Palun täida kõik kohustuslikud väljad !');
		}
		else if(lang == 'russian')
		{
			alert('??????????, ????????? ??? ??????????? ????');
		}
		else
		{
			alert('Please, feel the "e-mail" field');
		}

		return false;
	}
	else {return true;}
}