// JavaScript Document

var browse = window.navigator.appName.toLowerCase();
var MyMar;
var speed = 1; 
var spec = 1; 
var minOpa = 100; 
var maxOpa = 100; 
var spa = 38; 
var w = 0;
spec = (browse.indexOf("microsoft") > -1) ? spec : ((browse.indexOf("opera") > -1) ? spec*10 : spec*2);
function getid(e) {return document.getElementById(e);}
function goleft() {getid('photos').scrollLeft -= spec;}
function goright() {getid('photos').scrollLeft += spec;}
function setOpacity(e, n) {
    if (browse.indexOf("microsoft") > -1) e.style.filter = 'alpha(opacity=' + n + ')';
    else e.style.opacity = n/100;
}
getid('goleft').style.cursor = 'pointer';
getid('goright').style.cursor = 'pointer';
getid('goleft').onmouseover = function() { MyMar=setInterval(goleft, speed);}
getid('goleft').onmouseout = function() { clearInterval(MyMar);}
getid('goright').onmouseover = function() { MyMar=setInterval(goright,speed);}
getid('goright').onmouseout = function() { clearInterval(MyMar);}



window.onload = function() {
    var rHtml = '';
    var p = getid('showArea').getElementsByTagName('img');
    for (var i=0; i<p.length; i++) {
        w += parseInt(p[i].getAttribute('width')) + spa;
        //w += parseInt(180) + spa;
        setOpacity(p[i], minOpa);
        rHtml += '<img src="' + p[i].getAttribute('rel') + '" width="0" height="0" alt="" />';
    }
    getid('showArea').style.width = parseInt(w) + 'px';
    var rLoad = document.createElement("div");
    getid('photos').appendChild(rLoad);
    rLoad.style.width = "1px";
    rLoad.style.height = "1px";
    rLoad.style.overflow = "hidden";
    rLoad.innerHTML = rHtml;
	
}

