<!--

/***********************************************
* Copyright Intechnia Limited
* Code may not be re-used without explicit
* consent from Intechnia Limited
* http://www.intechnia.co.uk
***********************************************/

function fade_tag(strTag) {
	document.getElementById(strTag).style.visibility="visible";
	opacity(strTag, 0, 100, 1005);
}

function show_tag(strTag, blnShow) {
	if (blnShow == true) {
	document.getElementById(strTag).style.visibility="visible";
	}
	else {
	document.getElementById(strTag).style.visibility="hidden";
	}
	//document.getElementById(strTag).style.zIndex="100";
}

function hide_tag(strTag) {
	changeOpac(0, strTag);
	document.getElementById(strTag).style.visibility="hidden";
}

function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 25); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
}

function setAttrib(elementID, attName, attValue) {
	var z = document.createAttribute(attName);
	z.value = attValue;
	var x = document.getElementById(elementID);
	x.setAttributeNode(z);
}
//-->

// swap style
function swap_style(sender, fromID) {
	if (fromID != null) {
	if(document.getElementById) {
		var elem = document.getElementById(fromID);
	} else if (document.all){
		var elem = document.all[fromID];
	}
	elem.className = "menu";
	}
	
	sender.className = "menu_selected";
	return false;
}