


function AjaxPostSend(setdata,datasend,divout) {	
$.ajax({
type: setdata.typesend,
url:  setdata.file,
dataType:   'html',
data: datasend, 

success: function(msg) { 	$('#' + divout).html(msg); },
error: function (err) {alert(err);}
});	
	
}

//function AjaxPostSend(setdata,datasend,options) {	
//$.ajax({
//type: setdata.typesend,
//url:  setdata.file,
//dataType:   'html',
//data: datasend, 
//
//success: function(msg) { 	$(options.divout).html(msg); },
//error: function (err) {alert(err);}
//});	
//	
//}



function RegAjaxPost (data,options) {	
	
$.ajax({
type: options.typesend,
url:  options.file,
dataType:   'html',
data: data, 

success: function(msg) { $(options.divaout).html(msg);},
//$('#stage').load('result.html');

error: function () {}
});	
	
}		  

function show_hiden_div(identyfikator,stan) { 
	
if(stan == "h"){
	
$("#"+identyfikator).hide();
	
}else{
	
$("#"+identyfikator).show();
	
}
}

function show_div_id(cons,val,showdiv,hidediv) { if(cons == val){$("#"+showdiv).show();$("#"+hidediv).hide();
}else{$("#"+showdiv).hide();$("#"+hidediv).show();}}




function showgalery(img, width, height){
var Win = window.open('foto.php?' + 'img=' +img ,"Window",'width=' + width + ',height=' + height +  ',resizable=0,scrollbars=yes,menubar=no' );
}




// menu
var menuOtw=false;
function close_menu(num)
{
	if (document.getElementById('menu_cat_'+num))
		document.getElementById('menu_cat_'+num).className='menu1_off';
}

function menu_cat_change(num) {
	if (menuOtw==num){
    close_menu(menuOtw);
    menuOtw=false;
  } else {  
    if (menuOtw!=false) close_menu(menuOtw);			
   
    if (document.getElementById('menu_cat_'+num))
      document.getElementById('menu_cat_'+num).className='menu1_on';      
	menuOtw=num;
  }
  return false;  
}

function MenuStart(dId) {
  menu_cat_change(dId);
}






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

