var langSuffix = '';

function getUrlVars() {
    var vars = {};
    var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
        vars[key] = value;
    });
    return vars;
}

var theImages = new Array()

theImages.push('cub0079.jpg')
theImages.push('cub0115.jpg')
theImages.push('mex237.jpg')
theImages.push('mex240.jpg')
theImages.push('mex243.jpg')
theImages.push('nyc41.jpg')
theImages.push('USA_Tr_0119.jpg')
theImages.push('USA_Tr_0149.jpg')
theImages.push('USA_Tr_0149.jpg')
theImages.push('USA_Tr_0167.jpg')
theImages.push('USA_Tr_0169.jpg')
theImages.push('USA_Tr_0226.jpg')
theImages.push('Frankfurt0017.jpg')
theImages.push('Frankfurt0017.jpg')
theImages.push('Koeln0152.jpg')
theImages.push('cub0315.jpg')
theImages.push('Ind0912.jpg')
theImages.push('Ind0286.jpg')
theImages.push('nyc68.jpg')

/* prefetch random images
var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = "images/1080/" +  theImages[i]
}
*/

function showContentFrame () {
		document.getElementById("contentFrame").style.display = "block"
};

function hideContentFrame () {
		document.getElementById("contentFrame").style.display = "none"		
};

function showNavigationFrame () {
		document.getElementById("navigationFrame").style.display = "block"
};

function hideNavigationFrame () {
		document.getElementById("navigationFrame").style.display = "none"
};

function setRandomImage () {
	var whichImage = Math.round(Math.random()*(theImages.length-1));
	hideContentFrame()
	document.getElementById("content").style.backgroundImage = "url(images/1080/" + theImages[whichImage] + ")"
};

function showHTMLinIFrame (frameID, filename) {
	document.getElementById(frameID).src = filename
	showContentFrame()
};

function showHTMLinContentFrame (filename) {
	showHTMLinIFrame("contentFrame", filename)
	showContentFrame()
};

function showHTMLinNavigationFrame (filename) {
	showHTMLinIFrame("navigationFrame", filename)
	showNavigationFrame()
};

function showClients () {
	hideNavigationFrame()
	showHTMLinContentFrame('clients' + langSuffix + '.html')
};

function showContact () {
	hideNavigationFrame()
	showHTMLinContentFrame('newContact' + langSuffix + '.html')	
};

function showPortfolio () {
	showNavigationFrame()
	setRandomImage()
};

function runVideoSlideshow(album) {
	showHTMLinContentFrame('showVideo.html?album=' + album)
	
	if (SlideShowPro.prototype.isMobile()) {
		window.open('showVideo.html?album=' + album,'_blank')
	}
	else
	{
		showHTMLinContentFrame('showVideo.html?album=' + album)	
	}		
};

function runPhotoSlideshow(album) {
	if (SlideShowPro.prototype.isMobile()) {
		window.open('showPhotos.html?album=' + album,'_blank')	
	}
	else
	{
		showHTMLinContentFrame('showPhotos.html?album=' + album)		
	}		
};




