function ceny(x){
var x;	

	x.value = x.value.replace(',','.');
	
		x.value = x.value.replace(/[^\d\.\,]+/g, '')
}


	

function logoff(file,target){
advAJAX.post({
  url: file,
	parameters : {
    "logoff" : true
  },
  onSuccess : function(obj) { 
  	
  	
  	document.getElementById(target).innerHTML = (obj.responseText);
  },
onLoading : function(obj) {
document.getElementById(target).innerHTML= "<img src=\"gfx/loading.gif\"/>";
},
  onError : function(obj) { 
    alert("Error: " + obj.status); 
  }
});
}



function readfile(val,val1,file,target){
advAJAX.get({
  url: file,
	parameters : {
    "par" : val,
    "par1" : val1
  },
  onSuccess : function(obj) { 
  	document.getElementById(target).innerHTML = (obj.responseText);
  },
onLoading : function(obj) {
document.getElementById(target).innerHTML= '<img src="gfx/loading.gif"/>';
},
  onError : function(obj) { 
    alert("Error: " + obj.status); 
  }
});
}


function readfilepost(val,val1,file,target){
advAJAX.post({
  url: file,
	parameters : {
    "par" : val,
    "par1" : val1
  },
  onSuccess : function(obj) { 
  	document.getElementById(target).innerHTML = (obj.responseText);
  },
onLoading : function(obj) {
document.getElementById(target).innerHTML= "<img src=\"gfx/loading.gif\"/>";
},
  onError : function(obj) { 
    alert("Error: " + obj.status); 
  }
});
}


function postsenddata(forma,file,target){
advAJAX.submit(document.getElementById(forma), 
  {
  	url: file,
    onSuccess : function(obj) { 
      document.getElementById(target).innerHTML = (obj.responseText);
    },
    

onLoading : function(obj) {
document.getElementById(target).innerHTML= "<img src=\"gfx/loading.gif\"/>";
},
    onError : function(obj) { 
      alert("Error: " + obj.status);
    }
  }
);	
}



function SetCookie(cookieName,cookieValue,nmin) {

 var expire = new Date();
 
 if (nmin==null || nmin==0) nmin=1;

 var sett =  new Date(expire.getTime() + nmin *60*1000);
  
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+sett.toGMTString();
}		



function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0){
			
		SetCookie(name,1,15);	

		return true;	
		} 
	}
	window.location = "index.php";
}



function email_validate(src) 
{
  var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
  return regex.test(src);
}

function sh_d(identyfikator) { 
	
if(document.getElementById(identyfikator).style.display == "none"){
	
document.getElementById(identyfikator).style.display = "inline";
	
}else{
document.getElementById(identyfikator).style.display = "none";	

	
}
}

function show_hiden_div(identyfikator,stan) { 
	
if(stan == "H"){
	
document.getElementById(identyfikator).style.display = "none";
	
}else{
	
document.getElementById(identyfikator).style.display = "inline";
	
}
}

