// html5shiv MIT @rem remysharp.com/html5-enabling-script
// iepp v1.5.1 MIT @jon_neal iecss.com/print-protector
/*@cc_on@if(@_jscript_version<9)(function(p,e){function q(a,b){if(g[a])g[a].styleSheet.cssText+=b;else{var c=r[l],d=e[j]("style");d.media=a;c.insertBefore(d,c[l]);g[a]=d;q(a,b)}}function s(a,b){for(var c=new RegExp("\\b("+m+")\\b(?!.*[;}])","gi"),d=function(k){return".iepp_"+k},h=-1;++h<a.length;){b=a[h].media||b;s(a[h].imports,b);q(b,a[h].cssText.replace(c,d))}}function t(){for(var a,b=e.getElementsByTagName("*"),c,d,h=new RegExp("^"+m+"$","i"),k=-1;++k<b.length;)if((a=b[k])&&(d=a.nodeName.match(h))){c=new RegExp("^\\s*<"+d+"(.*)\\/"+
d+">\\s*$","i");i.innerHTML=a.outerHTML.replace(/\r|\n/g," ").replace(c,a.currentStyle.display=="block"?"<div$1/div>":"<span$1/span>");c=i.childNodes[0];c.className+=" iepp_"+d;c=f[f.length]=[a,c];a.parentNode.replaceChild(c[1],c[0])}s(e.styleSheets,"all")}function u(){for(var a=-1,b;++a<f.length;)f[a][1].parentNode.replaceChild(f[a][0],f[a][1]);for(b in g)r[l].removeChild(g[b]);g={};f=[]}for(var m="abbr article aside audio canvas command datalist details figure figcaption footer header hgroup mark meter nav output progress section summary time video".replace(/ /g,
"|"),n=m.split("|"),r=e.documentElement,i=e.createDocumentFragment(),g={},f=[],o=-1,l="firstChild",j="createElement";++o<n.length;){e[j](n[o]);i[j](n[o])}i=i.appendChild(e[j]("div"));p.attachEvent("onbeforeprint",t);p.attachEvent("onafterprint",u)})(this,document)@end@*/

/*
### ul navigation ###
*/

var timeout         = 500;
var closetimer		= 0;
var ddmenuitem      = 0;

function ul_open() {	
	ul_canceltimer();
	ul_close();
	ddmenuitem = $(this).find('ul').eq(0).css('visibility', 'visible');
}
function ul_close() {
	if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');
}

function ul_timer() {
	closetimer = window.setTimeout(ul_close, timeout);
}

function ul_canceltimer() {
	if(closetimer) {
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}
$(document).ready(function() {
	$('#navMeta > li').bind('mouseover', ul_open);
	$('#navMeta > li').bind('mouseout',  ul_timer);
	$('#navMainOpen > li').bind('mouseover', ul_open);
	$('#navMainOpen > li').bind('mouseout',  ul_timer);
	
	// quicksearch
	$('#ctrl_1').focus(function() {  
            this.value = '';  
    });  	
	$('#ctrl_133').focus(function() {  
            this.value = '';  
    });  	
	
	
});
document.onclick = ul_close;

/*
### gossweiler stuff ###
*/

var GGM={
	banner:function(imgsrc,linkto,w,h,x,y,centred,appendTo){
		var link=document.createElement("A");
		link.href=linkto;
		link.className="banner";
		link.style.width=w;
		link.style.height=h;
		if(x!=0){link.style.left=x+"px";}
		if(y!=0){link.style.top=y+"px";}
		link.style.height=h;
		var img=document.createElement("IMG");
		img.src=imgsrc;
		link.appendChild(img);
		var parentObject=appendTo?appendTo:document.getElementsByTagName("BODY")[0];
		parentObject.appendChild(link);
		if(centred){centreMe(link.id,"h");}
	},
	centreMe:function(oIn,mode){
		if(document.getElementById){
			oWin=new clientwindow();
			var oIn=oIn?((typeof oIn).toLowerCase()=="object")?oIn:document.getElementById(oIn):null;
			if(oIn){
				if(!mode){mode="xy"}
				newX=(parseInt(parseInt(oWin.w,10)-oIn.offsetWidth)/2,10);
				newY=(parseInt(parseInt(oWin.h,10)-oIn.offsetHeight)/2,10);
				switch(mode){
					case "x":
						oIn.style.left=newX>0?newX+"px":"0px";
						break;
					case "y":
						oIn.style.top=newY>0?newY+"px":"0px";
						break;
					default:
						oIn.style.left=newX>0?newX+"px":"0px";
						oIn.style.top=newY>0?newY+"px":"0px";
						break;
				}
				if(oIn.style.visibility!="visible"){oIn.style.visibility="visible";}
				setTimeout("centreMe('"+oIn.id+"','"+mode+"')",5);
			}
		}
	},
	mapshow:function(o){
		document.getElementById(o.id+'_r').style.display='block';
	},
	maphide:function(o){
		document.getElementById(o.id+'_r').style.display='none';
	}
}






