function getBrowserInfo() {
	var browser = "";
	var detect 	= navigator.userAgent.toLowerCase();
	
	if (checkIt('konqueror',detect))	browser 		= "Konqueror"
	else if (checkIt('safari',detect)) browser 			= "Safari"
	else if (checkIt('omniweb',detect)) browser 		= "OmniWeb"
	else if (checkIt('opera',detect)) browser 			= "Opera"
	else if (checkIt('webtv',detect)) browser 			= "WebTV"
	else if (checkIt('icab',detect)) browser 			= "iCab"
	else if (checkIt('msie',detect)) browser 			= "Internet Explorer"
	else if (!checkIt('compatible',detect)) browser 	= "Netscape Navigator"
	else browser = "An unknown browser";
	
	return browser;
}

function checkIt ( string, detect ) {
	var place = detect.indexOf(string) + 1;
	return place;
}
	
function onSplashLoad() {
	var ua = getBrowserInfo();
	if ( ua == 'Internet Explorer' ) {
		document.getElementById('top_b').className='top_b_ie';
		document.getElementById('bottom_b').className='bottom_b_ie';
		document.getElementById('left_b').className='left_b_ie';
		document.getElementById('right_b').className='right_b_ie';
	}
}

function initialize(){
	addWindowModal();
	lbox = document.getElementsByClassName('show_image');
	for(i = 0; i < lbox.length; i++) {
		valid = new WindowModal(lbox[i],2);
	}
}

function addWindowModal() {
	bod 				= document.getElementsByTagName('body')[0];
	overlay 			= document.createElement('div');

	overlay.id			= 'overlay';
	
	lb					= document.createElement('div');
	lb.id				= 'lightbox';
	lb.className 		= 'loading';
	
	lb.innerHTML		= '<div id="lbLoadMessage">' +
						  '<p>Loading</p>' +
						  '</div>';
	
	bod.appendChild(overlay);
	bod.appendChild(lb);
}

function setProperties ( w, h) {
	lb = document.getElementById('lightbox');
	if ( lb ) {
		//w+=20;
		lb.style.width		= w+'px';
		h+=24;
		lb.style.height		= h+'px';
	}
}
