function active(s){
	if(s != null) s.className = 'active';
	if(document.all["car"]) document.all["car"].setVariable('bpart',s);	
	
}

function passive(s){
	if(s != null) s.className = 'passive';	
	if(document.all["car"]) document.all["car"].setVariable('bpart',0);
//	if (document.all["pa"+p] != null) document.all["pa"+p].className = 'active';		
}

function active_office(s){
	if(s != null) s.className = 'active_office';
}

function passive_office(s){
	if(s != null) s.className = 'passive_office';	
//	if (document.all["pa"+p] != null) document.all["pa"+p].className = 'active';		
}

function go(s){
	document.all["conteyner"].src = 'moduls/descriptionOffice.php?o='+s+'&v='+Math.random(10);
//	alert('../moduls/descriptionOffice.php?='+s);
}

function menu(code) {
	var obj1 = document.getElementById("id_" + code);
	var obj2 = document.getElementById("menu_" + code);	

	for (var i=1;i<countMenu;i++){ if(document.all["id_"+i] && code != i) document.all["id_"+i].style.display = "none";}

	if(obj1.style.display == "" || obj1.style.display == "block") {
		obj1.style.display = "none";
		obj2.className = 'passive1';
	} else {
		obj1.style.display = "block";
		obj2.className = 'active1';
	}
}

function buy(id,i){
	if(document.all['input'+i].value>0){
		form1.id1.value = id;
		form1.count.value = document.all['input'+i].value;
		form1.submit();	
	}else{
		alert("Ââåäèòå êîëëè÷åñòâî òîâàðà");
	}
}

function search(){
	document.forms.search.submit();
}

function setA(id,img){
	document.all[id].src = img;
}

function openWindow(url,iw,ih){
	N=window.navigator.appName.substring(0,8);

	if(N=="Microsof"){w=document.body.clientWidth;h=document.body.clientHeight;}
	if(N=="Netscape"){w=window.innerWidth;h=window.innerHeight;}

	var iLeft = Math.round((w - iw)/2);
	var iTop  = Math.round((h - ih)/2);

	var sOptions = "toolbar:no;status:no;resizable:no;dependent:yes;help:no;scroll:no";
	sOptions += ";dialogWidth:" + iw + "px";
	sOptions += ";dialogHeight:" + ih + "px";
	sOptions += ";dialogLeft:" + iLeft + "px";
	sOptions += ";dialogTop:" + iTop + "px";		      

	popupWin = window.showModelessDialog(url,'1',sOptions);

	popupWin.focus(); 
	return popupWin;
}