/* 
   informedia javascript functions
   'Externe Funktionen' - 2008-06-05 14:15:39
*/

function externalLinks() {
 // solution based on:
 // http://www.sitepoint.com/article/standards-compliant-world
 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") != null) && (
   		(anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") ||
   	   	(anchor.getAttribute("href").substring(anchor.getAttribute("href").length - 4) == ".pdf")
		)
	   )
     anchor.target = "_blank";
 }
}

window.onload = externalLinks;


/* other functions */

function writeDate() {
	var now = new Date();
	var yr = now.getFullYear();
	var mName = now.getMonth() + 1;
	var dName = now.getDay() + 1;
	var dayNr = ((now.getDate()<10) ? "0" : "")+ now.getDate();
	if(dName==1) Day = "Sonntag";
	if(dName==2) Day = "Montag";
	if(dName==3) Day = "Dienstag";
	if(dName==4) Day = "Mittwoch";
	if(dName==5) Day = "Donnerstag";
	if(dName==6) Day = "Freitag";
	if(dName==7) Day = "Samstag";
	if(mName==1) Month="Januar";
	if(mName==2) Month="Februar";
	if(mName==3) Month="März";
	if(mName==4) Month="April";
	if(mName==5) Month="Mai";	
	if(mName==6) Month="Juni";
	if(mName==7) Month="Juli";
	if(mName==8) Month="August";
	if(mName==9) Month="September";
	if(mName==10) Month="Oktober";
	if(mName==11) Month="November";
	if(mName==12) Month="Dezember";
	var todaysDate =('<span class="date">'
	+ Day
	+ ',<br \/>'
	+ dayNr
	+ '. '
	+ Month
	+ ' '
	+ yr
	+ '<\/span>');
	document.open();
	document.write(todaysDate);
}


function popup(newin,x,y,breite,hoehe) {
	einstellungen = "menubar=yes,status=no,resizable=no,scrollbars=yes,width="+breite+",height="+hoehe+",top="+y+",left="+x;
	flyout=window.open(newin,"flyout",einstellungen);
    flyout.window.focus();
}

