window.onload = hideLine;
					
function hideLine() {
	opacity('horzDiv', 100, 0, 2000,' ');
}


function opacityNew(id, opacStart, opacEnd, millisec, newMainSrc) { 

    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    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("changeOpacNew(" + i + ",'" + id + "','" + newMainSrc + "')",(timer * speed)); 
	    timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
	    setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 

} 

function opacity(id, opacStart, opacEnd, millisec) { 

    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    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 changeOpacNew(opacity, id, newMainSrc) { 
	if (id != null && document.getElementById(id) != null) {
	    var object = document.getElementById(id).style; 
	    object.opacity = (opacity / 100); 
	    object.MozOpacity = (opacity / 100); 
	    object.KhtmlOpacity = (opacity / 100); 
	    object.filter = "alpha(opacity=" + opacity + ")"; 
	    
            if (opacity == 50) { 
		
		document.getElementById('main').src = newMainSrc;
		
		opacityNew('main', 50, 100, 2000, ' ');
	    }
	}	
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 

	if (id != null && document.getElementById(id) != null) {
	    var object = document.getElementById(id).style; 
	    object.opacity = (opacity / 100); 
	    object.MozOpacity = (opacity / 100); 
	    object.KhtmlOpacity = (opacity / 100); 
	    object.filter = "alpha(opacity=" + opacity + ")"; 
	}	
} 


function swapImages(imageId) {
	
	var oldMainSrc = document.getElementById('main').src;
	var oldMainThumb = document.getElementById('main_thumb').value;
	var oldThumbSrc = document.getElementById(imageId + '_thumb').src;
	var newMainSrc = document.getElementById(imageId).value;
	var newMainThumb = oldThumbSrc;
	
	opacityNew('main', 100, 50, 2000, newMainSrc);
	

	document.getElementById(imageId + '_thumb').src = oldMainThumb;
	document.getElementById('main_thumb').value = newMainThumb;
	document.getElementById(imageId).value = oldMainSrc;
	
}


function getSelectedRadioValue(buttonGroup) {
   // returns the value of the selected radio button or "" if no button is selected
   var i = getSelectedRadio(buttonGroup);
   if (i == -1) {
      return "";
   } else {
      if (buttonGroup[i]) { // Make sure the button group is an array (not just one button)
         return buttonGroup[i].value;
      } else { // The button group is just the one button, and it is checked
         return buttonGroup.value;
      }
   }
} // Ends the "getSelectedRadioValue" function

function getSelectedRadio(buttonGroup) {
   // returns the array number of the selected radio button or -1 if no button is selected
   if (buttonGroup[0]) { // if the button group is an array (one button is not an array)
      for (var i=0; i<buttonGroup.length; i++) {
         if (buttonGroup[i].checked) {
            return i
         }
      }
   } else {
      if (buttonGroup.checked) { return 0; } // if the one button is checked, return zero
   }
   // if we get to this point, no radio button is selected
   return -1;
} // Ends the "getSelectedRadio" function
	
	
function di(id,name){
  if (document.images) {document.images[id].src=eval(name+".src"); }
}

function dm(msgStr) {
  document.returnValue = false;
  if (document.images) { 
     window.status = msgStr;
     document.returnValue = true;
  }
}
var showMsg = navigator.userAgent != "Mozilla/4.0 (compatible; MSIE 4.0; Mac_PowerPC)";
function dmim(msgStr) {
  document.returnValue = false;
  if (showMsg) { 
    window.status = msgStr;
    document.returnValue = true;
  }
}

var active = false;
function showLanguage() {
	
	if (active) {
		active=false;
		hideNow();
		
	} else {
		active = true;
		languageDiv.style.visibility='visible';
	}
	
}

function hideLanguage() {
	setTimeout("hideNow()",300);
	active=false;
}

function hideNow() {
	if (!active) {
		languageDiv.style.visibility='hidden';
	}	
}

function goToURL() {
	var selectedIndex = document.search.language.selectedIndex;
	var theURL = document.search.language[selectedIndex].value;
	location.href=theURL;
}

function openWindow(theWidth, theHeight, theURL) {
	  winSettings ='toolbar=no,location=no,directories=no,resizable=yes,width='+theWidth+',height='+theHeight+',left=10,top=25';
	  floater = window.open(theURL,"",winSettings);
	  
}