function changeStyle(id, newClass){
	document.getElementById(id).style.fontWeight = 'normal';
	//document.getElementById(id).style.border = '1px 0px 1px 0px';
	document.getElementById(id).style.background = 'transparent';
	document.getElementById(id).style.borderColor = '#F8FDF5';
	document.getElementById(id).style.margin = '0px 5px 0px 5px;';

	}
	
function changeStyle2(id){

	document.getElementById(id).style.fontWeight = 'bold';
	//document.getElementById(id).style.border = '1px 0px 1px 0px';
	document.getElementById(id).style.background = '#D6DFF9';
	document.getElementById(id).style.borderColor = '#999999';
	document.getElementById(id).style.margin = '0px 5px 0px 5px;';
	

	}	

function changeStyle3(id){ //alert(document.getElementsByName(id).length)

	if(document.getElementsByName(id)['0']){document.getElementsByName(id)['0'].style.textDecoration = 'none';}
	if(document.getElementsByName(id)['0']){document.getElementsByName(id)['0'].style.fontWeight = '100';}
	//document.getElementById(id).style.border = '1px 0px 1px 0px';
	}
	
function changeStyle31(id){ //alert(document.getElementsByName(id).length)

	if(document.getElementsByName(id)['0']){document.getElementsByName(id)['0'].style.textDecoration = 'underline';}
	if(document.getElementsByName(id)['0']){document.getElementsByName(id)['0'].style.fontWeight = 'bold';}
	//document.getElementById(id).style.border = '1px 0px 1px 0px';
	}	
	
var xmlhttp

function show(str)
{ 
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var url="include/center.php";
url=url+"?"+str+"&conn";

  
window.location.hash = str;
function setCookie2 (name, value, expires) {
        if (!expires) expires = new Date();
document.cookie = name + "=" + escape (value) + 
"; expires=" + expires.toGMTString() +  "; path=/";
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
setCookie('url',str,365);//alert(document.getElementById(str).name)

//url=url+"&sid="+Math.random();
if(str!='services.php' && str!='' && str!='oferte_cereri.php'  && str!='baza_data.php'  && str!='ttt.php'  && str!='catalog.php'  && str!='insert.php'  && str!='povesti_succes.php'  && str!='evenimente.php'){
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
}

function processPage(sFile) {

sFile = sFile.replace(/nowrap>\r\n/gi, "nowrap>")
sFile = sFile.replace(/\r\n<\/td>/gi, "<\/td>")
results = sFile.match(/>(\d+)</gi)
document.getElementById("center").innerHTML = results[0].match(/\d+/);
}


function stateChanged(){
	if (xmlhttp.readyState==4) {
		
		 //processPage(xmlhttp.responseText);
		var result=xmlhttp.responseText;
		//if (!result.documentElement && xmlhttp.responseStream) {alert('bb')
			//result.load(xmlhttp.responseStream);
			//}//alert(result.getElementsById("center").length)
			//alert(result);
		document.getElementById("Model").innerHTML=result;//[1].firstChild.data;
		}
	else {
		//document.getElementById('Model').innerHTML='Loading<br><br><img src="images/loadingAnimation.gif">';
		}


/*if (xmlhttp.readyState==4)
{ //alert('bb');
alert(xmlhttp.responseText.getElementsById("center"))

var result = xmlhttp.responseText.getElementsById("center");

//document.getElementById("Model").innerHTML=xmlhttp.responseText;
} */
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}   
