var choice22=0;


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  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&&id.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

      var lastClicked;
      var allIcons = new Array();

      function getElement(id, d) {
      if (!d) d = document;
      if (d.getElementById) {
      return d.getElementById(id);
      }
      if (d.layers && d.layers[id]) {
      return d.layers[id];
      }
      if (d.all && d.all[id]) {
      return d.all[id];;
      }
      }
        

      function preloadImgs(){
        allIcons[0] = new Image();
        allIcons[0].src = 'images/bullet.gif';
        allIcons[1] = new Image();
        allIcons[1].src = 'images/plus.gif';
        allIcons[2] = new Image();
        allIcons[2].src = 'images/plus.2.gif';
        allIcons[3] = new Image();
        allIcons[3].src = 'images/minus.gif';
        allIcons[4] = new Image();
        allIcons[4].src = 'images/minus.2.gif';
      }

      function showhide(id){
      var imgURL = getElement('i-' + id).src;
      var isPlus = (imgURL.indexOf("plus") != -1) ? true : false;
      
      if (isPlus){
      getElement(id).style.visibility = "visible";
      getElement(id).style.display = "block";
      getElement('i-' + id).src= allIcons[3].src;
      } else {
      getElement(id).style.display = "none";
      getElement(id).style.visibility = "hidden";
      getElement('i-' + id).src= allIcons[1].src;
      }
      }

    function showHoverImg(id){
    var url = getElement(id).src;
    var isPlus = (url.indexOf("plus") != -1) ? true : false;
    if (isPlus){
    getElement(id).src= allIcons[2].src;
    } else {
    getElement(id).src= allIcons[4].src;
    }
    }
    function changeColor(id){
      if (lastClicked) getElement(lastClicked).style.color = '#FFFFFF';
      getElement(id).style.color = "#FFFF00";
      lastClicked = id;
    }
    function hideHoverImg(id){
    var obj = getElement(id);
    var isPlus = (obj.src.indexOf("plus") != -1) ? true : false;
    if (isPlus){
    obj.src= allIcons[1].src;
    } else {
    obj.src= allIcons[3].src;
    }
    }
	
	
function getthis(url,div2show) {
//  μπήκε μετά ήταν global 
var http = false;
if(navigator.appName == "Microsoft Internet Explorer") {
  http = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http = new XMLHttpRequest();
} 

//  μπήκε μετά

//showbusybar();
var data = " ";
   http.open("GET", url, true);
 http.onreadystatechange=function() {
  if(http.readyState == 4) {
  data = http.responseText
 // parent.showthis(data,'processings');
 //document.getElementById('processings').innerHTML = 
  showthis(data,div2show) ;
 setTimeout("shownoprocess()",500);
  }
  

 }
  http.send(null);
}


function getthis2(url,div2show) {
//  μπήκε μετά ήταν global 
var http3  = false;
if(navigator.appName == "Microsoft Internet Explorer") {
  http3 = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http3 = new XMLHttpRequest();
} 

//  μπήκε μετά

 showprocess();
var data = " ";
  http3.open("GET", url, true);
 http3.onreadystatechange=function() {

  if(http3.readyState == 4) {
  data = http3.responseText
  showthis(data,div2show) ;
 setTimeout("shownoprocess()",500);
  }
  
  
  

 }
  http3.send(null);
}

function getthis3(url,div2show) {
//  μπήκε μετά ήταν global 
var http3  = false;
if(navigator.appName == "Microsoft Internet Explorer") {
  http3 = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http3 = new XMLHttpRequest();
} 

//  μπήκε μετά


var data = " ";
  http3.open("GET", url, true);
 http3.onreadystatechange=function() {

  if(http3.readyState == 4) {
  data = http3.responseText
  showthis(data,div2show) ;

  }
  
  
  

 }
  http3.send(null);
}


function showthis(text,div)
{
document.getElementById(div).innerHTML=text;
} // εμφάνιση dhtml περιεχομένου σε τμήμα (text, div)

function showprocess() {
var txt = "<div align='center'><span class='style2 style14'><img src='imgs/clocks.gif'>Please wait...</span></div>";
 document.getElementById('process').style.display = 'block';
showthis(txt,'process');
}
function shownoprocess() {
var txt = "";
showthis(txt,'process');
document.getElementById('process').style.display = 'none';
}

function choice1() {
showprocess();	
showthis("<img src='../blank.gif' width='160' height='1'>",'choice1');
showthis("<img src='../imgs/linegri.gif' width='160' height='1'>",'choice2');
showthis("<img src='../imgs/linegri.gif' width='160' height='1'>",'choice3');
 document.getElementById('mapsearch').style.display = 'block';
 document.getElementById('quicksearch').style.display = 'none';
 document.getElementById('mysearch').style.display = 'none';
  setTimeout("shownoprocess()",500);
}



function choice2() {

showthis("<img src='../blank.gif' width='160' height='1'>",'choice2');
showthis("<img src='../imgs/linegri.gif' width='160' height='1'>",'choice1');
showthis("<img src='../imgs/linegri.gif' width='160' height='1'>",'choice3');
 document.getElementById('mapsearch').style.display = 'none';
 document.getElementById('quicksearch').style.display = 'block';
 document.getElementById('mysearch').style.display = 'none';
 if (choice22==0)
 {
	 showprocess();
	 choice22=1;
	 getthis("quicksearch.asp",'quicksearch');

 }
 
}



function randNum (num) {
    var now = new Date();                                  
    var rand = Math.round(num * Math.cos(now.getTime())); 
    if (rand < 0) 
	{rand = - rand; }
	if (rand == 0) { rand++;   }
    return rand;                                          
    }

function choice3() {
var urli ="";
var nuum=randNum(17);
showprocess();
showthis("<img src='../blank.gif' width='160' height='1'>",'choice3');
showthis("<img src='../imgs/linegri.gif' width='160' height='1'>",'choice2');
showthis("<img src='../imgs/linegri.gif' width='160' height='1'>",'choice1');
 document.getElementById('mapsearch').style.display = 'none';
 document.getElementById('quicksearch').style.display = 'none';
 document.getElementById('mysearch').style.display = 'block';
 
 urli="mysearch.asp?randd="+nuum+"";
  getthis(urli,'mysearch');
  //setTimeout("shownoprocess()",500);
}



function changecities(selectedid)  // αυτό είναι για τις ζητήσεις μελών
{
var	slid="changecities.asp?perifereiaid="+ escape(selectedid)+""
	getthis(slid,'cities')
}

function changeperioxes(selectedid)  // αυτό είναι για τις ζητήσεις μελών
{
var	slid="changeperioxes.asp?perioxiid="+ selectedid+""
	getthis(slid,'perioxes')
}


function home_city(selectedid)
{
var	slid="home_city.asp?perifereiaid="+selectedid+""
	getthis(slid,'home_city')	
}
function home_cityen(selectedid)
{
var	slid="home_cityen.asp?perifereiaid="+selectedid+""
	getthis(slid,'home_city')	
}

function home_perioxi(selectedid)
{
var	slid="home_perioxi.asp?cityid="+selectedid+""
	getthis(slid,'home_perioxi')	
}


function home_perioxien(selectedid)
{
var	slid="home_perioxien.asp?cityid="+selectedid+""
	getthis(slid,'home_perioxi')	
}



function login()
{
	var username="" +  encodeURI(document.getElementById("username").value )+"" ; 
	var password="" +  encodeURI(document.getElementById("password").value )+"" ; 
	var data2;
	// Δηλώσεις XMLHttp object
	
	parameters="username="+username+"&password="+password+""
	

// Δηλώσεις XMLHttp object

	var http_request = false;
if(navigator.appName == "Microsoft Internet Explorer") {
  http_request = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http_request = new XMLHttpRequest();
} 
// Δηλώσεις XMLHttp object
	  
      url ="checklogin.asp?username="+username+"&password="+password+"" ;//this will be used if i have cache problems in IE 
 	  http_request.open('POST', url, false); 
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request.send(parameters);
	  
 
												 data2 = http_request.responseText;
 												 loginresults(data2);
} 	
	
function loginresults(resultt) 
{
	if (resultt==0) 
	{
		showthis("Λάθος στοιχεία εισόδου. Παρακαλώ ξαναπροσπαθήστε !",'loginresult');
	}
	if (resultt==1)
	{
		choice3();
	}
}



function addzitisi()
{
	var reqperifereia="" +  escape(document.getElementById("reqperifereia").value )+"" ; 
	var reqcity="" +  escape(document.getElementById("reqcity").value )+"" ; 
	 var reqperioxi="" +  escape(document.getElementById("reqperioxi").value )+"" ; 
	var startmonth="" +  escape(document.getElementById("startmonth").value )+"" ; 
	var startday="" +  escape(document.getElementById("startday").value )+"" ; 
	var endmonth="" +  escape(document.getElementById("endmonth").value )+"" ; 
	var endday="" +  escape(document.getElementById("endday").value )+"" ; 
	var triptype="" +  escape(document.getElementById("triptype").value )+"" ; 
	var vnumber="" +  escape(document.getElementById("vnumber").value )+"" ; 
	var knumber="" +  escape(document.getElementById("knumber").value )+"" ; 
	var poso="" + escape(document.getElementById("poso").value )+"" ; ; 
	 //var poso1="" + escape(document.getElementById("poso1").value )+"" ; 
	 //var poso2="" + escape(document.getElementById("poso2").value )+"" ; 
	var txts="" +  escape(document.getElementById("txts").value )+"" ; 
	var visitorid="" +  escape(document.getElementById("visitorid").value )+"" ; 
	var data2;
	// Δηλώσεις XMLHttp object &poso1="+poso1+"&poso2="+poso2+"
	var parameterss;
	parameterss="reqperifereia="+reqperifereia+"&reqcity="+reqcity+"&reqperioxi="+reqperioxi+"&startmonth="+startmonth+"&endmonth="+endmonth+"&endday="+endday+"&triptype="+triptype+"&vnumber="+vnumber+"&knumber="+knumber+"&poso="+poso+"";
	parameterss=parameterss+"&txts="+txts+"&visitorid="+visitorid+"&startday="+startday+"" ;
var url="addzitisi.asp"
	var http_request = false;
if(navigator.appName == "Microsoft Internet Explorer") {
  http_request = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http_request = new XMLHttpRequest();
} 
 	  
  // if (http_request.overrideMimeType) {   //Για το encoding δούλεψε η escape εντολή 
  //  http_request.overrideMimeType('text/xml; charset=iso-8859-7');
// } 	
	http_request.open("POST", url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	  
	  http_request.setRequestHeader("Content-length", parameterss.length+2010);
	 // http_request.setRequestHeader("Connection", "close");   // ????
	  http_request.send(parameterss);
	  http_request.onreadystatechange=function() {
 	  if(http_request.readyState == 4) 
	 		{
 			 data2 = http_request.responseText;
 			  addzitisiresults(data2);
			} 	
	 }
}


function addzitisiresults(resultt) 
{
	if (resultt==1) 
	{
		//choice3();
	//	showthis(resultt,'zitisimsg');
 		showthis("Η ζήτησή σας καταχωρήθηκε, μπορείτε να την δείτε επιλέγοντας εδώ... <img src='imgs/svistra.gif' onmouseover='javascript:svistra1();'><br><br>",'zitisimsg');

	}
	  if (resultt==0)
	  {
		//showthis(resultt,'zitisimsg');
	showthis("Your offer has been submitted",'zitisimsg');
	 	}
 
}

function svistra1() 
{
	 showthis(" ",'zitisimsg');
	choice3() ;
	
}


function zitisipopup(n)
{
	if (n==1) 
	{
		document.getElementById('zitisipopup').style.display = 'block';
		showthis("<img src='imgs/close.gif' width='16' height='16'  onclick='javascript:zitisipopup(0);'/>",'zitisipopupcontrol');
		
	}
	if (n==0) 
	{
		document.getElementById('zitisipopup').style.display = 'none';	
		showthis("<img src='imgs/open.gif' width='16' height='16'  onclick='javascript:zitisipopup(1);'/>",'zitisipopupcontrol');
	}
}

function myzitiseispopup(x)
{
	if (x==1) 
	{
		document.getElementById('myzitiseispopup').style.display = 'block';
		showthis("<img src='imgs/close.gif' width='16' height='16'  onclick='javascript:myzitiseispopup(0);'/>",'myzitiseiscontrol');
		
	}
	if (x==0) 
	{
		document.getElementById('myzitiseispopup').style.display = 'none';	
		showthis("<img src='imgs/open.gif' width='16' height='16'  onclick='javascript:myzitiseispopup(1);'/>",'myzitiseiscontrol');
	}
}


function deletezitisi(nn) 
{
	var http_request = false;
	var url="deletethis.asp?n="+nn+"";
if(navigator.appName == "Microsoft Internet Explorer") {
  http_request = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http_request = new XMLHttpRequest();
} 	


http_request.open("GET", url, true);
//http_request.setRequestHeader("Connection", "close");   // ????
	
	 http_request.onreadystatechange=function() {
 	 if(http_request.readyState == 4) 
	 		{
 			 data2 = http_request.responseText;
 			  deletezitisiresult(data2);
			} 	
	 }
	  http_request.send(null);
}


function deletezitisiresult(dataa)
{
	choice3();
}
 
function showoffer(div2show,noum)
{
	url="showoffer.asp?n="+noum+"&divv="+div2show+"";
	getthis(url,div2show);
}



function controlarea(div2control,div2change,x)
{
	if (x==1) 
	{
		document.getElementById(div2control).style.display = 'block';
		showthis("<img src='imgs/close2.gif' width='16' height='16'  onclick='javascript:controlarea(&#39;"+div2control+"&#39;,&#39;"+div2change+"&#39;,0);' >",div2change);
		
	}
	if (x==0) 
	{
		document.getElementById(div2control).style.display = 'none';	
		showthis("<img src='imgs/open2.gif' width='16' height='16'  onclick='javascript:controlarea(&#39;"+div2control+"&#39;,&#39;"+div2change+"&#39;,1);' >",div2change);
	}
}

function newcustomer() 
{
	getthis("newcustomer.asp",'newcustomer');
}
	
function showparoxesa()
{
	getthis("paroxes1.asp",'paroxes');
}
function showparoxesb()
{
	getthis("paroxes2.asp",'paroxes');
}
function showparoxesc()
{
	getthis("paroxes3.asp",'paroxes');
}



function checkdomain()
{
	 showthis(" ",'free');
	 var reqdomain="" +  escape(document.getElementById("ncprodomain").value )+"" ; 
	 var domain2="" +  escape(document.getElementById("ncdomain").value )+"" ;
	 if(reqdomain!="") {
	 url="checkthisnow.asp?domain="+reqdomain+"&domain2="+domain2+"" ;
	 getthis(url,'free');
	 }
 
}

function checkemail()
{
	 showthis(" ",'emailresult');
	 var reqemail="" +  escape(document.getElementById("ncemail").value )+"" ; 
	 if(reqemail!="") {
	 url="checkthisemail.asp?email="+reqemail+"" ;
	 getthis(url,'emailresult');
	 }
 
}

function addthisrequest()
{
	var ncfname="" +  escape(document.getElementById("ncfname").value )+"" ; 
	var nceponimia="" +  escape(document.getElementById("nceponimia").value )+"" ; 
	 var ncemail="" +  escape(document.getElementById("ncemail").value )+"" ; 
	var ncurl="" +  escape(document.getElementById("ncurl").value )+"" ; 
	var ncprodomain="" +  escape(document.getElementById("ncprodomain").value )+"" ; 
	var ncdomain="" +  escape(document.getElementById("ncdomain").value )+"" ; 
	var nctype="" +  escape(document.getElementById("nctype").value )+"" ; 
	var nccity="" +  escape(document.getElementById("nccity").value )+"" ; 
	var ncphone="" +  escape(document.getElementById("ncphone").value )+"" ; 
	var ncmobile="" +  escape(document.getElementById("ncmobile").value )+"" ; 
	var data2;
	var parameterss;
	parameterss="ncfname="+ncfname+"&nceponimia="+nceponimia+"&ncemail="+ncemail+"&ncurl="+ncurl+"&ncprodomain="+ncprodomain+"&ncdomain="+ncdomain+"&nctype="+nctype+"&nccity="+nccity+"&ncphone="+ncphone+"&ncmobile="+ncmobile+"";
	
var url="addthisrequest.asp"
	var http_request = false;
if(navigator.appName == "Microsoft Internet Explorer") {
  http_request = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http_request = new XMLHttpRequest();
} 
 	  
  // if (http_request.overrideMimeType) {   //Για το encoding δούλεψε η escape εντολή 
  //  http_request.overrideMimeType('text/xml; charset=iso-8859-7');
// } 	
	http_request.open("POST", url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	  
	  http_request.setRequestHeader("Content-length", parameterss.length+2010);
	 // http_request.setRequestHeader("Connection", "close");   // ????
	  http_request.send(parameterss);
	  http_request.onreadystatechange=function() {
 	  if(http_request.readyState == 4) 
	 		{
 			 data2 = http_request.responseText;
 			  addthisrequestresults(data2);
			} 	
	 }
}


function addthisrequestresults(resultt) 
{
	 if (resultt==1) 
	 {

		//showthis(resultt,'free');
 		showthis("Your request has been submitted  <img src='imgs/svistra.gif' onmouseover='javascript:newcustomer();'><br><br>",'free');

	 }
	if (resultt!=1)
	{
		//	showthis(resultt,'zitisimsg');
	showthis("Your request has not been submitted , please fill in all blank fields...",'free');
	}
}



function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
 
