var DHTML = (document.getElementById || document.all || document.layers);

function getObj(name) {
	if (document.getElementById) {
		this.obj = document.getElementById(name);
		this.style = document.getElementById(name).style;
	}
	else if (document.all) {
		this.obj = document.all[name];
		this.style = document.all[name].style;
	}
	else if (document.layers) {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
	}
}

// Hide element
function showhide(the_element,dummy,flag) {
	if (!DHTML) return;
	var x = new getObj(the_element);
	x.style.visibility = (flag) ? 'hidden' : 'visible'
}

// Move element
var texttop = 400;
function move(the_element,amount) {
	if (!DHTML) return;
	var x = new getObj(the_element);
	texttop += amount;
	x.style.top = texttop;
}

// Change foreground color of element
function changeCol(the_element,col) {
	if (!DHTML) return;
	var x = new getObj(the_element);
	x.style.color = col;
}

// Change background color of element
function changeBgCol(the_element,col) {
	if (!DHTML) return;
	var x = new getObj(the_element);
	x.style.backgroundColor = col;
}

// Change font style of element
function changeStyle(the_element,style) {
	if (!DHTML) return;
	var x = new getObj(the_element);
	x.style.fontStyle = style;
}

// Change font family of element
function changeFamily(the_element,family) {
	if (!DHTML) return;
	var x = new getObj(the_element);
	x.style.fontFamily = family;
}

function showhideDiv( the_div, the_change ) {
	var the_style = getStyleObject( the_div );
	if( the_style != false ) {
		the_style.display = the_change;
	}
}

function getStyleObject( objectId ) {
	if ( document.getElementById && document.getElementById( objectId ) ) {
		return document.getElementById( objectId ).style;
	} else if( document.all && document.all( objectId ) ) {
		return document.all( objectId ).style;
	} else {
		return false;
	}
}

function changeBgPG1(col) {
	changeBgCol('linkPG1',col);
	changeBgCol('morePG1',col);
}

function changeBgPG2(col) {
	changeBgCol('linkPG2',col);
	changeBgCol('morePG2',col);
}

function changeBgPG3(col) {
	changeBgCol('linkPG3',col);
	changeBgCol('morePG3',col);
}

function changeBgPG4(col) {
	changeBgCol('linkPG4',col);
	changeBgCol('morePG4',col);
}

function changeBgPG5(col) {
	changeBgCol('linkPG5',col);
	changeBgCol('morePG5',col);
}

function changeBgPG6(col) {
	changeBgCol('linkPG6',col);
	changeBgCol('morePG6',col);
}

function hoverimage() {
	if (navigator.userAgent.match(/Opera (\S+)/)) {
		var operaVersion = parseInt(navigator.userAgent.match(/Opera (\S+)/)[1]);
	}
	if (!document.getElementById||operaVersion <7) return;
	var imgarr=document.getElementsByTagName('img');
	var imgPreload=new Array();
	var imgSrc=new Array();
	var imgClass=new Array();
	for (i=0;i<imgarr.length;i++){
		if (imgarr[i].className.indexOf('domroll')!=-1){
			imgSrc[i]=imgarr[i].getAttribute('src');
			imgClass[i]=imgarr[i].className;
			imgPreload[i]=new Image();
			if (imgClass[i].match(/domroll (\S+)/)) {
				imgPreload[i].src = imgClass[i].match(/domroll (\S+)/)[1]
			}
			imgarr[i].setAttribute('xsrc', imgSrc[i]);
			imgarr[i].onmouseover=function(){
				this.setAttribute('src',this.className.match(/domroll (\S+)/)[1])
			}
			imgarr[i].onmouseout=function(){
				this.setAttribute('src',this.getAttribute('xsrc'))
			}
		}
	}
}

hoverimage();

