/* Javascript Document */

function Sifr() {
sIFR.replaceElement("h2", named({sFlashSrc: "images/interface/helvneue.swf", sColor: "#ffffff", sBgColor: "#1b1b1b", sWmode:"transparent"}));
}

function change(id,newtext) {
	document.getElementById(id).innerHTML=newtext;
} 

function swpimg(id,picname)	{
	document.getElementById(id).style.background="url(images/content/large/"+picname+")";
}

function elementOff(id) {
	document.getElementById(id).style.display="none";
}

function elementOn(id) {
	document.getElementById(id).style.display="block";
}

function showCaption(id) {
	document.getElementById(id).innerHTML = fnCaption;
}

// BEGIN GRADUAL HIGHLIGHT SCRIPT

var baseopacity=30

function trnsin(which2){
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",20) //sets fade-IN rate of trnsin [1] ******************
}

function trnsout(which2){
cleartimer();
setTimeout(function() {gradualfadeout(which2);}, 50);
}

function instantset(degree){
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
imgobj.filters.alpha.opacity=degree
else
imgobj.style.opacity = degree/100;
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (browserdetect!="mozilla") {
if (browserdetect!="ie") {
cur2.style.opacity=Math.min(parseFloat(cur2.style.opacity)+0.1, 0.99)
}
}
else if (window.highlighting)
clearInterval(highlighting)
}

function gradualfadeout(cur3){
cr3=setTimeout(function() {gradualfadeout(cur3);}, 5) //sets fade-OUT rate of fadeout [1] ******************
if (browserdetect=="mozilla" && cur3.style.MozOpacity>0.3)				/* same as baseopacity [1] */
cur3.style.MozOpacity=Math.min(parseFloat(cur3.style.MozOpacity)-0.1)
else if (browserdetect=="ie" && cur3.filters.alpha.opacity>30)			/* same as baseopacity [1] */
cur3.filters.alpha.opacity=cur3.filters.alpha.opacity-10
else if (cur3.style.opacity>0.3)										/* same as baseopacity [1] */
cur3.style.opacity=Math.min(parseFloat(cur3.style.opacity)-0.1)
if (browserdetect=="mozilla" && cur3.style.MozOpacity<=0.3)				/* same as baseopacity [1] */
clearTimeout(cr3);
else if (browserdetect=="ie" && cur3.filters.alpha.opacity<=30)			/* same as baseopacity [1] */
clearTimeout(cr3);
else if (cur3.style.opacity<=0.3)										/* same as baseopacity [1] */
clearTimeout(cr3);
}

// BEGIN TYPE 2 FADES:

var baseopacity2=0

function trnsin2(which3){
imgobj=which3
browserdetect=which3.filters? "ie" : typeof which3.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity2)
highlighting=setInterval("gradualfade(imgobj)",55) //sets fade-IN rate of fadeout [2] ******************
}

function trnsout2(which3){
cleartimer();
setTimeout(function() {gradualfadeout2(which3);}, 50);
}

function gradualfadeout2(cur3){
cr3=setTimeout(function() {gradualfadeout2(cur3);}, 30) //sets fade-OUT rate of fadeout [2] ******************
if (browserdetect=="mozilla" && cur3.style.MozOpacity>0)				/* same as baseopacity [2] */
cur3.style.MozOpacity=Math.min(parseFloat(cur3.style.MozOpacity)-0.1)
else if (browserdetect=="ie" && cur3.filters.alpha.opacity>0)			/* same as baseopacity [2] */
cur3.filters.alpha.opacity=cur3.filters.alpha.opacity-10
else if (cur3.style.opacity>0)										/* same as baseopacity [2] */
cur3.style.opacity=Math.min(parseFloat(cur3.style.opacity)-0.1)
if (browserdetect=="mozilla" && cur3.style.MozOpacity<=0)				/* same as baseopacity [2] */
clearTimeout(cr3);
else if (browserdetect=="ie" && cur3.filters.alpha.opacity<=0)			/* same as baseopacity [2] */
clearTimeout(cr3);
else if (cur3.style.opacity<=0)										/* same as baseopacity [2] */
clearTimeout(cr3);
}

// BEGIN TYPE 3 FADES:

var baseopacity3=40

function trnsin3(which4){
imgobj=which4
browserdetect=which4.filters? "ie" : typeof which4.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity3)
highlighting=setInterval("gradualfade(imgobj)",10) //sets fade-IN rate of fadeout [3] ******************
}

function trnsout3(which4){
cleartimer();
setTimeout(function() {gradualfadeout3(which4);}, 50);
}

function gradualfadeout3(cur3){
cr3=setTimeout(function() {gradualfadeout3(cur3);}, 5) //sets fade-OUT rate of fadeout [3] ******************
if (browserdetect=="mozilla" && cur3.style.MozOpacity>0.4)				/* same as baseopacity [3] */
cur3.style.MozOpacity=Math.min(parseFloat(cur3.style.MozOpacity)-0.1)
else if (browserdetect=="ie" && cur3.filters.alpha.opacity>40)			/* same as baseopacity [3] */
cur3.filters.alpha.opacity=cur3.filters.alpha.opacity-10
else if (cur3.style.opacity>0.4)										/* same as baseopacity [3] */
cur3.style.opacity=Math.min(parseFloat(cur3.style.opacity)-0.1)
if (browserdetect=="mozilla" && cur3.style.MozOpacity<=0.4)				/* same as baseopacity [3] */
clearTimeout(cr3);
else if (browserdetect=="ie" && cur3.filters.alpha.opacity<=40)			/* same as baseopacity [3] */
clearTimeout(cr3);
else if (cur3.style.opacity<=0.4)										/* same as baseopacity [3] */
clearTimeout(cr3);
}

// Begin Auxiliary scripts

function noSpam(me) {
	me = me.replace('[at]','@');
	me = me.replace('[dot]','.');
	self.location.href = me;
	return false;
	}

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;