// Script detailansicht.js (c) PDA Max, Inh. Matthias Wisniewski
// Version 1.2 vom 18.04.2008
//
// prüfen ob Reload der Seite erforderlich, da Paramter fehlen
//
var reload_params = '';
if ( (top.sid ) && ( document.cookie.indexOf("sid=") == -1) && ( window.location.search.indexOf("sid=") == -1) ) { 
	reload_params = reload_params + "sid=" + top.sid;
}
if ( (top.wg ) && ( document.cookie.indexOf("aktive_wg=") == -1) && ( window.location.search.indexOf("WG=") == -1) ) { 
	if ( reload_params.length > 0 ) {
		reload_params = reload_params + '&WG=' + top.wg;
	} else {
		reload_params = reload_params + "WG=" + top.wg;
	}
}
if ( reload_params.length > 0 ) { 
	window.location.replace (window.location.pathname + '?' + reload_params) 
}
//
// COOLjsTree-Node auf oder zuklappen
//
function navi_tree_node ( ausWG ) {
	ausWG = ausWG.substring ( ausWG.indexOf("=") + 1 , ausWG.length );
	if ( ausWG.match(/^__/ ) ) { ausWG = "_hersteller" };	
	top.wg = ausWG;	
	if (top.frmMenu) {
	 if (top.frmMenu.tree) { 	
		if ( ausWG ) {
			top.frmMenu.force_node_open( ausWG );
		} else {
			top.frmMenu.close_all_nodes ();
		} 
	 }
	}
}		
//
// "Link zum Artikel" Pop-up oeffnen
// 
function pop_link_window( params ) {
	//
	var breite=680; 
	var hoehe=320; 
	var positionX=((screen.availWidth / 2) - breite / 2); 
	var positionY=((screen.availHeight / 2) - hoehe / 2); 
	link_pop=window.open('','','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,fullscreen=0,width='+breite+',height='+hoehe+',top=0,left=0'); 
	if (link_pop) {
		link_pop.resizeTo(breite,hoehe); 
		link_pop.moveTo(positionX,positionY); 
		link_pop.location = '../cgi-bin/artikel_link.pl?' + params;
		link_pop.focus();	
	} else {
		alert ( 'Fehler: PopUp-Fenster bockiert.\n\nDie Einstellung Ihres Browsers blockiert PopUps. Das Fenster konnte deshalb nicht angezeigt werden.\n\n\nBitte ändern Sie die Pop-up Einstellungen in Ihrem Browser.' );
	}
}