function openWin(url,w,h,pos,attr,name)
{
	var a_attr = new Array ('scrollbars','menubar','toolbar','location','status','titlebar','hotkeys');
	if( !attr ) attr = '10000100';
	if( !w ) w = 600;
	if( !h ) h = 400;
	var params = 'width='+w+',height='+h;
	for( var i=0; i<a_attr.length; i++ ) params += ','+a_attr[i]+'='+attr.charAt(i);
	if( (parseInt(navigator.appVersion) >= 4 ) && pos=='center' ) { x = (screen.width - w) / 2; y = (screen.height - h) / 2; }
	else if ( pos=='default' ) x=y=false;
	else if ( pos ) { var a_pos = pos.split(','); x = a_pos[0]; y = a_pos[1]; }
	if( x<0 ) x=0;
	if( y<0 ) y=0;
	if( x && y ) params += ',xposition='+x+',left='+x+',yposition='+y+',top='+y;
	if( !name ) name = "newWin";
	var newWin = window.open( url, name, params );
}

function View(a) { openWin('view.php?id='+a,650,625,'center'); }
function Viewdel(a) { openWin('viewdel.php?id='+a,600,390,'center'); }
function Order(a) { openWin('order.php?car='+a,390,410,'center'); }
function Gb() { openWin('http://www.conceptsakh.ru/gb/guestbook.php',700,500,'center'); }
function Calc() { openWin('http://www.conceptsakh.ru/calc.htm',800,600,'center'); }

function Change() {

//document.getElementById('color').style.visibility = "hidden";

if (document.forms["editcar"].elements["type"].value=="path") {
	document.getElementById('txt').innerHTML="Дата поставки";
	document.getElementById('num').style.visibility = "hidden";
	document.getElementById('km').style.visibility = "hidden";
	document.getElementById('price').style.visibility = "hidden";
	return;
}

if (document.forms["editcar"].elements["type"].value=="exist") {
	document.getElementById('txt').innerHTML="№ двигателя";
	document.getElementById('num').style.visibility = "visible";
	document.getElementById('km').style.visibility = "visible";
	document.getElementById('price').style.visibility = "visible";
	showLayer();
	return;
}

document.getElementById('txt').innerHTML="Доп. данные";

}

function showLayer() {
hideAll();
document.getElementById('color').style.visibility = "visible";
}

function hideAll() {
document.getElementById('color').style.visibility = "hidden";
}
