	function SetFocus(){
		if (document.forms.frmSearchUnit) {
				document.frmSearchUnit.elements[0].focus();
				document.frmSearchUnit.elements[0].select();
		} else if (document.forms.frmSearchAdvanced) {
				document.frmSearchAdvanced.elements[0].focus();
				document.frmSearchAdvanced.elements[0].select();
		} else {
			if (document.forms.length > 0){
				document.frmSearch.elements[0].focus();
				document.frmSearch.elements[0].select();
			}
		}
	}
	
	function isDigit(c)	{   
	   return ((c >= '0') && (c <= '9'));
	}
	
	function LTrim(s) {
	  while (1) {
	    if (s.substring(0, 1) != ' ') break;
	    s = s.substring(1, s.length);
	  }
	  return s;
	}
	
	function RTrim(s)	{
	  while (1) {
	    if (s.substring(s.length - 1, s.length) != ' ') break;
	    s = s.substring(0, s.length - 1);
	  }
	  return s;
	}
	
	function Trim(s){
	  return LTrim(RTrim(s));
	}
	
	function isEmpty(s)	{
	   return ((s == null) || (s.length == 0) || Trim(s)=='');
	}
	
	function isDigitStr(s)	{
		var iCnt, c;
		if (isEmpty(s)) return false;
		for (iCnt=0; iCnt<s.length; iCnt++)	{
			c = s.charAt(iCnt);
			if (!isDigit(c)) return false;
		}
		return true;
	}

	function ValidateField(obj) {
		var isOK = (((event.keyCode >= 48) && (event.keyCode <= 57)) || ((event.keyCode >= 96) && (event.keyCode <= 105)) || (event.keyCode == 8) || (event.keyCode == 46) || (event.keyCode == 9));
		return isOK;
	}
	
	function FindObj(n, d) {
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=FindObj(n,d.layers[i].document); return x;
	}
		
	function OpenPopUp(src, width, height, scroll, obj){
		width += 6 + (20);
		height += 25;
		var left = (screen.width - width)/2;
		var top = (screen.height - height)/2;
		var arObj = new Array(window.document, obj);
		if (window.showModalDialog != null) {
			window.showModalDialog(src, arObj, 'dialogWidth=' + width + 'px;dialogHeight=' + height + 'px;dialogLeft=' + left + 'px;dialogTop=' + top + 'px;help=0;status=0;scroll=' + scroll + ';unadorned=1');
		} else {
			window.open(src, 'customPopUp',	'width=' + width + ',height=' + height + 'left=' + left + 'top=' + top + ',status=no,scrollbars=' + scroll + ',directories=no,menubar=no,resizable=no,modal=yes,toolbar=no');
		}
	}
	
	function SwapImage() {
	  var i,j=0,x,a=SwapImage.arguments;
		document.MM_sr = new Array;
		for (i=0; i<(a.length-2); i+=3)
			if ((x=FindObj(a[i])) != null) {
				document.MM_sr[j++] = x;
				if (! x.oSrc) x.oSrc = x.src;
				x.src = a[i+2];
			}
	}
	
	function SwapImgRestore() {
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}
	
	function PreloadImages() {
		var d = document;
		if (d.images) {
			if (!d.MM_p) d.MM_p = new Array();
			var i,j = d.MM_p.length;
			var a = PreloadImages.arguments;
			for(i=0; i<a.length; i++) {
				if (a[i].indexOf("#")!=0) {
					d.MM_p[j] = new Image;
					d.MM_p[j++].src=a[i];
				}
			}
		}
	}

	function onMouseOverImg(obj){
		SwapImage(obj.name,'',obj.src.replace(RegExp(".gif","g"),"_over.gif"),1);
		return true;
	}
	
	function onMouseOutImg(){
		SwapImgRestore();
		return true;
	}

	function onSearchFormSubmit(oForm, sMsg) {
		if (oForm.txtSearch.value.toLowerCase().replace(/ /g, '') == '') {
			alert(sMsg);
			oForm.txtSearch.focus();
			oForm.txtSearch.select();
			return false;
		} else {
			return true;
		}
	}
	
	function onSubmitContactForm(frm, sFirstname, sLastname, sComments, sPrompt){
		var sMsg = '';
		if (frm.firstname.value.replace(/ /g, '') == ''){
			sMsg += sFirstname + '.\n';
			frm.firstname.focus();
			frm.firstname.select();
		}
		if (frm.lastname.value.replace(/ /g, '') == ''){
			sMsg += sLastname + '.\n';
			frm.lastname.focus();
			frm.lastname.select();
		}
		if (frm.comments.value.replace(/ /g, '') == ''){
			sMsg += sComments + '.\n';
			frm.comments.focus();
			frm.comments.select();
		}
		if (sMsg != ''){
			sMsg = sPrompt + ':\n' + sMsg;
			alert(sMsg);
			return;
		} else{
			frm.submit();
		}
	}
	
	function OpenCustomPopUp(title, source, width, height, scroll){
		var ar = new Array(source, width, height);
		width += 6 + (20);
		height += 25 + (52);
		showModalDialog('/site/documents/_enimerosi24-popup.asp?title='+title,ar,'dialogWidth=' + width + 'px;dialogHeight=' + height + 'px;dialogLeft=' + parseInt(parseInt(parseInt(document.body.offsetWidth,10) - width,10)/2,10) + 'px;dialogTop=' + parseInt(parseInt(parseInt(screen.height,10) - height,10)/2,10) + 'px;help=0;status=0;scroll=' + scroll + ';unadorned=1');
	}
	
	function CustomHref(href){
		window.location.href=href;
	}

	function send_article(rest, dstr){
		var url  = window.location.href;
		var link = url.replace(/\?.*/,"");
		window.location.href = "mailto:?subject=" + dstr + "&body=%0A" + link + "?" + rest;
	}
	
	function CheckSubmitSearch() {
		return (!(document.forms[0].SearchField.value.toLowerCase().replace(/ /g, '') == ''));
	}
	
	function onLoadPopUp(){
		if (! window.dialogArguments) return;
		document.all.mainimage.width = window.dialogArguments[1];
		document.all.mainimage.height = window.dialogArguments[2];
		document.all.mainimage.src = window.dialogArguments[0];
	}

    function setSourceOfImage(image, source) {
			var object;
			if(typeof image == 'string') {
				object = document.getElementById(image);
				if(object && object.src) object.src = source;
			}
			else if ((typeof image == 'object') && image && image.src) {
				image.src = source;
			}
		}
		
	function SetFieldEmptyText(obj, dstr) {
		if (obj.value == dstr) obj.value = '';
		obj.select();
	}
	
	function SetFieldDefaultText(obj, dstr) {
		if (obj.value == '') obj.value = dstr;
	}
	
	
	
function showHidePollResults(){
	var oQuestion, oResults, oButton, oHref, oResultsAnalysis;
	
	IE = true; NS = false; OB = false;
	if (document.layers) {IE = false; NS = true; OB = false;}
	if (document.all) {IE = true; NS = false; OB = false;}
	if (!document.all && document.getElementById) {IE = true; NS = false; OB = true;}	
	
	oQuestion = document.getElementById("pollQuestion");
	oResults = document.getElementById("pollResults");
	oButton = document.getElementById("pollButtonVote");
	oHref = document.getElementById("pollButtonShowResults");
	oResultsAnalysis = document.getElementById("pollResultsAnalysis");
	if (NS) {
		if (oQuestion.visibility == 'hide') {
			oQuestion.visibility	= 'show';
			oButton.visibility	= 'show';
			oResults.visibility	= 'hide';
			oResultsAnalysis.visibility	= 'hide';
			oHref.innerHTML = 'Δείτε τα αποτελέσματα';
		} else {
			oQuestion.visibility	= 'hide';
			oButton.visibility	= 'hide';
			oResults.visibility	= 'show';
			oResultsAnalysis.visibility	= 'show';
			oHref.innerHTML = 'Δείτε τη δημοσκόπηση';
		}
	} else {
		if (oQuestion.style.display == 'none') {
			oQuestion.style.display = '';
			oButton.style.display = '';
			oResults.style.display = 'none';
			oResultsAnalysis.style.display = 'none';
			oHref.innerHTML = 'Δείτε τα αποτελέσματα';
		} else {
			oQuestion.style.display = 'none';
			oButton.style.display = 'none';
			oResults.style.display = '';
			oResultsAnalysis.style.display = '';
			oHref.innerHTML = 'Δείτε τη δημοσκόπηση';
		}
	}
}	


function showHideArchiveUnit(sID){
	var oUnit, oImage;
	
	IE = true; NS = false; OB = false;
	if (document.layers) {IE = false; NS = true; OB = false;}
	if (document.all) {IE = true; NS = false; OB = false;}
	if (!document.all && document.getElementById) {IE = true; NS = false; OB = true;}	
	
	oUnit = document.getElementById(sID);
	oImage = document.getElementById(sID + '_IMG');
	if (NS) {
		if (oUnit.visibility == 'hide') {
			oUnit.visibility	= 'show';
			oImage.src	= oImage.src.replace(RegExp("_closed.gif","g"),"_open.gif");
		} else {
			oUnit.visibility	= 'hide';
			oImage.src	= oImage.src.replace(RegExp("_open.gif","g"),"_closed.gif");
		}
	} else {
		if (oUnit.style.display == 'none') {
			oUnit.style.display = '';
			oImage.src	= oImage.src.replace(RegExp("_closed.gif","g"),"_open.gif");
		} else {
			oUnit.style.display = 'none';
			oImage.src	= oImage.src.replace(RegExp("_open.gif","g"),"_closed.gif");
		}
	}
}

function hideDiv(id) {
	document.getElementById(id).style.display = 'none';
}

		
function openWin(src, width, height, scroll, obj){
	width += 6 + (20);
	height += 25;
	var left = (screen.width - width)/2;
	var top = (screen.height - height)/2;
	var arObj = new Array(window.document, obj);
	window.open(src, 'newWin',	'left=' + left + 'top=' + top + ',status=no,scrollbars=' + scroll + ',directories=no,menubar=no,resizable=yes,toolbar=no');
}