
/* font-size for Mac FF,NN
----------------------------------------*/
var font = 75;

function fontSizeFix(){
	if (((navigator.userAgent.indexOf("Firefox/") >= 0) && (navigator.userAgent.indexOf("Mac") >= 0)) ||
    ((navigator.userAgent.indexOf("Netscape/7") >= 0) && (navigator.userAgent.indexOf("Mac") >= 0))){
	var newFontSize = Math.round(font * 1.2);
	document.getElementsByTagName("body")[0].style.fontSize = newFontSize + "%";
	}
}

/* rollover
----------------------------------------*/

function onMouse() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'ro') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_on'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_on'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

/* blank win
----------------------------------------*/
function newwin() {
var a = document.getElementsByTagName("a");
	for (var i = 0; i < a.length; i++) { 
		if ((/\bblank\b/.exec(a[i].className)) ||
		(a[i].getAttributeNode("href").value.lastIndexOf(".pdf") !== -1)){
			a[i].onclick = function() {
				var newurl = this.getAttributeNode("href").value;
				this.setAttribute("href","javascript:;");	
				window.open(newurl, "", "toolbar=yes, location=yes, directories=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes, close=yes");
				this.getAttributeNode("href").value = newurl;
				return false;
			}
		}
		else if(/\bpopup\b/.exec(a[i].className)){
			a[i].onclick = function() {
				var newurl = this.getAttributeNode("href").value;
				this.setAttribute("href","javascript:;");	
				window.open(newurl, "", "width=548,toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, close=yes");
				this.getAttributeNode("href").value = newurl;
				return false;
			}
		}
			else if(/\bconcept\b/.exec(a[i].className)){
			a[i].onclick = function() {
				var newurl = this.getAttributeNode("href").value;
				this.setAttribute("href","javascript:;");	
				window.open(newurl, "", "width=581,height=545,toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, close=yes");
				this.getAttributeNode("href").value = newurl;
				return false;
			}
		}
	}
}

/*createOuter for win ie
----------------------------------------*/
function createOuer() {
	
if (navigator.userAgent.indexOf('Win') >= 0) {
	if((navigator.userAgent.indexOf("MSIE 6") >= 0) || navigator.userAgent.indexOf("MSIE 5")>= 0){
		var original = document.getElementsByTagName('div')[0];
    var outer = document.createElement('div');
    outer.id = 'outer';
				outer.style.height = document.body.clientHeight;
    original.parentNode.replaceChild(outer, original);
    outer.appendChild(original);	
				onresize = function(){outer.style.height = document.body.clientHeight;}
		}
	}
}



function library(){
fontSizeFix();
onMouse();
newwin();
createOuer();
}

window.onload = library;