/*************************************************************
*	File Name : 			newcampaigns.js
*	Author : 				Domenic Polsoni - (FABUmarketing.com)
*
*	Date Created :			08/05/2010
*	Date Modified :
*
*
*	Various functions for the new templated campaigns.
****************************************************************/

/*
 *	Run functions.
 */
$(doc).ready(function()
{
	// Insert hidden input field into search field so that adsense won't be output
	var inputs = doc.getElementById('cref_iframe').getElementsByTagName('input');

	for (var i = 0, j = inputs.length; i < j; i++)
	{
		if (inputs[i].getAttribute('value') === "006762764754339385982:u9cdmahr2bg")
		{
			break;
		}
		if (i === (j - 1))
		{
			var newInput = doc.createElement('input');
			newInput.setAttribute('type', 'hidden');
			newInput.setAttribute('name', 'cx');
			newInput.setAttribute('value', '006762764754339385982:u9cdmahr2bg');
			doc.getElementById('cref_iframe').appendChild(newInput);
		}
	}

	// Insert the social slide out bar at the bottom of the screen.
	//insertSocialSlideOut();
});


/*
 *	Dynamically outputs slide out social footer.  Can't use footer_ofs.inc.php
 *	because it's a separate function call and would need to be inserted into every
 *	page in the campaign.  This is the only easy way.
 */
/*
function insertSocialSlideOut()
{
	var body = doc.getElementsByTagName('body')[0];
   var divElem;

	var html = '<div id="footerSlideContent">';
   html += '<img id="footerSlideCloseButton" src="/images_2010/common/footer_slide_close_button.png" width="14" height="15" alt="Close button" title="Close the social networking bar" />';
   html += '<div id="wereSocial">';
   html += '<img src="/images_2010/common/footer_slide_social.png" width="954" height="42" alt="Social networking bar with Facebook, Twitter, newsletter, and blog" title="We\'re Social" usemap="#footer_social_bar" />';
   html += '<map name="footer_social_bar" id="footer_social_bar">';
   html += '<area id="mapFacebook" coords="389,0,495,37" alt="Like Us on Facebook" title="Like Us on Facebook" href="http://www.facebook.com/fabuloussavings" />';
   html += '<area id="mapTwitter" coords="546,1,674,37" alt="Follow us on Twitter" title="Follow us on Twitter" href="http://www.twitter.com/fabuloussavings" />';
   html += '<!-- <area id="mapNewsletter" coords="619,1,779,39" alt="Subscribe to our Coupon Newsletter" title="Subscribe to our Coupon Newsletter" href="javascript: popwin2(\'/html/mailing_list_ofs_popup.php?country_id=us\', \'\', 595, 330, \', resizable=no, status=yes, scrollbars=yes\'); return false;" /> -->';
   html += '<area id="mapBlog" coords="728,0,892,39" alt="Get Frugal with our Fabulous Blog" title="Get Frugal with our Fabulous Blog" href="http://www.fabuloussavings.com/blog/" />';
   html += '</map>';
	html += '</div>';
   html += '</div>';

	divElem = doc.createElement('div');
	divElem.setAttribute('id','footerSlideContainer');
	divElem.innerHTML = html;

	// Provides insertBefore functionality
	doc.getElementById('fsOuterFooter').parentNode.insertBefore(divElem, doc.getElementById('fsOuterFooter').nextSibling);
}
*/

