
document.write('<!--[if IE]><style type="text/css" media="screen">#menu ul li {float: left; width: 100%;}</style><![endif]--><!--[if lt IE 7]><style type="text/css" media="screen">body {behavior: url(csshover.htc); font-size: 100%;}#menu ul li a {height: 1%;} } </style> <![endif]-->');

document.getElementsByClassName = function(clsName){
    var retVal = new Array();
    var elements = document.getElementsByTagName("*");
    for(var i = 0;i < elements.length;i++){
        if(elements[i].className.indexOf(" ") >= 0){
            var classes = elements[i].className.split(" ");
            for(var j = 0;j < classes.length;j++){
                if(classes[j] == clsName)
                    retVal.push(elements[i]);
            }
        }
        else if(elements[i].className == clsName)
            retVal.push(elements[i]);
    }
    return retVal;
}
//Publikationen in den Warenkorb packen 
function addtoPub(formname){
	var params = Form.serialize($(formname));
	new Ajax.Request('frontend/ajaxfunc.cfm?name=addtoPub&formname='+formname,{method: 'post',parameters:params,onComplete:function(response){showpub();}}); 
	var t = params.split('=');
	var id = t.pop(t);
	$('pubanswer'+id).style.display='none';
	$('pubanswer'+id).update('<span class="pubanswerWow">!</span>Artikel wurde in Ihren Warenkorb gelegt');
	$('pubanswer'+id).style.display='block';
	new Effect.Fade('pubanswer'+id,{duration:5});
}
function closediv(name){
	var x = document.getElementsByClassName(name);
	var j = 0;
		for(j = 0;j < x.length;j++){
			x[j].style.display="none";
		}
			
}
function closedivids(ids){
	var t = ids.split("|");
   	for(var x=0; x <= t.length; x++){
      var subst = t[x];
	  if($('issuuViewer'+t[x])){
	      $('issuuViewer'+t[x]).style.display="none";
	  }
	}
}
/*Publikationen show issuu View*/
function issu(id,Issouid){
		closediv("issudiv");
		if($('issuuViewer0') !=undefined){
			 var parent = $('issuudiv0Outer');
			 var tg =$('issuuViewer0'); 
			 parent.removeChild(tg);
			 //parent.appendChild('issuudiv0');
			 //Element('issuudiv0'+id).addClassName("issudiv");
			 $('issuudiv0Outer').update('<div id="issuudiv0" class="issudiv" style="display:none">&nbsp;</div>');
		}
		var attributes = {
			  id: 'issuuViewer'+id
		};
		var params = {
			allowfullscreen: 'true',
			allowScriptAccess: 'always',
			menu: 'false'
		};
		var flashvars = {
			jsAPIClientDomain: 'issuu.com',
			mode: 'embed',
			layout: 'http%3A%2F%2Fskin.issuu.com%2Fv%2Flight%2Flayout.xml',
			showFlipBtn: 'true',
			documentId: Issouid,
			docName: 'gan_issuu',
			username: 'websupport',
			loadingInfoText: 'Hessen-IT',
			et: '1251988902514',
			er: '29'
		};
		swfobject.embedSWF("http://static.issuu.com/webembed/viewers/style1/v1/IssuuViewer.swf", "issuudiv"+id, "420", "264", "9.0.0","js/swfobject/expressInstall.swf", flashvars, params, attributes);
		$('issuuViewer'+id).style.display='block';
		
}
		
//Publikationen  Warenkorb anzeigen 
function showpub(){
		var url = 'frontend/ajaxfunc.cfm?name=showpub';
		var myAjax = new Ajax.Request(
		url, 
			{method: 'POST', 
				onSuccess: function(response){
					var response = response.responseText;
					Element.update('mywarenkorb',response);
					
					if(response.length !=0){
						$('mywarenkorba').style.display='block';
						$('warenkorberklaerbaer').style.display='none';
					}
					else{
						$('mywarenkorba').style.display='none';
						$('warenkorberklaerbaer').style.display='block';
					}
				},
				onFailure: function(){alert('Ein Fehler ist aufgetreten...'+response)}
			});
		}
		
//Publikationen im Warenkorb loeschen 
function deletepub(pubid){
	var url = 'frontend/ajaxfunc.cfm?name=deletepub&pubid='+pubid;
		var myAjax = new Ajax.Request(
		url, 
			{method: 'POST', 
				onSuccess: function(response){
					//var response = response.responseText;
					showpub();
				},
				onFailure: function(){alert('Ein Fehler ist aufgetreten...'+response)}
			});	
	}
	
/***********************************************************************+


		Downloads		


*******************************************************************/
//downloads Suche
function searchdown1(formname){
	var params = Form.serialize($(formname));
	new Ajax.Request('frontend/ajaxfunc.cfm?downl='+formname,{asynchronous:true,parameters:params,
					 onSuccess: function(response){
							var response = response.responseText;
							Element.update('Ausgabe',response);
							if(response.length !=0){
								$('Ausgabe').style.display='block';
								$('keineAusgabe').style.display='none';
							}
							else{
								$('Ausgabe').style.display='none';
								$('keineAusgabe').style.display='block';
							}
						},
						onFailure: function(){alert('Ein Fehler ist aufgetreten...'+response)}
					 }); 
}

function searchdown2(tagname){
	var url = 'frontend/ajaxfunc.cfm?downl=searchdown&tagname='+tagname;
	var myAjax = new Ajax.Request(
	url, 
		{method: 'POST', 
			onSuccess: function(response){
				var response = response.responseText;
						Element.update('Ausgabe',response);
						if(response.length !=0){
							$('Ausgabe').style.display='block';
							$('keineAusgabe').style.display='none';
						}
						else{
							$('Ausgabe').style.display='none';
							$('keineAusgabe').style.display='block';
						}
			},
			onFailure: function(){alert('Ein Fehler ist aufgetreten...'+response)}
		});	
}

function searchdownall(idlist){
	var url = 'frontend/ajaxfunc.cfm?downl=searchdown&idlist='+idlist;
	var myAjax = new Ajax.Request(
	url, 
		{method: 'POST', 
			onSuccess: function(response){
				var response = response.responseText;
						Element.update('Ausgabealle',response);
						
			},
			onFailure: function(){alert('Ein Fehler ist aufgetreten...'+response)}
		});	
}

/*************Ansprechpartner***********************/
function AnsprechDetailID(funcname,id){
	Element.update('featurediv','<img src="../images/ajax-loader.gif" />');
	var url = 'frontend/ajaxfunc.cfm?AnsprechDetail='+funcname+'&id='+id;
	var myAjax = new Ajax.Request(
		url, 
			{method: 'POST', 
				onSuccess: function(response){
					var response = response.responseText
						Element.update('featurediv',response);
						new Effect.Appear('featurediv');
					},
				onFailure: function(){alert('Ein Fehler ist aufgetreten...'+response)}
			});
	}
/*************Kalenderbox***********************/
function Kalenderbox(month,year){
	Element.update('kalenderboxOuter','<img src="../images/ajax-loader.gif" />');
	var url = 'frontend/Kalenderbox.cfm?month='+month+'&year='+year;
	var myAjax = new Ajax.Request(
		url, 
			{method: 'POST', 
				onSuccess: function(response){
					var response = response.responseText
						Element.update('kalenderboxOuter',response);
						enableTooltips();
						
					},
				onFailure: function(){alert('Ein Fehler ist aufgetreten...'+response)}
			});
	}
	/***********Facebook Button********************/
function insertLikeButton(aid,text) {
	
      var fbURL = 'http://www.facebook.com/plugins/like.php?locale=de_DE&href='+text+'&layout=standard&show_faces=false&width=300&font=verdana&action=like&colorscheme=light&height=35';	  
	  
      var container = document.getElementById('fbLike' + aid);
      //var width = container.style.width;
      //var height = container.style.height;
      var fbFrame = document.createElement("IFRAME");
      fbFrame.setAttribute("src", fbURL);
      fbFrame.setAttribute("scrolling", "no");
      fbFrame.setAttribute("frameBorder", 0);
      fbFrame.setAttribute("allowTransparency", true);
      fbFrame.style.border = "none";
      fbFrame.style.overflow = "hidden";
      fbFrame.style.width = '300px';
      fbFrame.style.height = '35px';
      container.replaceChild(fbFrame, document.getElementById('fbl'+aid));
	  var url = 'http://cdn.hessen-agentur.de/facebooktracker/tracker.cfm?text='+text;
		var myAjax = new Ajax.Request(
		url, 
			{method: 'POST', 
				onSuccess: function(response){
					var response = response.responseText;
				},
				onFailure: function(){alert('Ein Fehler ist aufgetreten...'+response)}
			});
   }
   
