var DHTML = document.getElementById || document.all || document.layers;

function newindow(newlink,size) {
var command = 'scrollbars=no,menubar=no,height=400,width=250,resizable=yes,toolbar=no,location=no,status=no, left=300, top=150';
var load = window.open(newlink,'', command);
}

function select_cell(auto, value_auto, data, value_data)
	{
	var thisauto=document.getElementById(auto);
	var thisdata=document.getElementById(data);
	var thiskm=document.getElementById('km');

	thisauto.selectedIndex = value_auto;
	thisdata.selectedIndex = value_data;
	thiskm.focus();
	}

function delete_cell(value_auto, value_data, id_auto, id_data, new_link)
	{
	var conf = confirm('Stergeti km pentru auto '+value_auto+' din data '+value_data+'?')
	if( conf==true )
		{
		new_link += '&id_auto='+id_auto+'&id_data='+id_data;
		window.location=new_link;
		}
	}

function alertselected(selectvalue, new_link)
	{
	new_link += '&id_auto='+selectvalue;
	window.location=new_link;
	}
	
var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
if(self.pageYOffset) {
rX = self.pageXOffset;
rY = self.pageYOffset;
}

else if(document.documentElement && document.documentElement.scrollTop) {
rX = document.documentElement.scrollLeft;
rY = document.documentElement.scrollTop;
}

else if(document.body) {
rX = document.body.scrollLeft;
rY = document.body.scrollTop;
}

if(document.all) {
cX += rX;
cY += rY;
}

d.style.left = (cX+10) + "px";
d.style.top = (cY+10) + "px";
}

function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}

function ShowContent(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
dd.style.display = "block";
}

function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}



