var _LiteBoxElements = new Array();

$(document).ready(function() {
	
	for (var i in document.getElementsByTagName("a")) {
		if (document.getElementsByTagName("a")[i].rel == "lightbox") {
			document.getElementsByTagName("a")[i].rel = "lightbox" + i;
		}
	}
	
	var shop;
	var shop_init;
	var browser;
	
	if ($.browser.msie) {
		shop_init = $("a[name='shop_init']").click(function(){window.open('https://www.adonia.de/de/shop.php');return false;});
		shop = $("a[class='shop']").click(function(){window.open('https://www.adonia.de/de/shop.php');return false;});
	} else {
		shop = $("a[class='shop']").colorbox({width:"960px", height:"790px", scrollbars:"none", iframe:true});
		//shop_init = $("a[name='shop_init']").colorbox({width:"960px", height:"790px", scrollbars:"none", iframe:true});
	}
	
      
	
	var ltb = $("a[class='ltb']").colorbox({transition:"fade", width: "660px", height: "470px", slideshow:true});
	//var ltb = $("a[class='ltb']").colorbox({rel:'ltb'});
	//var ltb = $("a[class='ltb']").colorbox({transition:"fade", slideshow:true});

	$().bind('cbox_load', function() {
		console.log($.fn.colorbox.element()[0].toString());
		$('embed').hide();
		$('object').hide();		
	});
	$().bind('cbox_closed', function() {
		$('embed').show();
		$('object').show();
	});
	
	$().bind('cbox_cleanup', function() {
	if ($.fn.colorbox.element().length) {
		var q_element = $.fn.colorbox.element()[0].toString();
		if(q_element.lastIndexOf(".php") != -1 || q_element.lastIndexOf(".html") != -1){
			var ant = confirm('Möchten Sie den Shop verlassen?');
			$.fn.colorbox.close_flag=false;
			if (!ant) {
				$.fn.colorbox.close_flag=true;
			}
		}
	 }
	});

	$("#click").click(function(){
		$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
		return false;
	});
	
});
