/*
 * JavaScript Document
 * Author: Steffen Ivanowitsch
 */


YAHOO.namespace("bv.container");

function init() {
	
	YAHOO.bv.container.book1 = new YAHOO.widget.Panel("book1", { 
		width:"666px", 
		visible:false, 
		fixedcenter:false, 
		draggable: false,
		modal: true,
		close: false
		//context:["footer_books","tl","tl", ["beforeShow", "windowResize"]],
		//effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25} 
		} );
	YAHOO.bv.container.book1.render();
	
	YAHOO.bv.container.book2 = new YAHOO.widget.Panel("book2", { 
		width:"666px", 
		visible:false, 
		fixedcenter:false, 
		draggable: false,
		modal: true,
		close: false
		//context:["main_teaser_pic","bl","bl", ["beforeShow", "windowResize"]],
		//effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25} 
		} );
	YAHOO.bv.container.book2.render();
	
	//saves active panel
	YAHOO.bv.container.activePanel="";
}

function close_panel() {
	var act_panel = YAHOO.bv.container.activePanel;
	YAHOO.bv.container[act_panel].hide();
	YAHOO.bv.container.activePanel="";
	return false;
}


function respos_panel(panel) {
		
	var x=YAHOO.util.Dom.getX("main_teaser_pic");
	x=x+50;
	YAHOO.bv.container[panel].cfg.setProperty("x",x);
		
	var y=YAHOO.util.Dom.getY("main_teaser_pic");
	y=y+100;
	YAHOO.bv.container[panel].cfg.setProperty("y",y);
}


function show_panel(panel) {

	respos_panel(panel);

	if(YAHOO.bv.container.activePanel!="") {
		var panel_old=YAHOO.bv.container.activePanel;
		YAHOO.bv.container[panel_old].hide();
	}
	
	YAHOO.bv.container[panel].show();
	
	YAHOO.bv.container.activePanel=panel;
	return false;
}

YAHOO.util.Event.addListener(window, "load", init);
