var n__bannerSource = '';n__bannerSource = '/static/images/widget/banners/general/850x250_frankie_zebrawood_champagne.jpg';var n__isMobile = false;n__isMobile = false;
function n__addEventListener( n__element, n__event_name, n__observer, n__capturing )
{
	if ( n__element.addEventListener )  // the DOM2, W3C way
		{  n__element.addEventListener( n__event_name, n__observer, n__capturing );  }
	else if ( n__element.attachEvent )  // the IE way
		{  n__element.attachEvent( "on" + n__event_name, n__observer );  }
}
function n__urlEncodeString(n__stringToDo)
{
	//parse what was sent as a string
	n__stringToDo = String(n__stringToDo);

	//first convert common MS characters...blah
	n__stringToDo = n__stringToDo.replace(/\u2018|\u2019|\u201e/gi, "'"). //single quote
								  replace(/\u201c|\u201d|\u201a/gi, '"'). //double quote
								  replace(/\u2026/gi, '...'). //triple dots
								  replace(/\u2022/gi, '*'). //bullet
								  replace(/\u2013/gi, '-'). //endash
								  replace(/\u2014/gi, '--'). //emdash
								  replace(/\u02dc/gi, '~'). //tilde
								  replace(/\u2122/gi, '(TM)'); //trademark

	if(window.encodeURIComponent)
	{
		n__stringToDo = encodeURIComponent(n__stringToDo); //does not encode ~!*()'
		n__stringToDo = n__stringToDo.replace(/\~/gi, "%7E").//encodeURIComponent does not handle @*/+
									  replace(/\!/gi, "%21").
									  replace(/\*/gi, "%2A").
									  replace(/\(/gi, "%28").
									  replace(/\)/gi, "%29").
									  replace(/\'/gi, "%27");
	}
	else
	{
		n__stringToDo = escape(n__stringToDo); //first url encode it
		n__stringToDo = n__stringToDo.replace(/\+/gi, "%2b").//escape does not handle @*/+
									  replace(/\//gi, "%2F").
									  replace(/\*/gi, "%2A").
									  replace(/\@/gi, "%40");
	}
	return n__stringToDo;
}

function n__getJordFootprintImage(n__campaignSlug)
{
	//fire jord buyer footprint request
	var n__param = '?noCache=' + (new Date()).getTime();
		n__param += "&href="+n__urlEncodeString(window.location.href);
		n__param += "&campaignSlug="+n__urlEncodeString(n__campaignSlug);
		n__param += "&referrer=";
		n__param += "&widget=1";
		n__param += "&mode=javascript";

		try
		{
			if(typeof localStorage.buyerId != 'undefined' && localStorage.buyerId != "")
			{
				n__param += "&buyerId="+n__urlEncodeString(localStorage.buyerId);
			}
		}catch(err){}

	var n__jordFootprintImage = document.createElement('img');

	n__jordFootprintImage.src = "//www.jord.co/requests/request.buyerFootprint.php" + n__param;
	n__jordFootprintImage.style.textDecoration = "none";
	n__jordFootprintImage.style.border = "none";
	n__jordFootprintImage.style.padding = "0px";
	n__jordFootprintImage.style.margin = "0px";
	n__jordFootprintImage.style.lineHeight = "0px";
	n__jordFootprintImage.style.height = "0px";
	n__jordFootprintImage.style.width = "0px";
	try {n__jordFootprintImage.style.maxWidth = "none";} catch(err){}
	try {n__jordFootprintImage.style.minWidth = "none";} catch(err){}
	try {n__jordFootprintImage.style.maxHeight = "none";} catch(err){}
	try {n__jordFootprintImage.style.minHeight = "none";} catch(err){}

	return n__jordFootprintImage;
}
function n__getGoogleImage()
{
	var n__googleImage = document.createElement('img');

	n__googleImage.src = "//googleads.g.doubleclick.net/pagead/viewthroughconversion/974227349/?value=0&label=UB3lCK-ckGQQlY_G0AM&guid=ON&script=0";
	n__googleImage.style.textDecoration = "none";
	n__googleImage.style.border = "none";
	n__googleImage.style.padding = "0px";
	n__googleImage.style.margin = "0px";
	n__googleImage.style.lineHeight = "0px";
	n__googleImage.style.height = "0px";
	n__googleImage.style.width = "0px";
	try {n__googleImage.style.maxWidth = "none";} catch(err){}
	try {n__googleImage.style.minWidth = "none";} catch(err){}
	try {n__googleImage.style.maxHeight = "none";} catch(err){}
	try {n__googleImage.style.minHeight = "none";} catch(err){}

	return n__googleImage;
}

function n__getFacebookImage()
{
	var n__facebookImage = document.createElement('img');

			n__facebookImage.src = "https://www.facebook.com/tr?id=872142092827065&ev=PixelInitialized";
	
	n__facebookImage.style.textDecoration = "none";
	n__facebookImage.style.border = "none";
	n__facebookImage.style.padding = "0px";
	n__facebookImage.style.margin = "0px";
	n__facebookImage.style.lineHeight = "0px";
	n__facebookImage.style.height = "0px";
	n__facebookImage.style.width = "0px";
	try {n__facebookImage.style.maxWidth = "none";} catch(err){}
	try {n__facebookImage.style.minWidth = "none";} catch(err){}
	try {n__facebookImage.style.maxHeight = "none";} catch(err){}
	try {n__facebookImage.style.minHeight = "none";} catch(err){}

	return n__facebookImage;
}

var n__woodWatchesStaticWidget =
{
	n__widgetSlug : "elizabethskitchendiary",
	n__widgetMaxWidth : 850,
	n__widgetMaxHeight : 250,

	n__divWrap : null,
	n__image : document.createElement('img'),
	n__jordFootprintImage : null,
	n__googleImage : null,
	n__facebookImage : null,

	n__init : function()
	{

		//add request
		try
		{
			var js = document.createElement('script');
				js.type = 'text/javascript';
				js.async = true;
				js.id = 'AddShoppers';
				js.src = ('https:' == document.location.protocol ? 'https://shop.pe/widget/' : 'http://cdn.shop.pe/widget/') + 'widget_async.js#5c617b5be694aa2b48dc869a';
				document.getElementsByTagName("head")[0].appendChild(js);
		}catch(err){}

		try
		{
							this.n__divWrap = document.getElementById("woodwatches_com_widget_article");
			

			//main image
				this.n__image.src = n__bannerSource;

				//hidden image
				try
				{
					if(parseInt(this.n__mainDiv.getAttribute('ishidden')) == 1)
					{
						this.n__image.src = "";
						this.n__image.style.display = "none";
					}
				}catch(err){}

				this.n__image.style.textDecoration = "none";
				this.n__image.style.border = "none";
				this.n__image.style.padding = "0px";
				this.n__image.style.margin = "0px";
				this.n__image.style.fontSize = "0px";
				this.n__image.style.lineHeight = "0px";
				this.n__image.style.maxWidth = "none";
				try {this.n__image.style.minWidth = "none";}catch(err){}
				try {this.n__image.style.maxHeight = "none";}catch(err){}
				try {this.n__image.style.minHeight = "none";}catch(err){}
				try {this.n__image.style.width = "100%";}catch(err){}

			//main div wrap
				this.n__divWrap.style.overflow = 'hidden';
				this.n__divWrap.style.display = 'block';
				this.n__divWrap.style.cursor = 'pointer';
				this.n__divWrap.style.textDecoration = "none";
				this.n__divWrap.style.border = "none";
				this.n__divWrap.style.padding = "0px";
				this.n__divWrap.style.margin = "0px";
				this.n__divWrap.style.fontSize = "0px";
				this.n__divWrap.style.lineHeight = "0px";
				this.n__divWrap.style.width = '100%';
				this.n__divWrap.style.height = '100%';
				try {this.n__divWrap.style.maxWidth = this.n__widgetMaxWidth + 'px';}catch(err){};
				try {this.n__divWrap.style.minWidth = "none";}catch(err){};
				try {this.n__divWrap.style.maxHeight = this.n__widgetMaxHeight + 'px';}catch(err){};
				try {this.n__divWrap.style.minHeight = "none";}catch(err){};
				this.n__divWrap.target = "_blank";

				//if tag name
				if(this.n__divWrap.tagName == "A" || this.n__divWrap.tagName == "a")
				{
					this.n__divWrap.href = "https://www.jord.co#elizabethskitchendiary";
				}
				else
				{
					this.n__divWrap.onclick = function()
					{
						window.location.href = "https://www.jord.co#elizabethskitchendiary";
						return false;
					}
				}
				this.n__divWrap.appendChild(this.n__image);

			//hiding image
			try
			{
				if(parseInt(this.n__divWrap.getAttribute('ishidden')) == 1)
				{
					this.n__image.style.display = 'none';

					try {this.n__divWrap.style.maxWidth = "1px";}catch(err){};
					try {this.n__divWrap.style.minWidth = "1px";}catch(err){};
					try {this.n__divWrap.style.maxHeight = "1px";}catch(err){};
					try {this.n__divWrap.style.minHeight = "1px";}catch(err){};
					this.n__divWrap.style.height = '1px';
					this.n__divWrap.style.width = '1px';
					this.n__divWrap.style.visibility = 'hidden';
				}
			}catch(err){}


			//google image
				this.n__googleImage = n__getGoogleImage();
				this.n__divWrap.appendChild(this.n__googleImage);

			//facebook image
				this.n__facebookImage = n__getFacebookImage();
				this.n__divWrap.appendChild(this.n__facebookImage);

			//jord buyer footprint image
				this.n__jordFootprintImage = n__getJordFootprintImage(this.n__widgetSlug);
				this.n__divWrap.appendChild(this.n__jordFootprintImage);


		}catch(err){};
	}
};

n__woodWatchesStaticWidget.n__init();
