// JavaScript Document
function classChange(styleChange,item) {
	item.className = styleChange;
}


function Display_Active_Link(color)
	{
	var link_found = false;
	
	if (document.all)
		all_links = document.all.tags("A");
	else
		all_links = document.getElementsByTagName("a");

	for(i=0; i<all_links.length; i++) 
		{
		//change color
		if(parent.location.href.replace(/\?.*|#.*/, "") == all_links[i].href)	//remove variables and anchors from parent first
			{
			all_links[i].style.color = color;
			link_found = true;
			}
		}

	if(link_found == false)	//if no link was found then we are at the homepage
		all_links[0].style.color = color;
	}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


function VDM_getRefToDiv(divID,oDoc) {
    if( !oDoc ) { oDoc = document; }
    if( document.layers ) {
        if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
            //repeatedly run through all child layers
            for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
                //on success, return that layer, else return nothing
                y = getRefToDiv(divID,oDoc.layers[x].document); }
            return y; } }
    if( document.getElementById ) {
        return document.getElementById(divID); }
    if( document.all ) {
        return document.all[divID]; }
    return false;
}


function VDM_Toggle_Iframe(mode)
	{
	//only for IE 6 and lower
    var ua = navigator.userAgent;
    var MSIEOffset = ua.indexOf("MSIE ");
    if (MSIEOffset != -1)
    	{
        version = parseFloat(ua.substring(MSIEOffset + 5, ua.indexOf(";", MSIEOffset)));
		if(version < 7)
			{
			if(mode == 'hide' && VDM_getRefToDiv('select_iframe'))
				VDM_getRefToDiv('select_iframe').style.visibility = 'hidden';
			else if(mode == 'show' && VDM_getRefToDiv('select_iframe'))
				VDM_getRefToDiv('select_iframe').style.visibility = 'visible';
			}
		}
	}