function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5);	
	return this
}
bw=new checkBrowser()

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_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; }
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function dropselection(name, formname){
   for(i=0;i<document.forms[formname].elements[name].length;++i){ 
     if(document.forms[formname].elements[name].options[i].selected == true && document.forms[formname].elements[name].options[i].value)
     {
         window.location = document.forms[formname].elements[name].options[i].value;
     }
   }
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function winopen(theURL, wname, width, height, features){
    if(width > screen.width || height > screen.height) {
        positionx = 0;
        positiony = 0;
        width = screen.width-10;
        height = screen.height-60;
    } else {
        positionx=(screen.width/2)-(width/2)
        positiony=(screen.height/2)-(height/2)
    }
	window.open(theURL, wname,"width="+ width +",height="+ height +",toolbar=no,menubar=no,left=" + positionx + ",top=" + positiony + ",screenX=" + positionx + ",screenY=" + positiony +","+ features);
}

function highlightCurrentLink(url){
    var anzHrefs2 = document.getElementById("SubnavModul").getElementsByTagName("a").length;
	if (anzHrefs2 > 0) {
		for (var i = 0; i <= anzHrefs2 - 1; i++) {
			aLink = document.getElementById("SubnavModul").getElementsByTagName("a")[i];
			if(aLink.getAttribute("href")) linkurl = aLink.getAttribute("href");
			else linkurl = "#";
	
			// for the IE
			if (linkurl.substr(0,4)=="http"){
				hostname = document.location.hostname      
				linkurl = linkurl.substr(linkurl.lastIndexOf(hostname)+hostname.length,linkurl.length);
			}
			
			//subnav highlight
			if (linkurl == url && aLink.parentNode.getAttribute("id") == "subnav") {
				aLink.parentNode.className = "link5";			
				aLink.parentNode.parentNode.parentNode.previousSibling.childNodes[1].className = "subnavactive";
				aLink.parentNode.parentNode.parentNode.previousSibling.firstChild.firstChild.src = "images/DSLR_nav_bullet_active.gif";
				aLink.parentNode.parentNode.parentNode.setAttribute("id", "mTrue");
				
			//subnav main highlight
			} else if (linkurl == url && aLink.parentNode.getAttribute("id") == "subnavmain"){
				aLink.parentNode.className = "subnavactive";
				aLink.parentNode.parentNode.firstChild.firstChild.src = "images/DSLR_nav_bullet_active.gif";
				if(document.getElementById("SubnavModul").getElementsByTagName("a")[i+1]) document.getElementById("SubnavModul").getElementsByTagName("a")[i+1].parentNode.parentNode.parentNode.setAttribute("id", "mTrue");
				
			//mark the menues not to display
			} else if (aLink.parentNode.getAttribute("id") == "subnav" && aLink.parentNode.parentNode.parentNode.getAttribute("id") != "mTrue") {
				aLink.parentNode.parentNode.parentNode.setAttribute("id", "mFalse")
			}
		}
		if (linkurl.substr(1,6) != "reddot" && !bw.ie4 && !bw.ns4) deleteMenues();
	}
}

//delete unneeded menues
function deleteMenues(){
    var anzTr = document.getElementById("SubnavModul").getElementsByTagName("tr").length;
	for(i=0;i<anzTr;i++){			
		if(document.getElementById("SubnavModul").getElementsByTagName("tr")[i] && document.getElementById("SubnavModul").getElementsByTagName("tr")[i].getAttribute("id") == "mFalse"){
			if(bw.ie5){
				kill = document.getElementById("SubnavModul").getElementsByTagName("tr")[i].childNodes[1];
				document.getElementById("SubnavModul").getElementsByTagName("tr")[i].removeChild(kill);
			}else{
			    kill = document.getElementById("SubnavModul").getElementsByTagName("tr")[i];
			    document.getElementById("SubnavModul").getElementsByTagName("tr")[i].parentNode.removeChild(kill);
			}		
		}
	}
}

//flash?
var ShockMode = 0;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if (plugin&& parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 6) {
ShockMode = 1;
} else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && navigator.userAgent.indexOf("Windows")>=0) {
 document.write('\<SCRIPT LANGUAGE=VBScript\>');
 document.write('on error resume next \n');
 document.write('ShockMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
 document.write('\</SCRIPT\>');
}
