function Trim(strInputString){
	strInputString = strInputString + ' '
	objRegExp = /(^ +)|( +$)/g
	return strInputString.replace(objRegExp, "");
}
function blnValidEmail(strInputString){
	var objRegExp = /(^[^@]+@[^@]+\..+$)/gi
	if (objRegExp.test(strInputString)) {return true;} else {return false;}
}
function blnValidLatinString(strInputString){
	var objRegExp = /(^[a-z0-9]+$)/gi
	if (objRegExp.test(strInputString)) {return true;} else {return false;}
}
function view(sId){
	sId = sId.toString();
	document.location.href= 'html/ent/' + sId.substr(sId.length-3, 3) + '/ent.' + sId + '.asp';
}

function showThisImage(oImgSrc, sElTrgt){
	var sFilename=oImgSrc.src
	document.getElementById(sElTrgt).src=sFilename.replace('_s.jpg', '_b.jpg');
	try{document.getElementById("txtFocus").focus();} catch (error){}
}

function wCover(dtm, cid){
	window.location.href='?dtmDate=' + dtm + '&c=' + cid;
}

function npcSetDate(iSetCID){
	var sSetDate = document.getElementById("dtmCstDate").value
	document.location.href='?dtmDate=' + sSetDate + '&c=' + iSetCID;
}
  function doPng(){
      var arVersion = navigator.appVersion.split("MSIE")
      var version = parseFloat(arVersion[1])
      if ((version >= 5.5) && (document.body.filters)) 
      {
          for(var i=0; i<document.images.length; i++)
          {
              var img = document.images[i]
              var imgName = img.src.toUpperCase()
              if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
              {
                  var imgID = (img.id) ? "id='" + img.id + "' " : ""
                  var imgClass = (img.className) ? "class='" + img.className + "' " : ""
                  var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
                  var imgStyle = "display:inline-block;" + img.style.cssText 
                  if (img.align == "left") imgStyle = "float:left;" + imgStyle
                  if (img.align == "right") imgStyle = "float:right;" + imgStyle
                  if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
                  var strNewHTML = "<span " + imgID + imgClass + imgTitle
                      + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
                      + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                      + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
                  img.outerHTML = strNewHTML
                  i = i-1
              }
          }
      }
  }
function submitContact(){
	document.getElementById('txtFullName').value = Trim(document.getElementById('txtFullName').value)
	document.getElementById('txtEmail').value = Trim(document.getElementById('txtEmail').value)
	document.getElementById('txtAddress').value = Trim(document.getElementById('txtAddress').value)
	document.getElementById('txtPhone').value = Trim(document.getElementById('txtPhone').value)
	document.getElementById('txtMessage').value = Trim(document.getElementById('txtMessage').value)
	if (document.getElementById('selCategory').value=='') { alert('Παρακαλούμε επιλέξτε το θέμα που σας ενδιαφέρει.'); document.getElementById('selCategory').focus(); return}
	if (document.getElementById('txtFullName').value=='') {alert('Παρακαλούμε συμπληρώστε το όνομά σας.'); document.getElementById('txtFullName').focus();	return;}
	if (document.getElementById('txtEmail').value!='') { if (!blnValidEmail(document.getElementById('txtEmail').value)) {alert('Το e-mail σας δεν είναι σωστό.'); document.getElementById('txtEmail').focus(); return}	}
	document.getElementById('btnSubmit').disabled=true;
	document.getElementById('frmMain').submit()
	//alert('Contact is currently not available. Please try again later.')
}

function fbs_click() {
		u=location.href;
		t=document.title;
		window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
		return false;
}