var bgEnabled = ("").length > 0 && "" != "false";
var sponsorEnabled  = ("").length > 0 && "" != "false";
var adDeactivated = ("true").length > 0 && "true" != "false";

var iOneGallery672042 = new SWFTag("gallery_launcher_app_672042", "http://theurbandaily.com/wp-content/plugins/ione-core/framework/preloader-v3.swf?ver=4041e1c", '100%', '100%', SWFTag.V10);
iOneGallery672042.config =  escape('<?xml version="1.0" encoding="UTF-8"?><configuration type="gallery"><properties id="properties"><property id="interval">-1</property><property id="email">true</property><property id="getit">false</property><property id="fullscreen">false</property><property id="firstItemTracked">true</property><property id="ad_refresh_interval">1</property><property id="dynamic_open_char">{</property><property id="dynamic_close_char">}</property></properties><properties id="styles"><map id="skin"><property id="url">http://theurbandaily.com/wp-content/plugins/ione-gallery/resources/overlay-gallery.swf?ver=4041e1c</property></map></properties><properties id="tracking"><map id="google"><property id="url">' + impressionUrl  + 'external/google/gallery/' + impressionPostId + '/' + impressionPostSlug + '/</property></map><map id="omniture_config"><property id="movieID">ud Gallery</property><property id="charSet">UTF-8</property><property id="trackClickMap">true</property><property id="visitorNamespace">communityconnect</property><property id="trackingServer">vs.blackplanet.com</property><property id="trackingServerSecure">vss.blackplanet.com</property><property id="dc">112</property><property id="account">ccontheurbandaily,cconbpuniverse,cconcconcvs</property><property id="autoTrack">false</property></map><map id="omniture_pageview"><property id="referrer">{flashvars.referrer}</property><property id="eVar2">G:{flashvars.source}:{flashvars.appUrl}</property><property id="pageName">G:{flashvars.source}:{flashvars.appUrl}</property></map></properties></configuration>') ;
iOneGallery672042.style =  escape('<?xml version="1.0" encoding="UTF-8"?><properties id="styles"><map id="font"><property id="url">http://theurbandaily.com/wp-content/plugins/ione-core/framework/fonts/TexGyreAdventor_v3.swf?ver=05272010</property></map><!-- MAIN GALLERY MODULE --><map id="navigation"><property id="up_color">#000000</property><!-- defines button up color, text color + divider --><property id="over_color">#FFFFFF</property><!-- defines button over color for all nav buttons --><property id="selected_color">#FFFFFF</property><!-- defines button selected color for thumb view page buttons --><property id="background_color">#00A4E7</property><!-- navigation bg color--><property id="font">{"fontName":"TeX Gyre Adventor", "fontSize":13, "fontWeight":"bold"}</property><!-- json notation font --><property id="text_offset">0,-2</property><!-- comma separated values top, left --></map><map id="slide_display"><property id="background">http://theurbandaily.com/wp-content/themes/radio/styles/The_Urban_Daily/images/mediatray/default_image_background.png</property><!-- background for photo well.  if it"s a url, it loads the image. if it"s a color, it colors the background.  two colors give a linear gradient --><property id="border_color">#151616</property><!-- OPTIONAL - border around the photo well --><property id="preloader_color">#000000</property><property id="error_color">#000000</property><!-- credit field --><property id="credit_font">{"color":"#8B8B8B","fontName":"TeX Gyre Adventor", "fontSize":10}</property><!-- json notation font --><property id="credit_text_offset">-2,0</property><!-- comma separated values top, left --><!-- caption field (under photo) --><property id="caption_font">{"color":"#FFFFFF","fontName":"TeX Gyre Adventor", "fontWeight":"bold", "fontSize":19}</property><!-- json notation font --><property id="caption_text_offset">0,-8</property><!-- comma separated values top, left --><property id="description_font">{"color":"#FFFFFF","fontName":"TeX Gyre Adventor", "fontSize":15}</property><!-- json notation font --><property id="description_text_offset">0,-4</property><!-- comma separated values top, left --><property id="caption_background">{"color":"#292929", "alpha":0.75}</property><property id="caption_border">{"color":"#3A3A3A"}</property></map><map id="thumbnails"><property id="background_color">#000000</property><!-- thumbnail countainer background color --><property id="border_color">#4C4949</property><!-- thumbnail container border color --><property id="preloader_color">#FFFFFF</property><property id="error_color">#FFFFFF</property><!-- thumbnail photo wells --><property id="well_border_up">#00A4E7</property><!-- thumbnail border upstate color --><property id="well_up_alpha">0.4</property><!-- thumbnail upstate alpha --><property id="well_border_over">#FFFFFF</property><!-- thumbnail border overstate color --><!-- applies to "Next Gallery" button --><property id="btn_background_color_up">#000000</property><!--OPTIONAL: next gallery background color --><property id="btn_background_color_over">#000000</property><!--OPTIONAL: next gallery background color --><property id="btn_border_up">#00A4E7</property> <!-- OPTIONAL: next gallery foreground color --><property id="btn_border_over">#FFFFFF</property><!-- OPTIONAL: next gallery foreground over color --><property id="font">{"fontName":"TeX Gyre Adventor", "fontWeight":"bold", "fontSize":12}</property><!-- json notation font --><property id="text_offset">0,-3</property><!-- comma separated values top, left --></map><map id="endcard"><property id="background_color">#000000</property><!-- endcard background color --><property id="border_color">#4C4949</property><!-- endcard border color --><property id="icon_fg_up">#00A4E7</property><!-- endcard icon foreground upstate color --><property id="icon_bg_up">#000000</property><!-- endcard icon background upstate color --><property id="icon_fg_over">#FFFFFF</property><!-- endcard icon foreground overState color --><property id="icon_bg_over">#000000</property><!-- endcard icon background overState color --><property id="font">{"fontName":"TeX Gyre Adventor", "fontWeight":"bold", "fontSize":16}</property><!-- json notation font --><property id="text_offset">0,-4</property><!-- comma separated values top, left --></map><map id="share"><property id="background_color">#00A4E7</property><property id="upstate">{"iconColor":"#FFFFFF", "iconBackground":"#000000", "fontColor":"#FFFFFF" ,"fontName":"TeX Gyre Adventor", "fontWeight":"bold", "fontSize":18, "textOffset":"-6,0"}</property><property id="overstate">{"iconColor":"#FFFFFF", "iconBackground":"#000000", "backgroundUp":"#00A4E7", "backgroundOver":"#FFFFFF",  "fontWeight":"bold","fontColor":"#000000" ,"fontName":"TeX Gyre Adventor", "fontSize":11, "textOffset":"0,-5"}</property></map><!-- GALLERY LAUNCHER STYLE --><map id="launcher"><property id="frame">{"color":"#FFFFFF", "padding":10}</property><property id="background">#FFFFFF,#333333</property><property id="border">#888888</property></map><map id="launcher_nav"><property id="background">http://theurbandaily.com/wp-content/themes/radio/styles/The_Urban_Daily/images/mediatray/launcher_background.gif</property><property id="button">{"background_up":"#00A4E7","foreground_up":"#FFFFFF","background_over":"#E8EB00","foreground_over":"#000000", "disableEffects":true}</property><property id="text">{"color":"#FFFFFF","fontName":"TeX Gyre Adventor", "fontSize":18, "disableDropShadow":true}</property><property id="text_offset">0,-8</property><property id="sponsor_border">{"up_color":"#FFFFFF","over_color":"#DABCF2", "width":1}</property></map><map id="launcher_main_photo"><property id="credit">{"color":"#000000","fontName":"TeX Gyre Adventor", "fontSize":8, "padding":4}</property><property id="caption_background">{"color":"#292929", "alpha":0.75}</property><property id="caption_border">{"color":"#FFFFFF"}</property><property id="caption_font">{"color":"#FFFFFF","fontName":"TeX Gyre Adventor", "fontWeight":"bold", "fontSize":24}</property><property id="caption_text_offset">0,-7</property><property id="description_font">{"color":"#FFFFFF","fontName":"TeX Gyre Adventor", "fontSize":18}</property><property id="description_text_offset">0,-6</property></map><map id="launcher_title"><property id="text">{"color":"#333333","fontName":"TeX Gyre Adventor", "fontSize":32}</property><property id="text_offset">0,-10</property><property id="background">#FFFFFF</property><property id="icon">#00A4E7</property></map><!-- MORE GALLERIES MODULE --><map id="tabs"><property id="background">{"upColor":"#00A4E7","overColor":"#ffffff","selectedColor":"#202020","border":"3"}</property><!-- up,over,selected--><property id="label">{"y":"2","x":"15","upColor":"#000000","overColor":"#000000","selectedColor":"#FFFFFF","fontFamily":"TeX Gyre Adventor","fontWeight":"bold","fontSize":"19px"}</property></map><map id="panes"><property id="pane">{"backgroundColor":"#202020","itemSpacing":"7","margin":"5"}</property></map><map id="items"><property id="title">{"selectedColor":"#000000","upColor":"#00A4E7","fontFamily":"TeX Gyre Adventor","fontWeight":"bold","fontSize":"14px"}</property><property id="description">{"selectedColor":"#000000","upColor":"#ffffff","fontFamily":"TeX Gyre Adventor","fontWeight":"regular","fontSize":"12px","leading":"2"}</property><property id="thumb">{"selectedColor":"#ffffff","upColor":"#ffffff"}</property><property id="border">{"selectedColor":"#000000","upColor":"#FFFFFF"}</property><property id="background">{"selectedColor":"#00A4E7","upColor":"#202020"}</property><property id="preloader">{"color":"#202020"}</property><property id="error">{"color":"#202020"}</property></map><map id="scroller"><property id="colors">{"trackColor":"#000000","knobBgColor":"#00A4E7","knobGripColor":"#00184C"}</property></map></properties>') ;
iOneGallery672042.source =  "http://cdn.theurbandaily.com/?ione-gallery-xml=672042&ione-gallery-type=live";
try{
	iOneGallery672042.source = iOneGallery672042.source.split('/')[2].split('.')[0];
} catch(e){};
try{
	if (document.referrer && document.referrer != "" ){
		iOneGallery672042.referrer = document.location.href;
	}else{
		iOneGallery672042.referrer = null;
	}
} catch(e){};
iOneGallery672042.bgColor = "#ffffff";
iOneGallery672042.fgColor = "#00A4E7";
iOneGallery672042.galleryOpenCallback = "onGalleryOpen";
iOneGallery672042.galleryCloseCallback = "onGalleryClose";

iOneGallery672042.setAllowScriptAccess(SWFTag.ALWAYS);
iOneGallery672042.setAllowNetworking(SWFTag.ALL);
iOneGallery672042.setWmode(SWFTag.OPAQUE);
try{ iOneGallery672042.setBgColor(iOneGallery672042.bgColor); }catch(e){};
iOneGallery672042.addFlashVar('bgColor', iOneGallery672042.bgColor);
iOneGallery672042.addFlashVar('fgColor', iOneGallery672042.fgColor);
iOneGallery672042.addFlashVar('targetApp', 'http://theurbandaily.com/wp-content/plugins/ione-gallery/resources/overlay-launcher-v2.swf?ver=4041e1c');
iOneGallery672042.addFlashVar('appUrl', document.location.href);
iOneGallery672042.addFlashVar('source', iOneGallery672042.source);
iOneGallery672042.addFlashVar('referrer', iOneGallery672042.referrer);
iOneGallery672042.addFlashVar('plsUrl', 'http://cdn.theurbandaily.com/?ione-gallery-xml=672042&ione-gallery-type=live&ver=1329123986');
iOneGallery672042.addFlashVar('configData', iOneGallery672042.config);
iOneGallery672042.addFlashVar('styleData', iOneGallery672042.style);
iOneGallery672042.addFlashVar('editorEmbed', '[ione-gallery id="672042" src="http://theurbandaily.com"]');
iOneGallery672042.addFlashVar('adDataUrl', sponsorEnabled ? AdHelper.getAdTag("adx","ud.home", "140x60", "dcmt=text/xml", "") : '');
iOneGallery672042.addFlashVar("galleryOpenCallback", iOneGallery672042.galleryOpenCallback);
iOneGallery672042.addFlashVar("galleryCloseCallback", iOneGallery672042.galleryCloseCallback);

iOneGallery672042.addFlashVars(document.location.search.substring(1));

// function to set height of launcher embed to photo size
iOneGallery672042.setMovieHeight = function(h){
	jQuery('#gallery_launcher672042').css({'height':h});
}

// overlay opener code, including gallery embed
iOneGallery672042.openOverlay = function(launcher_id, onCloseCallback){
	Logger.info('openOverlay(), launcher_id: ' + launcher_id + ", onCloseCallback: " + onCloseCallback);

	//Gallery Module
	var gallerySwf =  new SWFTag("gallery_app_672042", "http://theurbandaily.com/wp-content/plugins/ione-core/framework/preloader-v3.swf?ver=4041e1c", '100%', '100%', SWFTag.V10);
	try{ gallerySwf.setBgColor(iOneGallery672042.bgColor); }catch(e){};
	gallerySwf.addFlashVar("bgColor", iOneGallery672042.bgColor);
	gallerySwf.addFlashVar("fgColor", iOneGallery672042.fgColor);
	gallerySwf.addFlashVar("targetApp", "http://theurbandaily.com/wp-content/plugins/ione-core/framework/media-framework-v3.swf?ver=4041e1c");
	gallerySwf.addFlashVar("plsUrl", "http://cdn.theurbandaily.com/?ione-gallery-xml=672042&ione-gallery-type=live?ver=1329123986");
	gallerySwf.addFlashVar("configData", iOneGallery672042.config);
	gallerySwf.addFlashVar("styleData", iOneGallery672042.style);
	gallerySwf.addFlashVar("pageName", document.title);
	gallerySwf.addFlashVar('appUrl', document.location.href);
	gallerySwf.addFlashVar('source', iOneGallery672042.source);
	gallerySwf.addFlashVar('referrer', iOneGallery672042.referrer);
	gallerySwf.addFlashVar('bgActive', bgEnabled);
	
	// MORE GALLERIES Module
	var moreSwf =  new SWFTag("rss_navigation_672042", "http://theurbandaily.com/wp-content/plugins/ione-core/framework/preloader-v3.swf?ver=4041e1c", '100%', '100%', SWFTag.V10);
	try{ moreSwf.setBgColor(iOneGallery672042.bgColor); }catch(e){};
	moreSwf.addFlashVar("bgColor", iOneGallery672042.bgColor);
	moreSwf.addFlashVar("fgColor", iOneGallery672042.fgColor);
	moreSwf.addFlashVar("playlists", "http://cdn.theurbandaily.com/feed/?galleries=1&type=related&related-id=672042|http://cdn.theurbandaily.com/feed/?galleries=1&type=hot&duration=60|http://cdn.theurbandaily.com/feed/?galleries=1");
	moreSwf.addFlashVar("plsUrl", "http://cdn.theurbandaily.com/?ione-gallery-xml=672042&ione-gallery-type=live");
	moreSwf.addFlashVar("tabs", "RELATED|HOT|RECENT");
	moreSwf.addFlashVar("configData", iOneGallery672042.config);
	moreSwf.addFlashVar("styleData", iOneGallery672042.style);
	moreSwf.addFlashVar("targetApp", "http://theurbandaily.com/wp-content/plugins/ione-gallery/resources/more-galleries.swf?ver=4041e1c");

	// BACKGROUND LOADER Module
	var bgLoaderSwf = new SWFTag("overlay_bg_loader_flash_672042", "http://theurbandaily.com/wp-content/plugins/ione-gallery/resources/ad-module.swf?ver=4041e1c","100%","100%", SWFTag.V10)
	bgLoaderSwf.addFlashVar("adDataUrl", bgEnabled ? AdHelper.getAdTag("adx","ud.home", "1024x576", "dcmt=text/xml", "") : "");

	// SPONSOR Module
	var sponsorSwf = new SWFTag("overlay_sponsor_flash_672042", "http://theurbandaily.com/wp-content/plugins/ione-gallery/resources/ad-module.swf?ver=4041e1c","100%","100%", SWFTag.V10);
	sponsorSwf.addFlashVar("adDataUrl", sponsorEnabled ? AdHelper.getAdTag("adx","ud.home", "140x60", "dcmt=text/xml", "") : "");

	var params = {
		onCloseCallback:onCloseCallback,
		galleryModule_params:{
			swf:gallerySwf
		},
		moreContentModule_params:{
			swf:moreSwf
		},
		sponsorModule_params:{
			swf:sponsorSwf
		},
		adModule_params:{
			adFrameSrc:'http://theurbandaily.com/wp-content/plugins/ione-gallery/resources/ad.php?adUrl='+escape(AdHelper.getAdTag("adj","ud.home","300x250", "", ""))
		},
		bgLoaderModule_params:{
			swf:bgLoaderSwf
		}
	}
	if (bgEnabled){
		if (adDeactivated) params.modules = ['galleryModule','bgLoaderModule','sponsorModule','moreContentModule'];
		else params.modules = ['galleryModule','bgLoaderModule','sponsorModule','moreContentModule','adModule'];
	}
	MediaTrayFactory.getTray(launcher_id, params).open(onCloseCallback);
}

// JS Callbacks
iOneGallery672042.addFlashVar('launchGalleryFn', 'iOneGallery672042.openOverlay');
iOneGallery672042.addFlashVar('setHeightFn', 'iOneGallery672042.setMovieHeight');

// Add parameters from page's URL as flashvars:
if(document.location.search != null && document.location.search.length > 1) {
	iOneGallery672042.addFlashVars(document.location.search);
}
// Generate markup:
iOneGallery672042.fillElementId('gallery_launcher672042');

// external launcher button
if (openGallery == null){
	var openGallery = function(){
		iOneGallery672042.openOverlay('gallery_launcher_app_672042', iOneGallery672042.galleryCloseCallback);
		jQuery('#gallery_launcher_app_672042')[0][iOneGallery672042.galleryOpenCallback]();
	}
}

if (jQuery('#gallery_open_button').length < 1){
	var launchButton = jQuery('<a id="gallery_open_button" href="javascript:openGallery();" title="View Photos">View Photos</a><div class="clear"></div>');
	var title = jQuery('.compact_post_head');
	title.after(launchButton);
}
jQuery('#gallery_672042').after('<!-- EMBED:\r\r[ione-gallery id="672042" src="http://theurbandaily.com"]\r\r-->');
