
<!--
//=====================================
// FTH: New window opens for every new winName
function openRelativeWindow(strURL,winName) 
{
	var winWidth = Math.round(screen.availWidth * 0.8)
	var winLeft = Math.round(screen.availWidth * 0.1)
	winProperties = 'width='+winWidth+',left='+winLeft+',top=0,height=0,toolbar=yes,location=yes,status=no,menubar=yes,scrollbars=yes,resizable=yes'
	window.open(strURL, winName, winProperties)
}

//=====================================
// FTH: open pop up window
function openWin(theURL,winName,W,H)
{
	features = 'height='+H+',width='+W+',toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1'
	window.open(theURL,winName,features);
}

//=====================================
// FTH: New Location (link for input buttoms)
function linkTo(strURL)
{
	window.location = strURL
}

//=====================================
// FTH: A New centered window opens for every new winName
function openCenteredWindow(strURL, winName, w, h)
{
	if (w == 0 || w == ''){
		w = (screen.width - 10);
		var winLeft = 0;
	}else{
		var winLeft = Math.round((screen.width - w) / 2);
	}
	if (h == 0 || h == ''){
		h = (screen.height - 166);
		var winTop = 0;
	}else{
		var winTop = Math.round(((screen.height - 180) - h) / 2);
	}
	winProperties = 'height='+h+',width='+w+',top='+winTop+',left='+winLeft+',location=1,status=0,toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes'
	window.open(strURL, winName, winProperties)
}

//=====================================
//Controlls that a radio is selected
var radioSelection="";
function radio()
{
	if (radioSelection==""){
		alert("\nΠρέπει να κάνεις μια επιλογή.");
		return false;
	}	else {
	return true;
 	}
}

//=====================================
// FTH: open pop up window
function openMovie(theURL)
{
	winName = 'sxVideo'
	W = 480
	H = 360
	winTop = 100
	winLeft = 200
	features = 'height='+H+',width='+W+',top='+winTop+',left='+winLeft+',toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1'
	window.open(theURL,winName,features);
}

//=====================================
// FTh: Change class
function changeClass(cell, newClass)
	{
	cell.className = newClass;
	}	

//=====================================
// FTh: Change class by ID Name
function changeclassByID(idName, newClass)
	{
	document.getElementById(idName).className = newClass;
	}

//=======================================================================================
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
//=======================================================================================
function imgRollOver() 
{
	if (!document.getElementById) return
	var imgOriginSrc;
	var imgTemp = new Array();
	var imgarr = document.getElementsByTagName('img');
	for (var i = 0; i < imgarr.length; i++)
	{
	if (imgarr[i].getAttribute('hsrc'))
		{
		imgTemp[i] = new Image();
		imgTemp[i].src = imgarr[i].getAttribute('hsrc');
		imgarr[i].onmouseover = function()
			{
			imgOriginSrc = this.getAttribute('src');
			this.setAttribute('src',this.getAttribute('hsrc'))
			}
		imgarr[i].onmouseout = function()
			{
			this.setAttribute('src',imgOriginSrc)
			}
		}
	}
}
onload=imgRollOver;

//=====================================
//Controll positive number in textbox
function validateNumber(field)
{
  var val = field.value;
//  if(!/^\d*$/.test(val)||val==0)
  if((val!="") && (!/^\d*$/.test(val)||val==0))
  {
      alert("Η ποσότητα πρέπει να είναι θετικός αριθμός");
      field.focus();
      field.select();
  }
}
//=====================================
//Controll positive number in textbox
function validateEmptyNumber(field)
{
  var val = field.value;
  if((val!="") && (!/^\d*$/.test(val)||val==0))
  {
      alert("Η ποσότητα πρέπει να είναι θετικός αριθμός ή κενό");
      field.focus();
      field.select();
  }
}
//=====================================
//Allow zero value in textbox
function validateZeroNumber(field)
{
  var val = field.value;
  if(!/^\d*$/.test(val)||val<0)
  	{
    alert("Η ποσότητα πρέπει να είναι θετικός αριθμός ή 0");
    field.focus();
    field.select();
 	}
}

//=====================================
//Controlls that at least one checkbox is chosen
var checkboxSelection = "";
function checkbox()
{
	if (checkboxSelection == "")
	{
		alert("Πρέπει να σημειώσεις τουλάχιστον ένα κουτάκι.");
		return false;
	}else {
		return true;
  	}
}

//=====================================
// Change image in navigation menu
function changeImgNo(intCatalog, imgID) 
{
	if (document.getElementById("link" + intCatalog).src = "img_pg/link" + imgID + ".gif") 
	{
		document.getElementById("link" + intCatalog).src = "img_pg/link" + imgID + "Rev.gif";
	}
}
function restoreImgNo(intCatalog, imgID)
{ 
	if (document.getElementById("link" + intCatalog).src = "img_pg/link" + imgID + "Rev.gif") 
	{
		document.getElementById("link" + intCatalog).src = "img_pg/link" + imgID + ".gif";
	}
}

//=====================================
// Change image and layer in navigation menu
function showBoxNo(intCatalog, imgID) 
{
if (document.getElementById("category" + intCatalog).style.display == "") 
	{
	document.getElementById("category" + intCatalog).style.display = "none" ; 
	document.getElementById("link" + intCatalog).src = "img_pg/link" + imgID + ".gif";
	} 
	else 
	{
	document.getElementById("category" + intCatalog).style.display = "";
	document.getElementById("link" + intCatalog).src = "img_pg/link" + imgID + "Rev.gif";
	}
}

//=====================================
//Links in navigation menu
function linkURLΝο(intCategoryID,intCatalogoID)
{
	location.href = "productNameList.asp?intCategoryID="+ intCategoryID +"&intCatalogID="+ intCatalogoID + ""
}

//############################
//Used in orderShowCurrent
function showLayer(idName,firstImg,secondImg)
{
	var layer = document.getElementById(idName);
	if (layer.style.display == 'none')
	{
		layer.style.display = 'block';
		layer = document.getElementById('hidden' + idName);
      layer.innerHTML = '<img border="0" src="img_pg/'+firstImg+'.gif">';
	} else {
		layer.style.display = 'none';
		layer = document.getElementById('hidden' + idName);
		layer.innerHTML = '<img border="0" src="img_pg/'+secondImg+'.gif">';
	}
}

//Used in orderShowCurrent - Replaces the above one....
function showHideLayer(thisID,thatID,firstImg,secondImg)
{
	var layer = document.getElementById(thatID);
	if (layer.style.display == 'none')
	{
		layer.style.display = 'block';
		layer = document.getElementById(thisID);
      layer.innerHTML = '<img border="0" src="'+firstImg+'">';
	} else {
		layer.style.display = 'none';
		layer = document.getElementById(thisID);
		layer.innerHTML = '<img border="0" src="'+secondImg+'">';
	}
}

//=====================================
// Opens a link from a form selection
// onchange=submitSelection(this.form), selectedOption is the name of the selection field
function submitSelection(form) 
{
	location=form.selectedOption.value
}

//=====================================
// Opens a link from ANY form selection
// onchange=submitMultiSelection(this.form.selectionFieldName)
function submitMultiSelection(form)
{
//	location=form.value
	location=form.value
}

function formSubmit(myForm)
{
document.getElementById(myForm).submit()
}


//FTh Changes the color of a text counter box when max length is exceeded.
function countRepEntries() 
{
   var sxv = document.forumArticles.textbody.value;
   var sxl = sxv.length;
   document.forumArticles.entered.value = sxl;
   var sxs = document.forumArticles.entered.style;
   sxs.backgroundColor = (sxl >= 6000) ? '#dd0000' : '#ffffff';
   setTimeout("countRepEntries()" ,0);
}

//FTh Changes the color of a text counter box when max length is exceeded.
function countNewEntries() 
{
   var sxv = document.forumArticles.textbody.value;
   var sxl = sxv.length;
   document.forumArticles.entered.value = sxl;
   var sxs = document.forumArticles.entered.style;
   sxs.backgroundColor = (sxl >= 12000) ? '#dd0000' : '#ffffff';
   setTimeout("countNewEntries()" ,0);
}

function reload()
{
window.location.reload()
}

//FTh enables and disables two groups av radio inputs
function enable(first,second)
{
	i = 0
	while (document.getElementById(first+i) != null)
	{
		document.getElementById(first+i).disabled=false
		i++
	}
	i = 0
	while (document.getElementById(second+i) != null)
	{
		document.getElementById(second+i).disabled=true
		i++
	}
}

//--> 