var bgEnabled = ("").length > 0 && "" != "false";
var sponsorEnabled  = ("").length > 0 && "" != "false";
var adDeactivated = ("true").length > 0 && "true" != "false";

var iOneGallery371917 = new SWFTag("gallery_launcher_app_371917", "http://cdn1.hellobeautiful.com/wp-content/plugins/ione-core/framework/preloader-v3.swf?ver=638ecb0", '100%', '100%', SWFTag.V10);
iOneGallery371917.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://cdn.hellobeautiful.com/wp-content/plugins/ione-gallery/resources/overlay-gallery.swf?ver=638ecb0</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">hb 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">cconhellobeautiful,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>') ;
iOneGallery371917.style =  escape('<?xml version="1.0" encoding="UTF-8"?><properties id="styles"><map id="font"><property id="url">http://cdn1.hellobeautiful.com/wp-content/plugins/ione-core/framework/fonts/Qlassik_v3.swf?ver=05272010</property></map><!-- MAIN GALLERY MODULE --><map id="navigation"><property id="up_color">#FFFFFF</property><!-- defines button up color, text color + divider --><property id="over_color">#000000</property><!-- defines button over color for all nav buttons --><property id="selected_color">#000000</property><!-- defines button selected color for thumb view page buttons --><property id="background_color">#AD0082</property><!-- navigation bg color--><property id="font">{"fontName":"Qlassik Medium", "fontSize":15}</property><!-- json notation font --><property id="text_offset">0,3</property><!-- comma separated values top, left --></map><map id="slide_display"><property id="background">http://cdn1.hellobeautiful.com/wp-content/themes/radio/styles/Hello_Beautiful/images/mediatray/default_image_background_v2.gif</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">#CCCCCC</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":"Qlassik Medium", "fontSize":11}</property><!-- json notation font --><property id="credit_text_offset">4,0</property><!-- comma separated values top, left --><!-- caption field (under photo) --><property id="caption_font">{"color":"#FFFFFF","fontName":"Qlassik Bold", "fontSize":22}</property><!-- json notation font --><property id="caption_text_offset">0,-4</property><!-- comma separated values top, left --><property id="description_font">{"color":"#FFFFFF","fontName":"Qlassik Medium", "fontSize":16}</property><!-- json notation font --><property id="description_text_offset">0,2</property><!-- comma separated values top, left --><property id="caption_background">{"color":"#292929", "alpha":0.75}</property><property id="caption_border">{"color":"#FFFFFF"}</property></map><map id="thumbnails"><property id="background_color">#e4c7fa</property><!-- thumbnail countainer background color --><property id="border_color">#CCCCCC</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">#FFFFFF</property><!-- thumbnail border upstate color --><property id="well_up_alpha">0.4</property><!-- thumbnail upstate alpha --><property id="well_border_over">#B2128D</property><!-- thumbnail border overstate color --><!-- applies to "Next Gallery" button --><property id="btn_background_color_up">#AD0082</property><!--OPTIONAL: next gallery background color --><property id="btn_background_color_over">#FFFFFF</property><!--OPTIONAL: next gallery background color --><property id="btn_border_up">#FFFFFF</property> <!-- OPTIONAL: next gallery foreground color --><property id="btn_border_over">#AD0082</property><!-- OPTIONAL: next gallery foreground over color --><property id="font">{"fontName":"Qlassik Bold", "fontSize":13}</property><!-- json notation font --><property id="text_offset">0,1</property><!-- comma separated values top, left --></map><map id="endcard"><property id="background_color">#e4c7fa</property><!-- endcard background color --><property id="border_color">#4c4949</property><!-- endcard border color --><property id="icon_fg_up">#FFFFFF</property><!-- endcard icon foreground upstate color --><property id="icon_bg_up">#AD0082</property><!-- endcard icon background upstate color --><property id="icon_fg_over">#AD0082</property><!-- endcard icon foreground overState color --><property id="icon_bg_over">#FFFFFF</property><!-- endcard icon background overState color --><property id="font">{"fontName":"Qlassik Bold", "fontSize":20}</property><!-- json notation font --><property id="text_offset">0,0</property><!-- comma separated values top, left --></map><map id="share"><property id="background_color">#AD0082</property><property id="upstate">{"iconColor":"#000000", "iconBackground":"#FFFFFF", "fontColor":"#FFFFFF" ,"fontName":"Qlassik Medium", "fontSize":26, "textOffset":"-2,0"}</property><property id="overstate">{"iconColor":"#FFFFFF", "iconBackground":"#000000", "backgroundUp":"#AD0082", "backgroundOver":"#FFFFFF", "fontColor":"#000000" ,"fontName":"Qlassik Bold", "fontSize":13}</property></map><!-- GALLERY LAUNCHER STYLE --><map id="launcher"><property id="frame">{"color":"#FFFFFF", "padding":10}</property><property id="background">#FFFFFF,#DABCF2</property><property id="border">#DBD9D9</property></map><map id="launcher_nav"><property id="background">http://cdn1.hellobeautiful.com/wp-content/themes/radio/styles/Hello_Beautiful/images/mediatray/launcher_background.gif</property><property id="button">{"background_up":"#FFFFFF","foreground_up":"#000000","background_over":"#EFE2F9","foreground_over":"#000000"}</property><property id="text">{"color":"#FFFFFF","fontName":"Qlassik Medium", "fontSize":18, "disableDropShadow":true}</property><property id="text_offset">0,-2</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":"Qlassik Medium", "fontSize":9, "padding":2}</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":"Qlassik Bold", "fontSize":28}</property><property id="caption_text_offset">0,0</property><property id="description_font">{"color":"#FFFFFF","fontName":"Qlassik Medium", "fontSize":18}</property><property id="description_text_offset">0,0</property></map><map id="launcher_title"><property id="text">{"color":"#333333","fontName":"Qlassik Medium", "fontSize":36}</property><property id="text_offset">0,-2</property><property id="background">#FFFFFF</property><property id="icon">#AE0082</property></map><!-- MORE GALLERIES MODULE --><map id="tabs"><property id="background">{"upColor":"#000000","overColor":"#FFFFFF","selectedColor":"#AD0082","border":"3"}</property><!-- up,over,selected--><property id="label">{"y":"11","x":"20","upColor":"#FFFFFF","overColor":"#000000","selectedColor":"#FFFFFF","fontFamily":"Qlassik Medium","fontSize":"20px"}</property></map><map id="panes"><property id="pane">{"backgroundColor":"#AD0082","itemSpacing":"9","margin":"11"}</property></map><map id="items"><property id="title">{"selectedColor":"#000000","upColor":"#FFFFFF","fontFamily":"Qlassik Bold","fontSize":"18px"}</property><property id="description">{"selectedColor":"#AD0082","upColor":"#FFFFFF","fontFamily":"Qlassik Medium","fontSize":"13px","leading":"1"}</property><property id="thumb">{"selectedColor":"#F7F0FD","upColor":"#F7F0FD"}</property><property id="border">{"selectedColor":"#000000","upColor":"#FFFFFF"}</property><property id="background">{"selectedColor":"#FFFFFF","upColor":"#AD0082"}</property><property id="preloader">{"color":"#000000"}</property><property id="error">{"color":"#000000"}</property></map><map id="scroller"><property id="colors">{"trackColor":"#FFFFFF","knobBgColor":"#000000","knobGripColor":"#AD0082"}</property></map></properties>') ;
iOneGallery371917.source =  "http://cdn.hellobeautiful.com/?ione-gallery-xml=371917&ione-gallery-type=live";
try{
	iOneGallery371917.source = iOneGallery371917.source.split('/')[2].split('.')[0];
} catch(e){};
try{
	if (document.referrer && document.referrer != "" ){
		iOneGallery371917.referrer = document.location.href;
	}else{
		iOneGallery371917.referrer = null;
	}
} catch(e){};
iOneGallery371917.bgColor = "#FFFFFF";
iOneGallery371917.fgColor = "#FFFFFF";
iOneGallery371917.galleryOpenCallback = "onGalleryOpen";
iOneGallery371917.galleryCloseCallback = "onGalleryClose";

iOneGallery371917.setAllowScriptAccess(SWFTag.ALWAYS);
iOneGallery371917.setAllowNetworking(SWFTag.ALL);
iOneGallery371917.setWmode(SWFTag.OPAQUE);
try{ iOneGallery371917.setBgColor(iOneGallery371917.bgColor); }catch(e){};
iOneGallery371917.addFlashVar('bgColor', iOneGallery371917.bgColor);
iOneGallery371917.addFlashVar('fgColor', iOneGallery371917.fgColor);
iOneGallery371917.addFlashVar('targetApp', 'http://cdn.hellobeautiful.com/wp-content/plugins/ione-gallery/resources/overlay-launcher-v2.swf?ver=638ecb0');
iOneGallery371917.addFlashVar('appUrl', document.location.href);
iOneGallery371917.addFlashVar('source', iOneGallery371917.source);
iOneGallery371917.addFlashVar('referrer', iOneGallery371917.referrer);
iOneGallery371917.addFlashVar('plsUrl', 'http://cdn.hellobeautiful.com/?ione-gallery-xml=371917&ione-gallery-type=live&ver=1328878517');
iOneGallery371917.addFlashVar('configData', iOneGallery371917.config);
iOneGallery371917.addFlashVar('styleData', iOneGallery371917.style);
iOneGallery371917.addFlashVar('editorEmbed', '[ione-gallery id="371917" src="http://hellobeautiful.com"]');
iOneGallery371917.addFlashVar('adDataUrl', sponsorEnabled ? AdHelper.getAdTag("adx","hb.home", "140x60", "dcmt=text/xml", "") : '');
iOneGallery371917.addFlashVar("galleryOpenCallback", iOneGallery371917.galleryOpenCallback);
iOneGallery371917.addFlashVar("galleryCloseCallback", iOneGallery371917.galleryCloseCallback);

iOneGallery371917.addFlashVars(document.location.search.substring(1));

// function to set height of launcher embed to photo size
iOneGallery371917.setMovieHeight = function(h){
	jQuery('#gallery_launcher371917').css({'height':h});
}

// overlay opener code, including gallery embed
iOneGallery371917.openOverlay = function(launcher_id, onCloseCallback){
	Logger.info('openOverlay(), launcher_id: ' + launcher_id + ", onCloseCallback: " + onCloseCallback);

	//Gallery Module
	var gallerySwf =  new SWFTag("gallery_app_371917", "http://cdn1.hellobeautiful.com/wp-content/plugins/ione-core/framework/preloader-v3.swf?ver=638ecb0", '100%', '100%', SWFTag.V10);
	try{ gallerySwf.setBgColor(iOneGallery371917.bgColor); }catch(e){};
	gallerySwf.addFlashVar("bgColor", iOneGallery371917.bgColor);
	gallerySwf.addFlashVar("fgColor", iOneGallery371917.fgColor);
	gallerySwf.addFlashVar("targetApp", "http://cdn1.hellobeautiful.com/wp-content/plugins/ione-core/framework/media-framework-v3.swf?ver=638ecb0");
	gallerySwf.addFlashVar("plsUrl", "http://cdn.hellobeautiful.com/?ione-gallery-xml=371917&ione-gallery-type=live?ver=1328878517");
	gallerySwf.addFlashVar("configData", iOneGallery371917.config);
	gallerySwf.addFlashVar("styleData", iOneGallery371917.style);
	gallerySwf.addFlashVar("pageName", document.title);
	gallerySwf.addFlashVar('appUrl', document.location.href);
	gallerySwf.addFlashVar('source', iOneGallery371917.source);
	gallerySwf.addFlashVar('referrer', iOneGallery371917.referrer);
	gallerySwf.addFlashVar('bgActive', bgEnabled);
	
	// MORE GALLERIES Module
	var moreSwf =  new SWFTag("rss_navigation_371917", "http://cdn1.hellobeautiful.com/wp-content/plugins/ione-core/framework/preloader-v3.swf?ver=638ecb0", '100%', '100%', SWFTag.V10);
	try{ moreSwf.setBgColor(iOneGallery371917.bgColor); }catch(e){};
	moreSwf.addFlashVar("bgColor", iOneGallery371917.bgColor);
	moreSwf.addFlashVar("fgColor", iOneGallery371917.fgColor);
	moreSwf.addFlashVar("playlists", "http://cdn.hellobeautiful.com/feed/?galleries=1&type=related&related-id=371917|http://cdn.hellobeautiful.com/feed/?galleries=1&type=hot&duration=60|http://cdn.hellobeautiful.com/feed/?galleries=1");
	moreSwf.addFlashVar("plsUrl", "http://cdn.hellobeautiful.com/?ione-gallery-xml=371917&ione-gallery-type=live");
	moreSwf.addFlashVar("tabs", "RELATED|HOT|RECENT");
	moreSwf.addFlashVar("configData", iOneGallery371917.config);
	moreSwf.addFlashVar("styleData", iOneGallery371917.style);
	moreSwf.addFlashVar("targetApp", "http://cdn.hellobeautiful.com/wp-content/plugins/ione-gallery/resources/more-galleries.swf?ver=638ecb0");

	// BACKGROUND LOADER Module
	var bgLoaderSwf = new SWFTag("overlay_bg_loader_flash_371917", "http://cdn.hellobeautiful.com/wp-content/plugins/ione-gallery/resources/ad-module.swf?ver=638ecb0","100%","100%", SWFTag.V10)
	bgLoaderSwf.addFlashVar("adDataUrl", bgEnabled ? AdHelper.getAdTag("adx","hb.home", "1024x576", "dcmt=text/xml", "") : "");

	// SPONSOR Module
	var sponsorSwf = new SWFTag("overlay_sponsor_flash_371917", "http://cdn.hellobeautiful.com/wp-content/plugins/ione-gallery/resources/ad-module.swf?ver=638ecb0","100%","100%", SWFTag.V10);
	sponsorSwf.addFlashVar("adDataUrl", sponsorEnabled ? AdHelper.getAdTag("adx","hb.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://cdn.hellobeautiful.com/wp-content/plugins/ione-gallery/resources/ad.php?adUrl='+escape(AdHelper.getAdTag("adj","hb.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
iOneGallery371917.addFlashVar('launchGalleryFn', 'iOneGallery371917.openOverlay');
iOneGallery371917.addFlashVar('setHeightFn', 'iOneGallery371917.setMovieHeight');

// Add parameters from page's URL as flashvars:
if(document.location.search != null && document.location.search.length > 1) {
	iOneGallery371917.addFlashVars(document.location.search);
}
// Generate markup:
iOneGallery371917.fillElementId('gallery_launcher371917');

// external launcher button
if (openGallery == null){
	var openGallery = function(){
		iOneGallery371917.openOverlay('gallery_launcher_app_371917', iOneGallery371917.galleryCloseCallback);
		jQuery('#gallery_launcher_app_371917')[0][iOneGallery371917.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_371917').after('<!-- EMBED:\r\r[ione-gallery id="371917" src="http://hellobeautiful.com"]\r\r-->');
