window.onload = function (){
		alerteaza();
	}
function alerteaza(){
	var id=document.getElementById('id_prod_banner').innerHTML;
	if(id==''){
		id=0;
	}
	else{
		if(id==3){
			id=0;
		}
		else{
			id++;
		}
	}
	show_header_prod(id);
	var t=setTimeout(alerteaza,5000);	
}
function underline_del_filter(id){
	var id_del='id_'+id;
	document.getElementById(id_del).style.color="#ff0000";
	}
function underline_del_filter_out(id){
	var id_del='id_'+id;
	document.getElementById(id_del).style.color="#000000";
	}
	
function change_page_nr(id,CatName,subsubCatID,subCatName,subsubCatName,link_to_site){
	var link_site=link_to_site + 'subcat_produse_' + CatName + '_' + subsubCatID + '/'+ id +'/' + subCatName+ '/' + subsubCatName + '.htm';
	document.location.href=link_site;
	}

//filters
function show_filter_details(id_sel,all_id){
	var id_selectat='filtru_subcat_'+id_sel;
	document.getElementById(id_selectat).style.display='block';
	
	for(var i=0;i<=all_id;i++){
		var id_to_close='filtru_subcat_'+i;
		if(i!=id_sel){
			document.getElementById(id_to_close).style.display='none';
		}

	}
}
function show_open_menu(id_sel,all_id){
	if(id_sel){
		var id_selectat='meniu_'+id_sel;
		document.getElementById(id_selectat).className='menu_on';
		
		for(var i=0;i<=all_id;i++){
			var id_to_close='meniu_'+i;
			if(i!=id_sel){
				document.getElementById(id_to_close).className='menu';
			}
		}
	}
}
function close_all_filters(all_id){
	for(var i=0;i<=all_id;i++){
		var id_to_close='meniu_'+i;
		document.getElementById(id_to_close).className='menu';
	}
	for(var i=0;i<=all_id;i++){
		var id_to_close='filtru_subcat_'+i;
		document.getElementById(id_to_close).style.display='none';

	}
}
//---

function submit_on_enter(id){
	if(id.keyCode==13){
		submit_login();
	}
}

function show_form_new_addr(){
		if(document.getElementById('form_new_addr').style.display=='none'){
			document.getElementById('form_new_addr').style.display='block';
			}
		else{
			document.getElementById('form_new_addr').style.display='none';
			}
	}
function show_tab_form(val){
	if(val==1){
		document.getElementById('tab_content_1').style.display='block';
		document.getElementById('tab_content_2').style.display='none';
		document.getElementById('tab_content_3').style.display='none';
		
		var transp = document.getElementById("btn_tab_detalii");
		transp.className="button_on";

		var transp = document.getElementById("btn_tab_transport");
		transp.className="button";

		var istoric = document.getElementById("btn_tab_istoric");
		istoric.className="button";
		
	}
	else if(val==2){
		document.getElementById('tab_content_1').style.display='none';
		document.getElementById('tab_content_2').style.display='block';
		document.getElementById('tab_content_3').style.display='none';
		
		
		var transp = document.getElementById("btn_tab_detalii");
		transp.className="button";

		var transp = document.getElementById("btn_tab_transport");
		transp.className="button_on";

		var istoric = document.getElementById("btn_tab_istoric");
		istoric.className="button";
	}
	else if(val==3){
		document.getElementById('tab_content_1').style.display='none';
		document.getElementById('tab_content_2').style.display='none';
		document.getElementById('tab_content_3').style.display='block';
		
		var transp = document.getElementById("btn_tab_detalii");
		transp.className="button";

		var transp = document.getElementById("btn_tab_transport");
		transp.className="button";

		var istoric = document.getElementById("btn_tab_istoric");
		istoric.className="button_on";
	}
}