/* picture gallery (index) (c) copyright 2005 Bernhard Barkow, creativeeyes.at */
function BB_swapLink(s) {
	var o=document.getElementById("link"+s); if(o!=null) {
		if(!RegExp(/\bover\b/).test(o.className)) o.className+=" over"; 
		else o.className=o.className.replace(/[\s]?over\b/,"");	}
}

function fadeBG() {
	var d=document; d.tmpCol=0.04;
	d.oldCol=new Array();sToRGB(getObjBGCol(d.body),d.oldCol);
	d.newCol=new Array();sToRGB(getObjBGCol(d.getElementById('bodyTargetBG')),d.newCol);
	d.bgfi=setInterval("chBG()",50);
}

function getObjBGCol(o) {
	var d=document,s=''; if (o!=null) {
		if (o.currentStyle) s = o.currentStyle["backgroundColor"];
		else if (d.defaultView.getComputedStyle != null) s = d.defaultView.getComputedStyle(o,null).getPropertyValue("background-color");
	} return s;
}

function sToRGB() {
	var i,j=0,a=sToRGB.arguments,v;
	if (a[0].indexOf('rgb')>=0) {
		v = a[0].split(','); for (i=0;i<3;i++) { a[1][i] = parseInt(v[i].replace(/\D*/,"")); }
	} else if (a[0].indexOf('#')>=0) {
		for (i=1;i<7;i+=2) { a[1][j++]=parseInt(a[0].substring(i,i+2), 16) }
	}
}

function chBG() {
	var d=document,i,s="rgb("; d.tmpCol*=1.2;
	if(d.tmpCol>=1.) { d.tmpCol=1.; clearInterval(d.bgfi); BB_setVis(getElem('pics'),true); }
	for (i=0;i<3;i++) { s+= Math.round(d.oldCol[i]+(d.newCol[i]-d.oldCol[i])*d.tmpCol) + (i<2 ? "," : ")"); }
	d.body.style.backgroundColor=s;
}

