	var flashvars =  {xmlURL: "gallery.xml"};
	var params =  {wmode: "transparent"};
	swfobject.embedSWF("gallery.swf", "gallery", "990", "287", "9.0.0","expressInstall.swf", flashvars, params);
	
	var doubleBtn = false;
	var regularBtn = false;
	var nwBtn = false;
	var hdBtn = false;
	var ldBtn = false;
	
	var Item;
	
	var jsReady = false;
    function isReady() {
		return jsReady;
    }
	
	function passObject(obj) {
		Item = obj;
	}
	
	function showVideo() {
		doubleBtn = true;
		regularBtn = false;
		nwBtn = true;
		ldBtn = false;
		if (Item.hd_url) {
			hdBtn = true;
		} else {
			hdBtn = false;
		}
		if (Item.type == "wmp") {
			doubleBtn = false;
			regularBtn = false;
		}
		Shadowbox.open({
			player:     Item.type,
			title:      Item.title,
			content:    Item.url,
			height:     Item.height,
			width:      Item.width
		});
	}
	
	function showAudio() {
		doubleBtn = false;
		regularBtn = false;
		nwBtn = true;
		hdBtn = false;
		ldBtn = false;
		if(Item.duration) {
			Item.duration = Number(Item.duration.slice(0,Item.duration.indexOf(":"))*60)+Number(Item.duration.slice(Item.duration.indexOf(":")+1));
		} else {
			Item.duration = 0;
		}
		Shadowbox.open({
			player:     'mp3',
			title:      Item.title,
			content:    Item.url,
			height:     Item.height,
			width:      Item.width
		});
	}
	
	function showArticle() {
		doubleBtn = false;
		regularBtn = false;
		nwBtn = true;
		hdBtn = false;
		ldBtn = false;
		Shadowbox.open({
			player:     'iframe',
			title:      Item.title,
			content:    Item.url,
			height:     Item.height,
			width:      Item.width
		});
	}
	
	function doubleSize() {
		doubleBtn = false;
		regularBtn = true;
		if (Item.type == "wmp") {
			doubleBtn = false;
			regularBtn = false;
		}
		Shadowbox.open({
			player:     Shadowbox.getCurrent().player,
			title:      Item.title,
			content:    Shadowbox.getCurrent().content,
			height:     Shadowbox.getCurrent().height*2,
			width:      Shadowbox.getCurrent().width*2
		});
	}
	
	function regularSize() {
		doubleBtn = true;
		regularBtn = false;
		if (Item.type == "wmp") {
			doubleBtn = false;
			regularBtn = false;
		}
		Shadowbox.open({
			player:     Shadowbox.getCurrent().player,
			title:      Item.title,
			content:    Shadowbox.getCurrent().content,
			height:     Item.height,
			width:      Item.width
		});
	}
	
	function highDefinition() {
		doubleBtn = false;
		regularBtn = false;
		hdBtn = false;
		ldBtn = true;
		Shadowbox.open({
			player:     Item.hd_type,
			title:      Item.title,
			content:    Item.hd_url,
			height:     Item.hd_height,
			width:      Item.hd_width
		});
	}
	
	function lowDefinition() {
		doubleBtn = true;
		regularBtn = false;
		hdBtn = true;
		ldBtn = false;
		if (Item.type == "wmp") {
			doubleBtn = false;
			regularBtn = false;
		}
		Shadowbox.open({
			player:     Item.type,
			title:      Item.title,
			content:    Item.url,
			height:     Item.height,
			width:      Item.width
		});
	}
	
	var generator;
	function openNW() {
		var gen_h = Shadowbox.getCurrent().height;
		var gen_w = Shadowbox.getCurrent().width;
		generator=window.open('nenner_appearance.html','_blank','height='+(gen_h+170)+',width='+(gen_w+60)+'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no');
		Shadowbox.close();
		generator.focus();
	}
	
	function runChild() {
		//generator.Shadowbox.init();
		generator.doubleBtn = doubleBtn;
		generator.regularBtn = regularBtn;
		generator.nwBtn = false;
		generator.hdBtn = hdBtn;
		generator.ldBtn = ldBtn;
		generator.Item = Item;
		generator.Shadowbox.open({
			player:  Shadowbox.getCurrent().player,
			title:   Shadowbox.getCurrent().title,
			content: Shadowbox.getCurrent().content,
			height:  Shadowbox.getCurrent().height,
			width:   Shadowbox.getCurrent().width
		});
	}
	
	
	Shadowbox.loadSkin("classic", "js/skin");
	Shadowbox.loadPlayer(['flv', 'html', 'iframe', 'img', 'mp3', 'swf', 'wmp'], 'js/player');
	
	window.onload = function(){
		Shadowbox.init();
		jsReady = true;
	};
