function pokaz(id) {
	document.getElementById(id).style.display = "block";
}

function ukryj(id) {
	document.getElementById(id).style.display = "none";
}

function openWin(URL,width,height,scroll,resize, status, menubar, toolbar, location, directories) {
	noUrl = false	
	if (URL == "" || URL == null) { URL="about:blank"; noUrl=true }
	if (width == "" || width == null ) { width = 640 }
	if (height == "" || height == null ) { height = 480 }
	if ((scroll == "" || scroll == null) && scroll != 0) { scroll = 1 }
	if ((resize == "" || resize == null) && resize != 0) { resize = 1 }
	if ( (status == "" || status == null)  && status != 0) { status = 1 }
	if (menubar == "" || menubar == null) {menubar=0}
	if (toolbar == "" || toolbar == null) {toolbar=0}
	if (location == "" || location == null) {location=0}
	if (directories == "" || directories == null) {directories=0}
	
	PARMS = 'left=10,top=10,toolbar='+toolbar +',location='+location +',directories='+directories +',status='+status +',menubar='+menubar +',scrollbars=' + scroll + ',resizable=' + resize + ',width=' + width + ',height=' + height
  var newWin = window.open(URL,"NEW",PARMS)
  newWin.focus();  
  
	if (noUrl) {
		newWin.document.writeln("<BR><BR><FONT color='red'>It seems like you forgot to put in a value for URL when you called for <I>openWin()</I></FONT>")
		newWin.document.close()
	}
	return;
}
function openFullScreenWin(u) {
	var w = screen.availWidth * (99/100);
	var h = screen.availHeight * (99/100);
	var parms = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+w+',height='+h+',top=0,left=0';
	var windowname = 'fullscreenpop';
	
	window.open(u,windowname,parms);
}

function submitForm() {
  if(typeof document.forms[0].elements['hirsch'] == 'undefined') {
	if((document.forms[0].elements['grupa'].value == 0) && (document.forms[0].elements['model'].value == 0)) return;
  }
  else {
	if(document.forms[0].elements['model'].value == 0) return;
  }
  document.forms[0].submit();
}

function changeModelYears(modelId) {
  document.forms[0].elements['rok'].options.length = 0;
  document.forms[0].elements['rok'].options[0] = new Option('< ' + 'Wybierz model roku' + ' >', '0');
  if(modelId!=0){  
	var lata = modelYears[modelId];
	document.forms[0].elements['rok'].options.length = lata.length;
	for(var i = 1; i < lata.length; i++) document.forms[0].elements['rok'].options[i] = new Option(lata[i-1],lata[i-1]);
		
	document.forms[0].elements['rok'].disabled = false;
  }
  else document.forms[0].elements['rok'].disabled = true;

}
var Accessories = {
	active: null,
	
	change: function(index) {
		if(typeof(Accessories.active)=='number') document.getElementById('accessoryLink'+Accessories.active).className = document.getElementById('accessoryLink'+Accessories.active).className.substring(0,document.getElementById('accessoryLink'+Accessories.active).className.length-7);
		document.getElementById('accessoryLink'+index).className += " active";
		Accessories.showInfo(index);
		Accessories.active = index;
	},
	
	showInfo: function(index) {
		document.getElementById('accessoriesDetails').innerHTML = document.getElementById('accessory'+index).innerHTML;
	}
	
};

