// BROWSER DETECT
var info = navigator.userAgent.toLowerCase();
var browserPlatform = "";
var browserType = "";
var browserVersion = "";

function checkIt(string) {
	place = info.indexOf(string) + 1;
	thestring = string;
	return place;
}

if (navigator.userAgent.indexOf("Mac_PowerPC")!=-1 || navigator.userAgent.indexOf("Macintosh") != -1) { browserPlatform = "Mac"; } else { browserPlatform = "Windows"; }


if (checkIt('konqueror')) { browserType = "Konqueror"; browserPlatform = "Linux";
} else if (checkIt('safari')) { browserType = "Safari";
} else if (checkIt('omniweb')) { browserType = "OmniWeb";
} else if (checkIt('opera')) { browserType = "Opera";
} else if (checkIt('webtv')) { browserType = "WebTV";
} else if (checkIt('icab')) { browserType = "iCab";
} else if (checkIt('firefox')) { browserType = "Firefox";
} else if (checkIt('msie')) { browserType = "ie";
} else if (checkIt('netscape')) { browserType = "Netscape Navigator";
} else { browserType = "An unknown browser"; browserVersion = "";
}

browserVersion = info.charAt(place + thestring.length);
for (i = 1; i <= 10; i++) {
	tempChar = info.charAt(place + thestring.length + i);
	if ((tempChar != "0")&&(tempChar != "1")&&(tempChar != "2")&&(tempChar != "3")&&(tempChar != "4")&&(tempChar != "5")&&(tempChar != "6")&&(tempChar != "7")&&(tempChar != "8")&&(tempChar != "9")&&(tempChar != ".")) { break; }
	browserVersion += tempChar;
}
// end of BROWSER DETECT


// SET BLACK BORDER FOR ACTIVE THUMNAIL
function setThumb (id) {
	if (activeThumb != 0) { document.getElementById(activeThumb).style.borderColor = "#DDDDDD"; }
	document.getElementById(id).style.borderColor = "#333333";
	activeThumb = id;
}

// SET THUMBNAILS DIV HEIGHT
window.onload=function(){ setScrollerHeight(); }
window.onresize=function(){ setScrollerHeight(); }
window.onscroll=function(){ setScrollerHeight(); }

function setScrollerHeight () {
	if (browserType == "ie") { // ie code
		stageHeight = document.documentElement.clientHeight;
	} else { // non-ie code
		stageHeight = window.innerHeight;
	}
	document.getElementById('thumbs').style.height = stageHeight - 54 + "px"; // ie,ns,ff,op
}
// end of SET THUMBNAILS DIV HEIGHT