var x 		= new Number();
var y 		= new Number();
var z 		= new Number();
var imgs 	= new Array();

function matrixPush(image, link){
	imgs[imgs.length] = new Array(image,link);	
}

function randomNum(){
	n = Math.floor(Math.random() * imgs.length);
	return n;
}

function init1(){
	x = randomNum();
	document.img1.src = "../../img/" + imgs[x][0];
}

function init2(){
	y = randomNum();	
	while(x == y){
		y = randomNum();
	}	
	document.img2.src = "../../img/" + imgs[y][0];
}

function init3(){
	z = randomNum();	
	while(x == z || y == z){
		z = randomNum();
	}	
	document.img3.src = "../../img/" + imgs[z][0];
}

function getURL1(){
	if(imgs[x][1] != ""){
		window.open(imgs[x][1]);
	}
}

function getURL2(){
	if(imgs[y][1] != ""){
		window.open(imgs[y][1]);
	}
}

function getURL3(){
	if(imgs[z][1] != ""){
		window.open(imgs[z][1]);
	}
}

