$(document).ready(function(){
	$("#search-block td a.search").hover(function(){
		$("#search-block .search-result").fadeIn("slow");
		$(".searchfield").focus();
	},function(){
		//$("#search-block .search-result").fadeOut("slow");
	});
	
	$("#search-block ").hover(function(){
	},function(){
		$("#search-block .search-result").fadeOut("slow");
	});
	
	$("#search-block select").focus(function(){
		$("#search-block .search-result").fadeOut("slow");
	});
});


function jumpTo(id) { window.location.href='#'+id; }

/*** added by CAL ***/
        /* addOnloadEvent : to add non-obstrusive event at onload */function addOnloadEvent(fct){var oldonload = window.onload;if (typeof window.onload != 'function') {window.onload = fct;}else {window.onload = function() {oldonload();fct();}}}
        var pageLg = "en";
        addOnloadEvent(function(){

            /*
            *
            * this function adds a link and a legend on each image of the site where "hiResVisuURL" is defined 
            * Note : the variable "pageLg" can be redefined in each page to change the language of legend displayed on the images (if not set, default is english (EN) )
            *
            */

            var imgList = document.getElementsByTagName("IMG");
            for(var i=0;i<imgList.length;i++){
                var hiResUrl = imgList[i].getAttribute("hiResVisuURL");
                if(hiResUrl && hiResUrl!=""){
                    var tmpA = document.createElement("A");
                    tmpA.href=hiResUrl;
                    tmpA.target="blank";
                    tmpA.style.position="relative";
                    imgList[i].parentNode.insertBefore(tmpA,imgList[i]);
                    tmpA.appendChild(imgList[i]);
                    if(pageLg){
                        var tmpImg = document.createElement("IMG");
                        tmpImg.src = "/01/images/FlatGlassEurope/downloadImageHigh_"+pageLg+".gif";
                        tmpImg.style.position="absolute";
                        tmpImg.style.border="none";
                        tmpImg.style.display="none";
                        tmpA.appendChild(tmpImg);
                        tmpA.legend=tmpImg;
                        tmpImg.style.opacity=0.8;
                        tmpImg.style.filter="Alpha(Opacity=80)";
                        tmpA.onmouseover=function(){
                            this.legend.style.display = "block";
                            this.legend.style.top=(this.offsetHeight-this.legend.offsetHeight-4)+"px";
                            this.legend.style.left=(this.offsetWidth-this.legend.offsetWidth)+"px";
                        }
                        tmpA.onmouseout=function(){this.legend.style.display = "none";}
                    }
                }
            }
        });
/*** added by CAL ***/

/*** Careers > Qualitfications Mosaic With Layers ***/
function MuM_findObj(n, d) {
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MuM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MuM_showHideLayers() {
	var i,p,v,obj,args=MuM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=MuM_findObj(args[i]))!=null) { v=args[i+2];
	if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
	obj.visibility=v; }
}
/*** added by FDE ***/
function textLimit(field, maxlen) {
    if (field.value.length > maxlen)
        field.value = field.value.substring(0, maxlen);
}