var ic = 15;
screen_shots = new Array(ic);
var array_length = screen_shots.length;
screen_images = new Array(array_length);
screen_shot_urls = new Array(array_length);

for (c = 1; c <= ic; c++){
	screen_shots[c-1] = "corner_" + c + ".jpg";
}

screen_counter = 0;

/* set the opacity of the element (between 0.0 and 1.0) */
function setOpacity(level) {
	document.corner.style.opacity = level;
	document.corner.style.MozOpacity = level;
	document.corner.style.KhtmlOpacity = level;
	document.corner.style.filter = "alpha(opacity=" + (level * 100) + ");";
}

var duration = 2000;  /* 1000 millisecond fade = 1 sec */
var steps = 40;       /* number of opacity intervals   */
var delay = 5000;     /* 5 sec delay before fading out */

function fadeIn(){
	for (i = 0; i <= 1; i += (1 / steps)) {
		setTimeout("setOpacity(" + i + ")", i * duration);
	}
//	setTimeout("fadeOut()", delay);
}

function fadeOut() {
	for (i = 0; i <= 1; i += (1 / steps)) {
		setTimeout("setOpacity(" + (1 - i) + ")", i * duration);
	}
}

var been_through = 0;
var screen_counter = 0;
function animate_screenshots(){
	

    if (document.images){
 		document.corner.src = "Images/Corner/" + screen_shots[screen_counter];
 		setOpacity(1);

 		screen_counter++;
   		if (screen_counter == screen_shots.length){
    	    screen_counter = 0;
    	    been_through = 1;
    	}		
    	var newimage = "Images/Corner/" + screen_shots[screen_counter];
		var ui = "url(" + newimage + ")";	
		document.getElementById("CornerSwap").style.backgroundImage=ui;
  		timerONE=window.setTimeout('fadeOut()', 3000);	    	
  	    timerTWO=window.setTimeout('animate_screenshots()',5000);

    }
}

function popIt(pop_url, pop_winname) {

    openWin = window.open(pop_url,pop_winname,"top=60,left=100,width=450,height=450,buttons=no,scrollbars=yes,location=no, menubar=no,resizable=yes,status=no,directories=no,toolbar=no");
 
    openWin.focus();
	return(false);
}

function pop(art, width, height, scrollbars) {
    openWin = window.open(art,"popWindow","toolbar=no,scrollbars=" + scrollbars + ",width=" + width + ",height=" + height + ",resizable=yes,buttons=no,location=no,menubar=no,status=no,directories=no");
    openWin.focus();
	
}
