// JavaScript Library for Panther Microsite

/**
 * Shows or hides <div>-tags
 * <a href="javascript: switch_display('technik');">solide Technik</a>
 * @params   string   name of the elements to switch
 *
 * @return  void
 */
function switch_display() {
	var elements = switch_display.arguments;
	for (i=0; i<elements.length; i++) {
		if (document.getElementById(elements[i]).style.display=='block') {
			document.getElementById(elements[i]).style.display='none';
		} else {
			document.getElementById(elements[i]).style.display='block';
		}
	}
}



/**
 * Displays a confirmation box beforme activating the clicked link.
 * usage: 
 * <a href="javascript: addPantherFavorite(); ">Add Panther to favorites</a>
 *
 * @return  void
 */
function addPantherFavorite() {
	if (document.all) {
		window.external.AddFavorite('http://www.panther.de','PANTHER');
	}
}



/**
 * Opens a new window depending on the date on the client machine
 * usage: 
 * <body onLoad="openTimedWindow();">
 *
 * @return  void
 */
function openTimedWindow() {
	var activeDate = new Date;
	if (activeDate.getDate() < 11) {
		window.open('index.php?id=20','teaser','width=450,height=250');
	}
}



/**
 * Opens a new window with the given url, window name and features on or off
 * usage: 
 * <a href="javascript: MM_openBrWindow('popup_vcc.html','vcc','width=700,height=450')">
 * @params   string   url for the window
 * @params   string   name of the window
 * @params   string   featurelist separated by commas but no spaces
 *
 * @return  void
 */
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}