var MyWin;
function ShowImage(id,prodid)
{
	if(MyWin!=null)
	{
		MyWin.close;
	}
	
	MyWin=window.open("/ShowImage.asp?image=" + id + "&id=" + prodid + "",null,"height=200,width=300,status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=no");
	MyWin.moveTo(5,5);
	MyWin.focus();
}	

function launchWin(url,sizeStr)
{
	var newWin
	newWin = window.open(url,null,sizeStr+",status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=yes");	
	newWin.focus();
}

function ShowMap()
	{
		var Map;
		Map=window.open('',null,"height=475,width=880,status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=no");
		var str;
		str="<table align='center'><tr><td>"
		str += "<img src='/images/ChaniaTown.jpg' alt='Chania Town' style='padding:15px;'>"
		str += "</td></tr></table>"
		Map.document.open();
		Map.document.write(str)
		Map.document.close();
		Map.moveTo(5,5);
		Map.focus();	
	}
	
function ShowCurrency()
{
	if(MyWin!=null)
	{
		MyWin.close;
	}
	
	MyWin=window.open("http://www.mecklai.com/mecklai/converter.asp",null,"height=344,width=532,status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=no");
	MyWin.moveTo(5,5);
	MyWin.focus();
	return false;
}

function ValidateContact()
{ 
	//validation against Name, Email, Address & Telephone
	var emptyFields;
	emptyFields="";
	var InvalidFields;
	InvalidFields="";
	var problem;
	problem="";
	
	if(document.getElementById("FullName").value=="")
	{
		emptyFields+="Surname - Name\n";
	}
	else if(document.getElementById("FullName").value.length < 3)
	{
		InvalidFields+="Surname - Name\n";					
	}
	
	if(document.getElementById("Address").value=="")
	{
		emptyFields+="Address\n";
	}
	else if(document.getElementById("Address").value.length < 3)
	{
		InvalidFields+="Address\n";					
	}
	
	if(document.getElementById("Telephone").value=="")
	{
		emptyFields+="Telephone\n";
	}
	else if(document.getElementById("Telephone").value.length < 3)
	{
		InvalidFields+="Telephone\n";					
	}
	
	if(document.getElementById("email").value=="")
	{
		emptyFields+="e-mail Address\n";
	}
	else if(document.getElementById("email").value.length < 3)
	{
		InvalidFields+="e-mail Address\n";					
	}
	
	if(emptyFields!="")
	{
		problem+="Please fill in the following fields: \n" + emptyFields;
	}
	
	if(InvalidFields!="")
	{
		if(problem=="")
		{
			problem = "The values of the following fields are not valid.\nYou should enter at least three charachters: \n" + InvalidFields;
		}
		else
		{
			problem += "and populate the following fields with at least three characters.\n" + InvalidFields;
		
		}					
	}
	
	if(problem!="")
	{
		alert(problem);
		return false;
	}
	
	return true;					
}

