/* This script is used for rollover of a different object than the object that the
mouose is over. 
First we check if the element that the mouse is over has the right class name.
If it does, we take the id of that element and we add an 'r' at the end of it. 
The element that we will rollover, will have the same id as the previews one plus an
'r' at the end.
*/

//Preload images:
loadimg0 = new Image();
loadimg0.src = "../images/template/dots1_o.gif";
loadimg1 = new Image();
loadimg1.src = "../images/template/searchbut_o.gif";

//The following 2 functions are used to hide the email address.

function elink(e){
document.write("<a href='mailto:"+e+"@"+"cymedas.com' class='bolink2'>");
}
function eplain(e){
document.write(e+"@"+"cymedas.com</a>");
}

//The following function is used for the popups

function popup(mid){
var popurl="contact_mediator.php?mid="+mid;
window.open (popurl,'newwindow',config='height=500,width=450,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=no');
}


function doroll(evt) {
evt = (evt) ? evt : ((window.event) ? window.event : "")
  if (evt) {
    var elem
    if (evt.target) {
      elem = (evt.target.nodeType == 3) ? evt.target.parentNode : evt.target
    } else {
      elem = evt.srcElement
    }
    if (elem) {
    // code here :
    
        if (elem.className == "bolink" || elem.className == "menulink") {
                rollelem=elem.id+'r';
                if (evt.type == "mouseover"){ // code for mouseover here:

                        document.getElementById(rollelem).src="../images/template/dots1_o.gif";

                }else {                       // code for mouseouthere:

                        document.getElementById(rollelem).src="../images/template/dots1.gif";
                }
        }

	if (elem.className == "imgover") {
		var aname='../images/template/'+elem.id+'.gif';
		var rollname='../images/template/'+elem.id+'_o.gif';
		if (evt.type == "mouseover"){ // code for mouseover here:

                        document.getElementById(elem.id).src=rollname;

                }else {                       // code for mouseouthere:

                        document.getElementById(elem.id).src=aname;
                } 
        }
		
        
     // code above ^^   
     }
  }
}
document.onmouseover=doroll;
document.onmouseout=doroll;