function windowopen(bild,ordner){
	window.open('index.php?lia_page=bild&bild='+bild+'&ordner='+ordner,'PopUp','width=572,height=700,menubar=yes,scrollbars=yes,toolbar=no,status=no,resizable=yes');
	}

function windowopenquer(bild,ordner){
	window.open('index.php?lia_page=bild&bild='+bild+'&ordner='+ordner,'PopUp','width=835,height=595,menubar=yes,scrollbars=yes,toolbar=no,status=no,resizable=yes');
	}

function windowopen2(bild,ordner,width,height) {
	windowwidth=width*=1;
	windowwidth=windowwidth+35;
	windowheight=height*=1;
	windowheight=windowheight+50;
	window.open('index.php?lia_page=bild&bild='+bild+'&ordner='+ordner+'&width='+width+'&height='+height,'PopUp','width='+windowwidth+',height='+windowheight+',menubar=yes,scrollbars=yes,toolbar=no,status=no,resizable=yes');
	}

function closeall() {
	document.getElementById('kontaktformular').style.display='block';
	vis1=0;
	document.getElementById('reklamation').style.display='none';
	vis2=0;
	document.getElementById('fragen').style.display='none';
	vis3=0;
	document.getElementById('werksverkauf').style.display='none';
	vis4=0;
	document.getElementById('haendlersuche').style.display='none';
	document.getElementById('allgemeinefragen').style.display='none';

	document.getElementById('footer').style.paddingTop='0';
	}

function show(id) {
	vis1=1;
	vis2=1;
	vis3=1;
	vis4=1;
	
	if (document.getElementById(id)) {
		document.getElementById(id).style.display='block';
	}
	if(id=='werksverkauf'){
		document.getElementById('kontaktformular').style.display='none';
		}
	if(id=='haendlersuche'){
		document.getElementById('kontaktformular').style.display='none';
		}
	document.getElementById('footer').style.paddingTop='300px';
}

function swapPics1() {
	document.getElementById("pic-hoch").src = "../images/button_highlights_up-aktiv.gif";
	document.getElementById("pic-runter").src = "../images/button_highlights_down-aktiv.gif";
}

function swapPics2() {
	document.getElementById("pic-hoch").src = "../images/button_highlights_up-inaktiv.gif";
	document.getElementById("pic-runter").src = "../images/button_highlights_down-inaktiv.gif";
}

function getcs(objid,prop)
{
  var obj, propval;
//   if (document.documentElement && document.defaultView)
//   {
    obj=document.getElementById(objid);
    propval=document.defaultView.getComputedStyle(obj,"").getPropertyValue(prop);
    alert(prop+": "+propval);
//   }
//   else
//   {
//     alert("Ihr Browser unterstuetzt diese W3C-DOM-Methode nicht.");
//   }
}

function external_links() {
  if (!document.getElementsByTagName) return;
  var anchors = document.getElementsByTagName("a");
  for (var i=0; i<anchors.length; i++) {
    var anchor = anchors[i];
    if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
      anchor.target = "_blank";
	    anchor.title = (anchor.title != "") ? anchor.title+" [öffnet in neuem Fenster]" : anchor.getAttribute("href")+" [öffnet in neuem Fenster]";
	    anchor.className = (anchor.className != '') ? anchor.className+' external' : 'external';
	  }
  }
}

$(document).ready(function() {
		

	
	if ($('#equest').length) {
		/* Animation Startseite Headerbilder */
		$('#equestbg').cycle({ 
			timeout:  1000,
			speed: 2500,
			pause: 1
		});
		
		$("#equest > div > div > a").hover(function(i){
			$('#equestbg').cycle('pause');
			var link_class = $(this).attr("class");			
			if (link_class) { 
				$("#equestbg > img").css("opacity","0");
				$("#equestbg > img").css("z-index","1");
				$("#equestbg > img."+link_class).css("opacity","1");
				$("#equestbg > img."+link_class).css("z-index","11");
				$("#equestbg > img."+link_class).css("display","block");
			}
		});
		
		$("#equest > div > div > a").mouseout(function(i){
			// var link_class = $(this).attr("class");
			// $("#equestbg > img."+link_class).fadeOut("slow");
			
			$('#equestbg').cycle({ 
				timeout:  1000,
				speed: 2500,
				pause: 1
			});
			
		});
	}
	
	/*if ($('#dwwrapper').length) {
		$("#dwclose").click(function() {
			$('.welcome_teaser').fadeOut("slow");
			// $('#designwettbewerb').fadeOut("slow");
			return false;
		});
	}*/
});

