function PopupPic() { 
     window.open( "popup.htm?/datafiles/models/"+document.sform.model.options[document.sform.model.selectedIndex].value+"-large.jpg", "","resizable=1,HEIGHT=250,WIDTH=250"); 
   } 

function getModels()
  {
  var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
		var hr=xmlHttp.responseText;
		var hra=hr.split("|");
		
		document.sform.model.length=hra.length;
		document.sform.model.selectedIndex=0	
	
		document.sform.model.options[0].text="Επιλέξτε"
		document.sform.model.options[0].value=""			
		
		for (i=0;i<hra.length;i++)
			{
			try {
			document.sform.model.options[i+1].text=hra[i]
			document.sform.model.options[i+1].value=hra[i]			
				}
			catch (e){}
			}
		
        //document.form1.hour.value=xmlHttp.responseText;
        }
      }
    xmlHttp.open("GET","ajax/aj_getmodels.asp?brand="+document.sform.brand.options[document.sform.brand.selectedIndex].value+"&rnd="+Math.random());
    xmlHttp.send(null);
  }

function getCategs()
  {
  var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
		var hr=xmlHttp.responseText;
		var hra=hr.split("|");
		
		document.sform.categ.length=hra.length;
		document.sform.categ.selectedIndex=0	
		
		document.sform.model.options[0].text="Επιλέξτε"
		document.sform.model.options[0].value=""		
		for (i=0;i<hra.length;i++)
			{
			try{
			var hrb=hra[i].split("$");
			document.sform.categ.options[i+1].text=hrb[1]
			document.sform.categ.options[i+1].value=hrb[0]			
				}
			catch (e){}
				
			}
		
        //document.form1.hour.value=xmlHttp.responseText;
        }
      }
	  document.getElementById("modelphoto").innerHTML='';
	  document.getElementById("modelphoto").innerHTML="<img border='0' height=150 src='/datafiles/models/"+document.sform.model.options[document.sform.model.selectedIndex].value.replace(">", "")+".jpg'>";	  
    xmlHttp.open("GET","ajax/aj_getcategs.asp?brand="+document.sform.brand.options[document.sform.brand.selectedIndex].value+"&model="+document.sform.model.options[document.sform.model.selectedIndex].value+"&rnd="+Math.random());

    xmlHttp.send(null);
  }



function getSubCategs()
  {
	  var selcategory=document.sform.categ.options[document.sform.categ.selectedIndex].text;
	  
	  if (selcategory=='ΜΗΧΑΝΙΚΑ')
	  {
		  window.location = 'http://85.17.95.219/ketselidis/%28S%28nk5fvmxlmevfwvbp0riaeije%29%29/SelectCar.aspx';
		  return false;
	  }
  var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
		var hr=xmlHttp.responseText;
		var hra=hr.split("|");
		
		document.sform.scateg.length=hra.length;
		document.sform.scateg.selectedIndex=0	
		
		document.sform.model.options[0].text="Επιλέξτε"
		document.sform.model.options[0].value=""
		for (i=0;i<hra.length;i++)
			{
			try {
			var hrb=hra[i].split("$");
			document.sform.scateg.options[i+1].text=hrb[1]
			document.sform.scateg.options[i+1].value=hrb[0]			
				}
			catch (e){}
			}
		
        //document.form1.hour.value=xmlHttp.responseText;
        }
      }
    xmlHttp.open("GET","ajax/aj_getsubcategs.asp?brand="+document.sform.brand.options[document.sform.brand.selectedIndex].value+"&model="+document.sform.model.options[document.sform.model.selectedIndex].value+"&categ="+document.sform.categ.options[document.sform.categ.selectedIndex].value+"&rnd="+Math.random());
    xmlHttp.send(null);
  }



function getCompany()
  {
  var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
		var hr=xmlHttp.responseText;
		var hra=hr.split("|");
		
		document.sform.company.length=hra.length;
		document.sform.company.selectedIndex=0	
		
		document.sform.company.options[0].text="Όλα"
		document.sform.company.options[0].value=""
		for (i=0;i<hra.length;i++)
			{
			try {
			document.sform.company.options[i+1].text=hra[i]
			document.sform.company.options[i+1].value=hra[i]			
				}
			catch (e){}
			}
		
        //document.form1.hour.value=xmlHttp.responseText;
        }
      }
    xmlHttp.open("GET","ajax/aj_getcompany.asp?brand="+document.sform.brand.options[document.sform.brand.selectedIndex].value+"&model="+document.sform.model.options[document.sform.model.selectedIndex].value+"&scateg="+document.sform.scateg.options[document.sform.scateg.selectedIndex].value+"&rnd="+Math.random());
    xmlHttp.send(null);
  }



function getCC()
  {
  var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
		var hr=xmlHttp.responseText;
		var hra=hr.split("|");
		
		document.sform.cc.length=hra.length;
		document.sform.cc.selectedIndex=0	
		
		document.sform.cc.options[0].text="Όλα"
		document.sform.cc.options[0].value=""
		for (i=0;i<hra.length;i++)
			{
			try {
			document.sform.cc.options[i+1].text=hra[i]
			document.sform.cc.options[i+1].value=hra[i]			
				}
			catch (e){}
			}
		
        //document.form1.hour.value=xmlHttp.responseText;
        }
      }
    xmlHttp.open("GET","ajax/aj_getcc.asp?brand="+document.sform.brand.options[document.sform.brand.selectedIndex].value+"&model="+document.sform.model.options[document.sform.model.selectedIndex].value+"&scateg="+document.sform.scateg.options[document.sform.scateg.selectedIndex].value+"&rnd="+Math.random());
    xmlHttp.send(null);
  }

function printdiv()
{
var a = window. open('','','scrollbars=yes,width=750,height=450');

a.document.open("text/html");
a.document.write('<html><head><style type="text/css">body { font-family: Verdana; font-size:8pt;}#frame{background-image:none;background-color:#FFFFFF;}</style></head><body style="padding-left:20px;background-image:none;background-color:#FFFFFF;">');
a.document.write(document.getElementById('print').innerHTML);
a.document.write('</body></html>');
a.document.close();
a.print();
}

function checksubmitform()
{
cont=true;
if (document.sform.brand.selectedIndex==0)
{
	alert('Παρακαλώ συμπληρώστε την μάρκα που επιθυμείτε να αναζητήσετε');
	cont=false;
}
if (document.sform.model.selectedIndex==0 && cont==true)
{
	alert('Παρακαλώ συμπληρώστε το μοντέλο που επιθυμείτε να αναζητήσετε');
	cont=false;
}

if (document.sform.categ.selectedIndex==0 && cont==true)
{
	alert('Παρακαλώ συμπληρώστε τη κατηγορία ανταλλακτικών που επιθυμείτε να αναζητήσετε');
	cont=false;
}

if (document.sform.scateg.selectedIndex==0 && cont==true)
{
	alert('Παρακαλώ συμπληρώστε το είδος των ανταλλακτικών που επιθυμείτε να αναζητήσετε');
	cont=false;
}

if (cont) {document.sform.submit();}
}

