var printWindow=null;
function openPrintPage(url){
	if (printWindow != null){
		printWindow.close();
	}
	printWindow = openWindow(url, 'printPage', null, null, 0, 0, true, true);
}

var sendWindow=null;
function openSendPage(url){
	var width = 320;
	var height = 240;
	if (sendWindow != null){
		sendWindow.close();
	}
	sendWindow = openWindow(url, 'sendPage', 320, 280, true, true);
}

function printPage(){
	window.print();
	window.close();
}

function searchNews(){
	var f = document.frmSearchNews;
	if (f.newsSearchQuery.value == ''){
		f.newsSearchQuery.focus();
	}else{
		f.submit();
	}
}

function advSearchNews(){
	var f = document.frmAdvSearchNews;
	if (f.newsSearchQuery.value == ''){
		f.newsSearchQuery.focus();
	}else{
		f.submit();
	}
}

function sendNews(){
	var f = document.frmSendNews;
	if (f.Nom.value == "" ){
		f.Nom.focus();
	}else if(f.EmailTo.value == ""){
		f.EmailTo.focus();
	}else if(f.Email.value == ""){
		f.Email.focus();
	}else{
		if (f.InfoRS.checked){
			window.parent.location = InfoRSURL;
		}
		f.submit();
	}
}

function newsShowImage(pos){
	var bImg = document.getElementById("newsBigImage");
	var pImg = document.getElementById("newsPrevImage"+pos);
	var bImgDesc = document.getElementById("newsBigImageDescription");
	if (bImg != null && pImg != null && bImgDesc != null){
		var imgDesc = eval("newsImage"+pos+"Description");
		var imgCopy = eval("newsImage"+pos+"Copyright");
		var imgWidth = eval("newsImage"+pos+"Width");
		var imgHeight = eval("newsImage"+pos+"Height");
		var imgPro = imgWidth / imgHeight;
		if (imgPro >= 1){
			imgWidth = imgMaxWidth;
			imgHeight = imgWidth / imgPro;
		}else{
			imgHeight = imgMaxHeight;
			imgWidth = imgHeight * imgPro;
		}
		bImg.width = imgWidth;
		bImg.height = imgHeight;
		bImg.src = pImg.src;
		bImgDesc.innerHTML = imgDesc+imgCopy;
	}
}