function numbersonly(e, decimal) {
var key;
var keychar;

if (window.event) {
   key = window.event.keyCode;
}
else if (e) {
   key = e.which;
}
else {
   return true;
}
keychar = String.fromCharCode(key);

if ((key===null) || (key===0) || (key==8) ||  (key==9) || (key==13) || (key==27) ) {
   return true;
}
else if ((("0123456789.").indexOf(keychar) > -1)) {
   return true;
}
else if (decimal && (keychar == ".")) { 
  return true;
}
else
   return false;
}

function checkraddio(text, value){
for( i = 0; i < text.length; i++ )
{
if(text[i].checked == true){
	sendVar('store/store_vars.php', value,  text[i].value);
	break;}

}}


function simplekalorifer(){
	if(document.form.somata.checked==true)
		sendVar('store/store_vars.php','somata','yes');
	else if(document.form.somata.checked==false)
		sendVar('store/store_vars.php','somata','no');
	if(document.form.solines.checked==true)
		sendVar('store/store_vars.php','solines','yes');
	else if(document.form.solines.checked==false)
		sendVar('store/store_vars.php','solines','no');
	if(document.form.levitas.checked==true)
		sendVar('store/store_vars.php','levitas','yes');
	else if(document.form.levitas.checked==false)
		sendVar('store/store_vars.php','levitas','no');
	}


function checkapokopi(){
	if(document.form.pliroseis_tixwn_check.checked==true){
		return 'yes';}
	else if(document.form.pliroseis_tixwn_check.checked==false){
		return 'no';}
	}

function checksomata(somata, solines){
	temp_solines=MakeRequest("store/get_vars.php", "solines");
	temp_levitas=MakeRequest("store/get_vars.php", "levitas");
	
	if(solines[0]=='n'){
	sendVar('store/store_vars.php','solines',document.form.solines.value);}
	else if(somata==0 && solines=='yes'){
		Modalbox.show('forms/'+type_of+'/31.php', {width: 600, height: 300, title: false, overlayOpacity: 0.75});
		Modalbox.deactivate();
		}
	else if(temp_solines!=solines){
		sendVar('store/store_vars.php','solines',document.form.solines.value);
		}
	
	if(somata>0){
		sendVar('store/store_vars.php','solines',document.form.solines.value);
		}
	else if(somata==0){
		sendVar('store/store_vars.php','solines',document.form.solines.value);
		}
		
	if(somata==0 && solines[0]=='n' && temp_levitas[0]=='n'){
		MakeRequest("store/get_vars.php", "destroykalorifer");
		}
	else if(somata[0]=='n' && solines[0]=='n' && temp_levitas[0]=='n'){
		MakeRequest("store/get_vars.php", "destroykalorifer");
		}
	else if(somata[0]=='n' && solines==0 && temp_levitas[0]=='n')
	{
		MakeRequest("store/get_vars.php", "destroykalorifer");

	}

}

function checkexport(x){
	var m_var=MakeRequest("store/get_vars.php", "door");
	var p_var=MakeRequest("store/get_vars.php", "window");
	
	var second_m=MakeRequest("store/get_vars.php", "ipsos_door1");
	var second_p=MakeRequest("store/get_vars.php", "ipsos_window1");
	
	var level=MakeRequest("store/get_vars.php", 'level');
	
	if(second_m>0)
		door_exist=1;
	else
		door_exist=0;
	
	if(second_p>0)
		window_exist=1;
	else
		window_exist=0;
		
	if(m_var>0 && p_var==0 && x==0 && !door_exist && level[0]=='c'){
	Modalbox.show('forms/'+type_of+'/door.php', {width: 600, height: 600, title: false, overlayOpacity: 0.75});
	Modalbox.deactivate();
	}
	
	if(p_var>0 && m_var==0 && x==0 && !window_exist  && level[0]=='c'){
	Modalbox.show('forms/'+type_of+'/window.php', {width: 600, height: 600, title: false, overlayOpacity: 0.75});
	Modalbox.deactivate();
	}
	
	if(p_var>0 && m_var>0 && x==0 && !door_exist && !window_exist  && level[0]=='c'){
	Modalbox.show('forms/'+type_of+'/door.php', {width: 600, height: 600, title: false, overlayOpacity: 0.75});
	Modalbox.deactivate();
	}
	
	if(p_var>0 && x==1  && level[0]=='c'){
	Modalbox.show('forms/'+type_of+'/window.php', {width: 600, height: 600, title: false, overlayOpacity: 0.75});
	Modalbox.deactivate();
	}
	
	if(m_var>0 && x==2  && level[0]=='c'){
	
	sendVar('store/store_vars.php','dont_Ask_for_windows', 1);
	
	Modalbox.show('forms/'+type_of+'/door.php', {width: 600, height: 600, title: false, overlayOpacity: 0.75});
	Modalbox.deactivate();
	}
	
	}
	
function checkforwindowsinput(){
	var p_var=MakeRequest("store/get_vars.php", "window");
	
	
	if(p_var>0){
	//Modalbox.hide();
	Modalbox.show('forms/'+type_of+'/window.php', {width: 600, height: 600, title: false, overlayOpacity: 0.75});
	Modalbox.deactivate();
	}
	else{
	Modalbox.hide();
	}
}
	
function openbox (x) { 
	Modalbox.show('forms/'+type_of+'/'+x+'_d<a href="../main.php">Costonline - Υπολογιστής Κόστους Κατασκευής</a>iv.php', {width: 600, height: 600, title: false, overlayOpacity: 0.75});
	Modalbox.deactivate();
	}

function changeDivSolines() {
	temp_solines=MakeRequest("store/get_vars.php", "solines");
	var level=MakeRequest("store/get_vars.php", 'level');
	
	if(level[0]=='c'){
 	document.getElementById("somatadiv").innerHTML = "<input class='field' name='solines' type='text' id='solines' size='3' maxlength='3' onKeyPress='return(numbersonly(event, false));' value='"+temp_solines+"'>";
	document.getElementById("solinesdiv").innerHTML = "<select class='drop' name='somata' id='somata' onchange='backto()'><option name='somata' value='no'>Όχι</option><option name='somata' value='yes'>Ναί</option></select>";}
	
		$j(function(){
			$j("select").uniform();			
		});
	}
	
function backto(){
	var level=MakeRequest("store/get_vars.php", 'level');
	level=level.replace(/[^a-zA-Z 0-9]+/g,'');
	
	if(level=='complex'){
	 document.getElementById("somatadiv").innerHTML = "<select class='drop' name='solines' id='solines'><option name='solines' value='yes'>Ναί</option><option name='solines' value='no'>Όχι</option></select>";
	document.getElementById("solinesdiv").innerHTML = "<input class='field' name='somata' type='text' id='somata' size='3' maxlength='3' onKeyPress='return(numbersonly(event, false));' value='0'>";}
	
	$j(function(){
			$j("select").uniform();			
		});
	}
	
function checkfor (name, is_next) {
	var level=MakeRequest("store/get_vars.php", 'level');
	level=level.replace(/[^a-zA-Z 0-9]+/g,'');
	
		if(is_next && level=='complex'){
		
			var b_var_temp=MakeRequest("store/get_vars.php", "temp_"+name);
			
			var check_r=MakeRequest("store/get_vars.php", "mikos_"+name+"1");
	
			b_var_temp=b_var_temp.replace(/[^a-zA-Z 0-9]+/g,'');
					
					
			if(b_var_temp>0 && check_r<=0){
					Modalbox.show('forms/'+type_of+'/'+name+'_div.php', {width: 600, height: 600, title: false, overlayOpacity: 0.75});
					Modalbox.deactivate();}

			}
		else if (!is_next && level=='complex'){
			Modalbox.show('forms/'+type_of+'/'+name+'_div.php', {width: 600, height: 600, title: false, overlayOpacity: 0.75});
			Modalbox.deactivate();
			}
	
	}
	
	
function changeDiv(x,y){
	
	var temp=MakeRequest("store/get_vars.php", x);
	
	var level=MakeRequest("store/get_vars.php", 'level');
	level=level.replace(/[^a-zA-Z 0-9]+/g,'');
	var div_name="button_"+x;

	
	if(y==1){
	if(temp>0 && level=="complex"){
		
	if(x=='window')
		stringfunction="checkexport(1)";
	else if(x=='door')
		stringfunction="checkexport(2)";
	else
		stringfunction="checkfor(\""+x+"\",0);";
		
		document.getElementById(div_name).innerHTML = "<input type='image' src='images/change.png' name='"+x+"_button' id='"+x+"_button' onclick='"+stringfunction+"' class=\"button\">";
		}}
	else if(y==0 && level=="complex"){
			document.getElementById(div_name).innerHTML = "<input name='"+x+"' type='text' class='field' id='"+x+"' size='2' maxlength='2' onkeypress='return numbersonly(event, false);' value=0 >";
		}
	}
	
function isEmpty(){
	
	var request=MakeRequest("store/get_vars.php", "checkoltet");
	
	if(request==1){
	$j('#tetragonika').click();
	}
	else if(request==0)
	c_alert(2);
	}


function normaliseNewlines(input){
    var reNewline=/\u000d[\u000a\u0085]|[\u0085\u2028\u000d\u000a]/g;
        nl='\u000a'; // LF
    return input.replace(reNewline,nl);
}

function ifmore(){
		temp_gipsosanides=MakeRequest("store/get_vars.php", "gipsosanides");
		var level=MakeRequest("store/get_vars.php", 'level');
		level=level.replace(/[^a-zA-Z 0-9]+/g,'');
		
		if(temp_gipsosanides==1 && level=='complex'){
			//alert('ok');
		Modalbox.show('forms/'+type_of+'/gips.php', {width: 600, height: 600, title: false, overlayOpacity: 0.75});
		Modalbox.deactivate();
		}
		else{
		loadmoney(0);
	}
		
	}
	
function submithis(xform){
	xform=document.gipsosanidesform;

	
	sendVar('store/store_vars.php','xorismata', xform.xorismata.value);
	sendVar('store/store_vars.php','idika_temaxia', xform.idika_temaxia.value);
	sendVar('store/store_vars.php','ependiseis', xform.ependiseis.value);
	sendVar('store/store_vars.php','orofi', xform.orofi.value);
	loadmoney(0);
}

//constraction
function tetcon(){
	sendVar('store/store_vars.php','floors',  document.form.floors.value);
	sendVar('store/store_vars.php','basement',  document.form.basement.value);
	
	
	
	if(document.form.floors.value==1 && document.form.basement.value=='yes'){
	c_alert(7);
	}
	else{
		ConstractDiv();
		}

	
}


function ConstractDiv(){
	
	basement=MakeRequest("store/get_vars.php", "basement");
	floors=MakeRequest("store/get_vars.php", "floors");
	basement=basement.replace(/[^a-zA-Z 0-9]+/g,'');
	
	if(basement=='yes'){
	var string ="<div><table cellspacing='15' cellpadding='0' align='center'><tr><td align='right'><img src='images/delete_icon.png' onclick='delete_tet(0);' style='cursor:pointer;'></td><td align='right'>Τετραγωνικά υπογείου: </td><td><input name='floor_0' type='text' id='floor_0' size='3' maxlength='3' onKeyPress='return numbersonly(event, false);' class='field' value='"+MakeRequest("store/get_vars.php", "floor_0")+"'></td></tr></table></div>";
	floors=floors-1;}
	else
	var string ='';
		
	for(i=1;i<=floors;i++){
		if(string.length==0){
			if(i==1){
			string = string+"<div><table cellspacing='15' cellpadding='0' align='center'><tr><td><img src='images/delete_icon.png' onclick='delete_tet("+i+");' style='cursor:pointer;'></td><td align='right'>Τετραγωνικά ισογείου: </td><td><input name='floor_"+i+"' type='text' id='floor_"+i+"' size='3' maxlength='3' onKeyPress='return numbersonly(event, false);' class='field' value='"+MakeRequest("store/get_vars.php", "floor_"+i)+"'></td></tr></table></div>";
			}
			else
			string = "<div><table cellspacing='15' cellpadding='0' align='center'><tr><td align='right'><img src='images/delete_icon.png' onclick='delete_tet("+i+");' style='cursor:pointer;'></td><td align='right'>Τετραγωνικά "+(i-1)+"ου ορόφου: </td><td><input name='floor_"+i+"' type='text' id='floor_"+i+"' size='3' maxlength='3' onKeyPress='return numbersonly(event, false);' class='field' value='"+MakeRequest("store/get_vars.php", "floor_"+i)+"'></td></tr></table></div>";}
		else if(i==1){
			string = string+"<div><table cellspacing='15' cellpadding='0' align='center'><tr><td><img src='images/delete_icon.png' onclick='delete_tet("+i+");' style='cursor:pointer;'></td><td align='right'>Τετραγωνικά ισογείου: </td><td><input name='floor_"+i+"' type='text' id='floor_"+i+"' size='3' maxlength='3' onKeyPress='return numbersonly(event, false);' class='field' value='"+MakeRequest("store/get_vars.php", "floor_"+i)+"'></td></tr></table></div>";
			}
		else{
			string = string+"<div><table cellspacing='15' cellpadding='0' align='center'><tr><td><img src='images/delete_icon.png' onclick='delete_tet("+i+");' style='cursor:pointer;'></td><td align='right'>Τετραγωνικά "+(i-1)+"ου ορόφου: </td><td><input name='floor_"+i+"' type='text' id='floor_"+i+"' size='3' maxlength='3' onKeyPress='return numbersonly(event, false);' class='field' value='"+MakeRequest("store/get_vars.php", "floor_"+i)+"'></td></tr></table></div>";}
	}
	
	document.getElementById('tetcon_div').innerHTML = string;
	}

function all_tet(x){
	basement=MakeRequest("store/get_vars.php", "basement");
	floors=MakeRequest("store/get_vars.php", "floors");
	var i;
	var check=1;
	var oltet=0;
	
	basement=basement.replace(/[^a-zA-Z 0-9]+/g,'');
	
	if(basement=='yes'){
		i=0;
		floors--;}
	else
		i=1;
	
	
	for(i1=i;i1<=floors;i1++){
		y="floor_"+i1;
		if(document.getElementById(y).value==0)
		check=0;
		}
	
	if(check){
		
		
	for(i2=i;i2<=floors;i2++){
		y="floor_"+i2;
		oltet=oltet + parseFloat(document.getElementById(y).value);
		sendVar('store/store_vars.php', 'floor_'+i2,  document.getElementById(y).value);
		sendVar('store/store_vars.php', 'oltet', oltet);
		}
		
	}
	
	
	if(x==0){
	//$j(this).changeSlider({pixels: 0, duration:300});
	}
	else if(x==1  && check){
	//$j(this).changeSlider({pixels:-2000, duration:300});
	}
	else if(!check){
		c_alert(8);
		}

}

function delete_tet (x){
	var string='';
	var floors=MakeRequest("store/get_vars.php", "floors");
	
	if(x==0 && floors>1)
	string="Υπόγειο";
	else if (floors>1)
	string=x+"ο Όροφος";
	
	var answer = confirm("Είστε σίγουρος θέλετε να διαγράψετε το "+string);
	
	if(answer){
		sendVar("store/store_vars.php", "deletefloor", x);
		ConstractDiv();
		}
		
}


function alerts(){
	
	//switch here
	
	}
	
function checkwd(){
	var windows=MakeRequest("store/get_vars.php", "window_m");
	var door=MakeRequest("store/get_vars.php", "door_m");
	var kagela=MakeRequest("store/get_vars.php", "kagela_m");
	var marmaropodies=MakeRequest("store/get_vars.php", "marmaropodies");
	marmaropodies=marmaropodies.replace(/[^a-zA-Z 0-9]+/g,'');
	
	
	if(windows==0 && door==0 && kagela==0 && marmaropodies=='yes')
	alert("Δεν έχετε εργασίες που να χρειάζονται μαρμαροποδιές, δεν είναι δυνατός ο υπολογισμός τους");
	
	}
	
//apokopi

function apokopi(name, name2){
		
		if(name==true){
		sendVar("store/store_vars.php", name2, 'apokopi');
		}
		else{
		sendVar("store/store_vars.php", name2, 'not_apokopi');
		}
		
	}

//constraction
function loadmoney(x){
	document.getElementById('sigrafi').innerHTML='';
	if(x==0){
		
	
	document.getElementById('showmoney').innerHTML = "<img src='images/loading.gif'>";
	setTimeout("loadmoney(1)",2000);
	}
	else if(x==1){
	var money = MakeRequest("money.php", Math.random());
	var session_id=MakeRequest("store/get_vars.php", "session_id");
	session_id=session_id.replace(/[^a-zA-Z 0-9]+/g,'');

	
	temp='<a href="#" onclick="return popitup(\'report.php?valid=1&sid='+session_id+'\')"><img src="images/sigrafi.png" width=240 height=54 alt="Συγγραφή" /></a>';
	
	document.getElementById('showmoney').innerHTML = money+",00 &#8364;";
	setTimeout("document.getElementById('sigrafi').innerHTML=temp", 800);}
	
	
}

function popitup(url) {
	newwindow=window.open(url,'name','height=600, width=800,scrollbars=1, resizable=0, status=0, menubar=0');
	if (window.focus) {newwindow.focus()}
	return false;
}

function popitup_coupon(url) {
	newwindow=window.open(url,'name','height=1000, width=700,scrollbars=1, resizable=0, status=0, menubar=0');
	if (window.focus) {newwindow.focus()}
	return false;
}


//jQuery function for the control of the effects
//$j(this).changeSlider({pixels:-1000, duration:300});
/*$j.fn.changeSlider = function(){

     args = arguments[0] || {};
     pixels = args.pixels;
     duration = args.duration || 300;
     
     $j("#parent1").animate(
       { left: pixels+'px' },
         duration,
         'swing'
         );         
     };*/


	
/****************************-*************************/
function start(){
	isset_type=MakeRequest("store/get_vars.php", "type_set");
	isset_level=MakeRequest("store/get_vars.php", "level_set");
	isset_nomos=MakeRequest("store/get_vars.php", "nomos_set");
	isset_apodoxi=MakeRequest("store/get_vars.php", "apodoxi_set");
	
	isset_type=isset_type.replace(/[^a-zA-Z 0-9]+/g,'');
	isset_level=isset_level.replace(/[^a-zA-Z 0-9]+/g,'');
	isset_nomos=isset_nomos.replace(/[^a-zA-Z 0-9]+/g,'');
	isset_apodoxi=isset_apodoxi.replace(/[^a-zA-Z 0-9]+/g,'');
	
	if(isset_type=='ok' && isset_level=='ok' && isset_nomos=='ok' && isset_apodoxi=='ok'){
		window.location = 'main.php?sid='+Math.random();
		}
	else{
			if(isset_type!='ok'){
			c_alert(3);
			return 0;
			}
			
			if(isset_level!='ok'){
			c_alert(4);
			return 0;
			}
			
			if(isset_nomos!='ok'){
			c_alert(5);
			return 0;
			}
			
			if(isset_apodoxi!='ok'){
			c_alert(6);
			return 0;
			}
		}
	
	}
	
	
function gogogo(x){
	if(x=='m'){
		//sendVar('store/store_vars.php', 'who',  'engineer');
		window.location = 'start_costonline.php?who=engineer&sid='+Math.random();
		//gogogo('m');
		}
		else if(x=='p'){
			//sendVar('store/store_vars.php', 'who',  'private');
			window.location = 'start_costonline.php?who=private&sid='+Math.random();
			//gogogo('p');
			}

	}
	
function disable_field(x){

	x.value=0;
	
	if(x.disabled==false){
		x.disabled=true;
		x.setAttribute("class", "field_disable");}
	else if(x.disabled==true){
		x.disabled=false;
		x.setAttribute("class", "field");}
		
	
	}


function sendall(){
	if(type_of=='renovation'){
		//alert(type_of);
		if(level_of=='complex'){
		sendVar('store/store_vars.php','tixoi', document.form.tixoi.value);
		sendVar('store/store_vars.php','dapeda_ap', document.form.dapeda_ap.value);
		sendVar('store/store_vars.php','epipla', document.form.epipla.value);
		sendVar('store/store_vars.php','checkapoxiloseis',1);}
		
		if(level_of=='complex'){
		sendVar('store/store_vars.php','somata',document.form.somata.value);
		sendVar('store/store_vars.php','levitas',document.form.levitas.value);
		checksomata(document.form.somata.value, document.form.solines.value);}
		else if(level_of=='simple'){
		simplekalorifer();}
		
		sendVar('store/store_vars.php','bathswc',document.form.bathswc.value);
		
		if(level_of=='complex'){
		sendVar('store/store_vars.php','pliroseis_tixwn', document.form.pliroseis_tixwn.value);
		sendVar('store/store_vars.php','pliroseis_tixwn_check', checkapokopi());}
		
		sendVar('store/store_vars.php','grompeton', document.form.grompeton.value);
		
		sendVar('store/store_vars.php','plaktetr', document.form.plaktetr.value);
		sendVar('store/store_vars.php','xiltetr', document.form.xiltetr.value);
		
		sendVar('store/store_vars.php','thor', document.form.thor.value);
		
		sendVar('store/store_vars.php','portes', document.form.portes.value);
		sendVar('store/store_vars.php','pataria', document.form.pataria.value);
		
		if(level_of=='simple'){
		sendVar('store/store_vars.php','mpalkonoportes', document.form.mpalkonoportes.value);
		sendVar('store/store_vars.php','parathira', document.form.parathira.value);
		sendVar('store/store_vars.php','color', document.form.color.value);
		sendVar('store/store_vars.php','sites', document.form.sites.value);}
		
		sendVar('store/store_vars.php','kagela', document.form.kagela.value);
		
		if(level_of=='complex'){
		sendVar('store/store_vars.php','spatoularisma', document.form.spatoularisma.value);
		sendVar('store/store_vars.php','vapsimo', document.form.vapsimo.value);}
		
		sendVar('store/store_vars.php','tzaki', document.form.tzaki.value);
		
		sendVar('store/store_vars.php','petra', document.form.petra.value);
		
		sendVar('store/store_vars.php','tripsimo',  document.form.tripsimo.value);
		
		if(level_of=='simple'){
		sendVar('store/store_vars.php','baths', document.form.baths.value);
		sendVar('store/store_vars.php','wc', document.form.wc.value);}
		
		}
	else if(type_of=='constraction'){
		//alert(type_of);
		
		if(level_of=='complex'){
		sendVar('store/store_vars.php', 'eskafes_m3',  document.form.eskafes_m3.value);
		sendVar('store/store_vars.php', 'mpaza',  document.form.mpaza.value);}
		
		sendVar('store/store_vars.php', 'mpeta',  document.form.mpeta.value);
		
		if(level_of=='complex'){
		sendVar('store/store_vars.php', 'tixoi1',  document.form.tixoi1.value);
		sendVar('store/store_vars.php','tixoi2',  document.form.tixoi2.value);}
		
		sendVar('store/store_vars.php','bathswc',  document.form.bathswc.value);
		sendVar('store/store_vars.php','kitchen',  document.form.kitchen.value);
		
		if(level_of=='complex'){
		sendVar('store/store_vars.php','somata',  document.form.somata.value);}
		
		if(level_of=='complex'){
		sendVar('store/store_vars.php','intermix',  document.form.intermix.value);
		sendVar('store/store_vars.php','paradosiakos',  document.form.paradosiakos.value);}
		
		sendVar('store/store_vars.php','grompeton', document.form.grompeton.value);
		sendVar('store/store_vars.php','plaktetr', document.form.plaktetr.value);
		sendVar('store/store_vars.php','xiltetr', document.form.xiltetr.value);
		sendVar('store/store_vars.php','skales', document.form.skales.value);
		
		if(level_of=='simple'){
		sendVar('store/store_vars.php','mpalkonoportes', document.form.mpalkonoportes.value);
		sendVar('store/store_vars.php','parathira', document.form.parathira.value);
		sendVar('store/store_vars.php','color', document.form.color.value);
		sendVar('store/store_vars.php','sites', document.form.sites.value);}
		
		sendVar('store/store_vars.php','portes', document.form.portes.value);
		sendVar('store/store_vars.php','pataria', document.form.pataria.value);
		sendVar('store/store_vars.php','thor', document.form.thor.value);
		
		if(level_of=='complex'){
		sendVar('store/store_vars.php','spatoularisma', document.form.spatoularisma.value);
		sendVar('store/store_vars.php','vapsimo', document.form.vapsimo.value);}
		
		sendVar('store/store_vars.php','skepi_emfanis',  document.form.skepi_emfanis.value);
		sendVar('store/store_vars.php','skepi_mi_emfanis',  document.form.skepi_mi_emfanis.value);
		
		checkraddio(document.form.fibranx, 'fibranx');
		checkraddio(document.form.fibranr, 'fibranr');
		checkraddio(document.form.fibranx, 'fibranx');
		
		if(level_of=='complex'){
		sendVar('store/store_vars.php','steganoseis', document.form.steganoseis.value);}
		
		sendVar('store/store_vars.php','kagela', document.form.kagela.value);
		sendVar('store/store_vars.php','tzaki', document.form.tzaki.value);
		sendVar('store/store_vars.php','petra', document.form.petra.value);
		sendVar('store/store_vars.php','garaz', document.form.garaz.value);
		
		if(level_of=='simple'){
		sendVar('store/store_vars.php','baths', document.form.baths.value);
		sendVar('store/store_vars.php','wc', document.form.wc.value);}
		}
	
	
	}
	
function c_alert(x){
	Modalbox.show('alert.php?alert='+x, {width: 525, title: false, overlayOpacity: 0.75});
	Modalbox.deactivate();
	return 0;
	}

function last_sigrafi(){
	Modalbox.show('sigrafi.php', {width: 420, height: 180, title: false, overlayOpacity: 0.75});
	Modalbox.deactivate();
	}
	
function send_mail(x, y){
	
	if(x!=y || x=='' || y==''){
		document.form_sigrafi.mail1.value='';
		document.form_sigrafi.mail2.value='';
		document.getElementById('error_mail').innerHTML='<font color="red">* Παρακαλώ να επαληθεύσετε το mail σας</font>';
		}
	else{
		Modalbox.hide();
		sendVar('mail.php','mail', x);
		}
		
	}
	

	
