// browsercheck
function browsercheck(){
	var myPlatform = navigator.platform;
	var myBrowser = "???";
	if(document.ids){
		myBrowser="nc4";
	}else if(document.all && !document.getElementById ){
		myBrowser="ie4";
	}else if( window.opera && !document.createElement ){
		myBrowser="op5";
	}else if( window.opera && window.getComputedStyle )  {
		if(document.createRange){
			  myBrowser="op8";
		}else if(window.navigate){
			myBrowser="op7.5";
	    }else{ 
			myBrowser="op7.2";    
		}               
	}else if( window.opera && document.compatMode ){
		myBrowser="op7";
	}else if( window.opera && document.releaseEvents ){
		myBrowser="op6";
	}else if( document.contains && !window.opera ){
		myBrowser="kq3";
	}else if(window.pkcs11&&window.XML){
		myBrowser="f15";
	}else if( window.getSelection && window.atob ){
		myBrowser="nn7";
	}else if( window.getSelection && !document.compatMode ){
		myBrowser="nn6";
	}else if( window.clipboardData && document.compatMode ){
		myBrowser="ie6";
	}else if( window.clipboardData ){
		myBrowser="ie5";
	    if( !document.createDocumentFragment ){
			myBrowser+=".5";
		}
	    if( document.doctype && !window.print ) {
			myBrowser+="m";
		}
	}else if( document.getElementById && !document.all ){ 
		myBrowser="op4";
	}else if( document.images && !document.all ){ 
		myBrowser="nn3";
	}else if(document.clientWidth&&!window.RegExp){
		myBrowser="kq2";
	}
	//
	// document.write("Plattform="+myPlatform+" | Browser="+myBrowser);
	//
	if(myBrowser=="???"){
		showWarning();
	}
}
function showWarning(){
	var myText = "Your browser does not seem to support CSS properly. It is very likely that the page does not look the way it is intended!";
	var warning = document.createElement("div");
	var warningText = document.createTextNode(myText);
	warning.appendChild(warningText);
	body = document.getElementsByTagName("body")[0];
	first = body.firstChild;
	body.insertBefore(warning, first);
	document.getElementsByTagName("div")[0].style.backgroundColor = "yellow";
	document.getElementsByTagName("div")[0].style.padding = "5px";
}

//change cursor to hand
function hand(theId) {
	
	if (document.all) {
	
	document.all(theId).style.cursor ='hand';
	}
	else {
	document.getElementById(theId).style.cursor ='pointer';

	}
}

//switch image
function switchImage(theId,newPath) {
	document.getElementById(theId).src = newPath;	
}


function setStyleById(i, p, v) {
	var n = document.getElementById(i);
	n.style[p] = v;
}

// turn display of an element on
function displayOn(theId) {
	
	document.getElementById(theId).style.display = 'block';
}

function displayInline(theId) {
	
	document.getElementById(theId).style.display = 'inline';
}


// turn display of an element off
function displayOff(theId) {
		document.getElementById(theId).style.display = 'none';
}

// set focus to an element
function setFocus(theId) {
	document.getElementById(theId).focus()
}

// open new window
function openPopup(file,theWidth,theHeight) {
	popup = window.open(file,'_blank','width='+theWidth+','+'height='+theHeight+',top=30,left=60,status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=1"'); 
	popup.focus(); }


// imagePopup
function imagePopup(image,title,width,height)
{
  popup = window.open("","",'resizable=1,width='+width+',height='+height+',scroll=no');

  with (popup)
  {
    popup.focus();
    document.open();
   document.write('<html><head><title>'+title+'</title>');
   document.write('<meta http-equiv=\"imagetoolbar\" content=\"no\">');
   document.write('</head>');
   document.write('<body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" scroll=\"no\" class=\"picpop\">')
   document.write('<img src=\"'+image+'\" border=\"0\" alt=\"'+title+'\">')
   document.write('</body></html>')
   document.close();
  }
}


// videoPopup
function videoPopup(video,title,width,height)
{
height = height + 16
  popup = window.open("","",'resizable=1,width='+width+',height='+height+',scroll=no');

  with (popup)
  {
    popup.focus();
    document.open();
   document.write('<html><head><title>'+title+'</title>');
   document.write('<meta http-equiv=\"videotoolbar\" content=\"no\">');
   document.write('</head>');
   document.write('<body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" scroll=\"no\" class=\"picpop\">')
   document.write('<object><embed src="'+video+'\" width="'+width+'", height="'+height+'" CONTROLS=TRUE> </embed></object>')
   document.write('</body></html>')
   document.close();
  }
}