//
// For ATWFF - June 17 2011
//

// DOCUMENT READY FUNCTION: uses noConflict to work with other libraries
jQuery(document).ready(function($) {

/*
sendBrochure = function()
{
var axel = Math.random() + ""; 
var a = axel * 10000000000000; 
$('#dart-wrapper').prepend('<iframe src="http://fls.doubleclick.net/activityi;src=690327;type=fvflup;cat=br;u4=Focus Amazing Race;u1=ford focus;ord=' + a + '?" width="1" height="1" frameborder="0"></iframe>');  
}
sendEmailOptIn = function()
{
var axel = Math.random() + ""; 
var a = axel * 10000000000000; 
$('#dart-wrapper').prepend('<iframe src="http://fls.doubleclick.net/activityi;src=690327;type=fvflup;cat=eopt;u4=Focus Amazing Race;u1=ford focus;ord=' + a + '?" width="1" height="1" frameborder="0"></iframe>');
}
sendSweepsEntry = function()
{
var axel = Math.random() + ""; 
var a = axel * 10000000000000; 
$('#dart-wrapper').prepend('<iframe src="http://fls.doubleclick.net/activityi;src=690327;type=fvflup;cat=se;u4=Focus Amazing Race;u1=ford focus;ord=' + a + '?" width="1" height="1" frameborder="0"></iframe>');
}
surveyTrack = function( str )
{
//var axel = Math.random() + ""; 
//var a = axel * 10000000000000; 
$('#dart_wrapper').prepend('<script type="text/javascript" src="' + str + '"></script>');
}
//On page load add this iframe
var axel = Math.random() + ""; 
var a = axel * 10000000000000; 
$('#ford-wrapper').prepend('<iframe src="http://ad.doubleclick.net/imp;v1;f;236722590;0-0;0;59346079;1|1;40733266|40751053|1;;cs=i;pc=[TPAS_ID];%3fhttp://ad.doubleclick.net/dot.gif?' + a + '" width="1" height="1" frameborder="0"></iframe>');*/

publishToFacebook = function(type) 
{
	FB.ui(
	{
		method: 'feed',
		app_id: '154917024520927',
		message: 'Message here.',
		caption: 'Whats up!',
		link:'www.cbsaroundtheworld.com',
		message:'Personal message here',
		redirect_uri:'www.cbsaroundtheworld.com'
		},
		function(response) {
		if (response && response.posts_id) {
			alert('Post was published.');
		} else {
			alert('Post was not published.');
		}
	}
	);  
	
	var url = "http://www.facebook.com/dialog/feed?app_id=154917024520927";
	url += "&link=http://www.cbsaroundtheworld.com/";
	url += "&caption=My Caption";
	url += "&description=Description of the app which is awesome";
	url += "&message=This is such an easy app!";
	url += "&redirect_uri=http://www.cbsaroundtheworld.com/";
	
	window.open( url, "Share" );
}

dwTrack = function( $str )
{
$('#dw-wrapper').prepend('<iframe src="http://dw.com.com/redir?siteid=164&onid=31783&ptid=&ttag=&mapp=atwff_3&ctype=ria;evt;objtyp;obj&cval=atwff_3;' + $str + '&ursuid=&ts=&desturl=http://img.com.com/b.gif" width="1" height="1" frameborder="0"></iframe>');
}

dartTrack = function( $str )
{
$('#dart-wrapper').prepend('<script type="text/javascript" src="' + $str + '"></script>');
}
	
});//<--- this is the end of the document ready function don't delete it
