var req;

			function loadXMLDoc(url,numeobiect) {
				
				var nume=numeobiect;
   				// Internet Explorer
   				try { req = new ActiveXObject("Msxml2.XMLHTTP"); }
   				catch(e) {
      				try { req = new ActiveXObject("Microsoft.XMLHTTP"); }
      				catch(oc) { req = null; }
   				}

   				// Mozailla/Safari
   				if (!req && typeof XMLHttpRequest != "undefined") { req = new XMLHttpRequest(); }

   				// Call the processChange() function when the page has loaded
   				if (req != null) {
   					if (nume=='model'){
      				req.onreadystatechange = processChangeModel;
      				req.open("GET", url, true);
      				req.send(null);
   					}
      				if(nume=='tip_geam'){
      				req.onreadystatechange = processChangeTipGeam;
      				req.open("GET", url, true);
      				req.send(null);
   					}
   					if(nume=='rezultate'){
      				req.onreadystatechange = processChangeRezultate;
      				req.open("GET", url, true);
      				req.send(null);
   					}
   				}
			}

			function processChangeModel() {
				// The page has loaded and the HTTP status code is 200 OK
   				var numeobiect="model";
   				if (req.readyState == 4 && req.status == 200) {
				
				
      				// Write the contents of this URL to the searchResult layer
      				
      				getObject(numeobiect).innerHTML = req.responseText;
   				}
			}
			function processChangeTipGeam() {
				// The page has loaded and the HTTP status code is 200 OK
   				var numeobiect="tip_geam";
   				if (req.readyState == 4 && req.status == 200) {
				
				
      				// Write the contents of this URL to the searchResult layer
      				
      				getObject(numeobiect).innerHTML = req.responseText;
   				}
			}
			function processChangeRezultate() {
				// The page has loaded and the HTTP status code is 200 OK
   				var numeobiect="rezultate";
   				if (req.readyState == 4 && req.status == 200) {
				
				
      				// Write the contents of this URL to the searchResult layer
      				
      				getObject(numeobiect).innerHTML = req.responseText;
   				}
			}

			function getObject(name) {
   				var ns4 = (document.layers) ? true : false;
   				var w3c = (document.getElementById) ? true : false;
   				var ie4 = (document.all) ? true : false;

   				if (ns4) return eval('document.' + name);
   				if (w3c) return document.getElementById(name);
   				if (ie4) return eval('document.all.' + name);
   				return false;
			}
			
			
			
function switch_tab(id,no_of_tabs)
{
	if (id==1)	
	{
		var prev = no_of_tabs;
		var next = id+1;
	}
	else if (id==2)
	{
		var prev = id-1;
		var next = no_of_tabs;
	}
	else
	{
		prev = id-1;
		var next = 1;
	}	
	
	
 			
	var nextTabHead = 'tab-'+next;
	var prevTabHead = 'tab-'+prev;	
	var tabHead = 'tab-'+id;
	
	var nextTab1 = 'tab-'+next+'-content-1';
	var nextTab2 = 'tab-'+next+'-content-2';
	var nextTab3 = 'tab-'+next+'-content-3';
	var nextTab4 = 'tab-'+next+'-content-4';
	var prevTab1 = 'tab-'+prev+'-content-1';
	var prevTab2 = 'tab-'+prev+'-content-2';
	var prevTab3 = 'tab-'+prev+'-content-3';
	var prevTab4 = 'tab-'+prev+'-content-4';
	var tab1 = 'tab-'+id+'-content-1';
	var tab2 = 'tab-'+id+'-content-2';
	var tab3 = 'tab-'+id+'-content-3';
	var tab4 = 'tab-'+id+'-content-4';
	
	
	$(tabHead).className="tabactive";
	$(prevTabHead).className="tab";
	$(nextTabHead).className="tab";
	
	$(tab1).style.display='table-cell';
	$(tab2).style.display='table-cell';
	$(tab3).style.display='table-cell';
	$(tab4).style.display='table-cell';
	$(nextTab1).style.display='none';
	$(nextTab2).style.display='none';
	$(nextTab3).style.display='none';
	$(nextTab4).style.display='none';
	$(prevTab1).style.display='none';
	$(prevTab2).style.display='none';
	$(prevTab3).style.display='none';
	$(prevTab4).style.display='none';
	
	
	
	
}
