//rotator code adapted/taken from: http://www.dyn-web.com/code/rotate_images/random_img_js.php
//IO code adapted/taken from: http://codingforums.com/showthread.php?t=143412&highlight=file
//darkreaver, 4-17-10



function Artist(image,name,link)
{
	this.image=image;
	this.name=name;
	this.link=link;
}


function IO(U, V) 
{//LA MOD String Version. A tiny ajax library.  by, DanDavis
    	var X = !window.XMLHttpRequest ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest();
    	X.open(V ? 'PUT' : 'GET', U, false );
    	X.setRequestHeader('Content-Type', 'text/html')
    	X.send(V ? V : '');
	return X.responseText;
}	


function getRandomImage(path) {

var lines=IO(path + "artist_list.ini").split("\r");



var num = Math.floor( Math.random() * (lines.length+1)/4 );


rotator = new Artist(lines[num*4], lines[num*4+1], lines[num*4+2]);

var imgStr = '';  
var capStr = ''; 

imgStr += '<img src="' + path + rotator.image + '"';
imgStr += 'style="position: absolute; margin-left: -20px; top: 0px; z-index:-2;"';
imgStr += ' alt="' + rotator.name + '" border="0" >';


capStr += '<a href="' + rotator.link;
capStr += '" style="position: relative; float: right; right: 15px; top: 65px; z-index:1; color:#FFFFFF; font-weight: bold">ART BY: ';
capStr += rotator.name;
capStr += '</a>';



document.write(imgStr); 
document.write(capStr); 
document.close();

}

