
var cur_gal_image = 0;
function show_next_gal_image()
{
	if(gal_images.length==0)
		return;
	var img = document.getElementById('gal_image');
	img.src = gal_images[cur_gal_image][0];
	img.alt = gal_images[cur_gal_image][1];
	document.getElementById('gal_image_label').innerHTML = gal_images[cur_gal_image][1];
	cur_gal_image++;
	if(cur_gal_image >= gal_images.length)
		cur_gal_image = 0;
}

function showme(objectid,showing)
{
  var object = document.getElementById(objectid);
  if (showing)
  {
    object.style.visibility = 'visible';
  }
  else
  {
    object.style.visibility = 'hidden';
  }
}
function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") == "external")
anchor.target = "_blank";
}
}
window.onload = externalLinks;

	var popupWindow = null;
	
	function closePopupWindow() {
	if (popupWindow && (typeof(popupWindow.closed) != 'undefined') &&
	!popupWindow.closed) popupWindow.close();
	popupWindow = null;
	}
	
	window.onunload = function() {
	closePopupWindow();
	}
	
	function openWindow(url, width, height) {
	if (!window.open) return true;
	var x = (screen.width -width) >> 1;
	var y = (screen.height-height) >> 1;
	closePopupWindow();
	popupWindow = window.open(url, 'windownaam',
	'width=' + width +
	',height=' + height +
	',left=' + x +
	',top=' + y +
	',screenX=' + x +
	',screenY=' + y +
	',scrollbars=no');
	if (!popupWindow) return true;
	popupWindow.focus();
	return false;
	}

var theHeaders = new Array() 
theHeaders[0] = '/img/headers/header-1.jpg'
theHeaders[1] = '/img/headers/header-2.jpg'
theHeaders[2] = '/img/headers/header-3.jpg'
theHeaders[3] = '/img/headers/header-4.jpg'
theHeaders[4] = '/img/headers/header-5.jpg'
theHeaders[5] = '/img/headers/header-6.jpg'
theHeaders[6] = '/img/headers/header-7.jpg'
theHeaders[7] = '/img/headers/header-8.jpg'
theHeaders[8] = '/img/headers/header-9.jpg'
theHeaders[9] = '/img/headers/header-10.jpg'
theHeaders[10] = '/img/headers/header-11.jpg'
theHeaders[11] = '/img/headers/header-12.jpg'
theHeaders[12] = '/img/headers/header-13.jpg'

var j = 0
var p = theHeaders.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theHeaders[i]
}

var whichImage = Math.round(Math.random()*(p-1));
function showHeader(){
document.write('<img src="'+theHeaders[whichImage]+'">');
}

var theImages = new Array() 
theImages[0] = '/img/gallery/volvo-1.jpg'
theImages[1] = '/img/gallery/volvo-2.jpg'
theImages[2] = '/img/gallery/volvo-3.jpg'
theImages[3] = '/img/gallery/volvo-4.jpg'
theImages[4] = '/img/gallery/volvo-5.jpg'
theImages[5] = '/img/gallery/volvo-6.jpg'
theImages[6] = '/img/gallery/volvo-7.jpg'
theImages[7] = '/img/gallery/volvo-8.jpg'
theImages[8] = '/img/gallery/volvo-9.jpg'
theImages[9] = '/img/gallery/volvo-10.jpg'

var j = 0
var q = theImages.length;
var preBuffer = new Array()
for (a = 0; i < q; a++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage2 = Math.round(Math.random()*(q-1));
function showImage(){
document.write('<img src="'+theImages[whichImage2]+'">');
}
