TriggerGalleryImage();

function TriggerGalleryImage(){

	var items = $$('div.gallery img.keyvisual');
	var counter = 0;
	items.each(function(item){
		item.alt = '';

		item.onclick=function(event){
			var aID = item.id.split('-');
			HideFlash();
			xajax_xajaxYoga.ShowLightBox(aID[1]);
			//alert(aID[1]);
		}

		counter++;
	});
}


// scr: http://codesnippets.joyent.com/posts/show/836
Position.GetWindowSize = function(w) {
	w = w ? w : window;
	var width = w.innerWidth || (w.document.documentElement.clientWidth || w.document.body.clientWidth);
	var height = w.innerHeight || (w.document.documentElement.clientHeight || w.document.body.clientHeight);
	return [width, height];
};


Position.Center = function(element, parent) {
        	var w, h, pw, ph;
        	var d = Element.getDimensions(element);
       	 	w = d.width;
        	h = d.height;
        	Position.prepare();
	        if (!parent) {
	                var ws = Position.GetWindowSize();
	                pw = ws[0];
	                ph = ws[1];
	                //alert(ws);
	        } else {
	                pw = parent.offsetWidth;
	                ph = parent.offsetHeight;
	        }

	        $(element).style.top = (ph/2) - (h/2) +  Position.deltaY  + "px";
	        //$(element).style.left = (pw/2) - (w/2) -  Position.deltaX + "px";
}

function HideFlash(){

  	var obj = $$("object");

	obj.each(function(item){
		Effect.Fade(item);
	});
}

function ShowFlash(){

  	var obj = $$("object");

	obj.each(function(item){
		Effect.Appear(item);
	});
}
