var lastIndex = 0;

var randomImage = function () {
	var mainImage = document.getElementById('mainImage');
	var mainImageClip = document.getElementById('mainImageClip');
	var imgDir = 'img/';
	var imgArray = new Array('droiko.jpg','gplus.jpg','mozc.jpg','octocat.jpg','sadchrome.jpg','python.jpg','git.jpg','gopher.jpg','html5.jpg');
	var imgIndex = 0;	
	if(imgArray.length > 1) {
		while(imgIndex == lastIndex) {
			imgIndex = Math.floor(Math.random() * imgArray.length);
		}
		lastIndex = imgIndex;	
		var imgPath = imgDir + imgArray[imgIndex];
		mainImage.src = imgPath;
		mainImage.alt = imgArray[imgIndex];
        mainImageClip.style.backgroundImage = "url(" + imgPath + ")";
	}
	else {
		return false;
	}
};

var hideImage = function () {
//	document.getElementById("mainImage").style.visiblity = "hidden";
};


window.onload = function(){
	randomImage();
//	hideImage();
}

@@ -45,17 +45,18 @@
 on () %7B%0A
-%09
+  
 var main
@@ -97,25 +97,26 @@
 ainImage');%0A
-%09
+  
 var mainImag
@@ -161,25 +161,26 @@
 mageClip');%0A
-%09
+  
 var imgDir =
@@ -188,17 +188,18 @@
 'img/';%0A
-%09
+  
 var imgA
@@ -331,17 +331,18 @@
 .jpg');%0A
-%09
+  
 var imgI
@@ -350,19 +350,19 @@
 dex = 0;
-%09%0A%09
+%0A  
 if(imgAr
@@ -379,18 +379,20 @@
  %3E 1) %7B%0A
-%09%09
+    
 while(im
@@ -418,11 +418,14 @@
 ) %7B%0A
-%09%09%09
+      
 imgI
@@ -480,14 +480,18 @@
 h);%0A
-%09%09%7D%0A%09%09
+    %7D%0A    
 last
@@ -511,12 +511,13 @@
 dex;
-%09%0A%09%09
+%0A    
 var 
@@ -555,18 +555,20 @@
 Index%5D;%0A
-%09%09
+    
 mainImag
@@ -584,18 +584,20 @@
 mgPath;%0A
-%09%09
+    
 mainImag
@@ -698,21 +698,25 @@
 )%22;%0A
-%09%7D%0A%09
+  %7D%0A  
 else %7B%0A
-%09%09
+    
 retu
@@ -725,17 +725,18 @@
  false;%0A
-%09
+  
 %7D%0A%7D;%0A%0Ava
@@ -765,17 +765,18 @@
  () %7B%0A//
-%09
+  
 document
@@ -865,17 +865,18 @@
 tion()%7B%0A
-%09
+  
 randomIm
@@ -888,9 +888,10 @@
 ;%0A//
-%09
+  
 hide

replace tab to 2 spaces.