YAHOO.namespace("groco.container");
var img_path = "image/";



var h;
var w;

function setHW(e){
	h = YAHOO.util.Dom.getDocumentHeight();
	w = YAHOO.util.Dom.getDocumentWidth();
}

function loadImage(i){
	var img = i.href;
}

function newRunner(ref){
	YAHOO.groco.container.runner = new YAHOO.widget.Overlay("new-runner", { fixedcenter:"contained", 
	  visible:true,
	  width:"400px",
	  height:"300px",
	  zIndex:10000,
	  effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25} } );
	var content = '<div class="formitem">'+
	'<div class="formtext">Name</div>'+
	'<div class="formfield"><input name="add_name" type="text" value="" /></div>'+
	'</div>';
	YAHOO.groco.container.runner.setBody(content);
	YAHOO.groco.container.runner.render("groco");
}

function initZoom(){
	setHW();
	YAHOO.groco.container.zoomarea = new YAHOO.widget.Overlay("zoomarea", { fixedcenter:"contained", 
			xy:[0,0],
		  visible:false,
		  width:w+"px",
		  height:h+"px",
		  zIndex:999,
		  effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25} } );
	YAHOO.groco.container.zoomarea.render("groco");
	
	YAHOO.util.Event.addListener("shi1", "click", YAHOO.groco.container.zoomarea.show, YAHOO.groco.container.zoomarea, true);
	YAHOO.util.Event.addListener("shi2", "click", YAHOO.groco.container.zoomarea.show, YAHOO.groco.container.zoomarea, true);
	YAHOO.util.Event.addListener("zoomclose", "click", YAHOO.groco.container.zoomarea.hide, YAHOO.groco.container.zoomarea, true);
}

function loadImage(img){
	var img = img.href;
	document.getElementById("zoomcontent").innerHTML = '<img src="'+img+'" alt="Bild Zoom" />';
}

YAHOO.util.Event.onDOMReady(initZoom);

function initGallery(e){
	var el = YAHOO.util.Dom.getElementsByClassName("gal-thumb", "a");
	for(var i=0;i<el.length;i++){
		YAHOO.util.Event.addListener(el[i], "click", YAHOO.groco.container.zoomarea.show, YAHOO.groco.container.zoomarea, true);
	}
}