var whitelist = [3219, 3220, 3222, 3223, 3224,
	3227, 3228, 3231, 3232, 3233, 3234, 3235, 3236,
	3238, 3240, 3241, 3242, 3244, 3245, 3246, 3247, 3248];

(function() {
 	var list = whitelist;
	whitelist = {};
 	for (var i = 0; i < list.length; ++i)
		whitelist[list[i].toString()] = true;
 })();

function mobileShare(nid) {
	if (!(nid in whitelist)) nid = "TBD";
	doPopup('/2010taurus/send2mobile/?nid='+nid, 'mobile', 688, 260, function() { mContentActivity('fv:2010taurus:reveal:mobile'); });
}

function linkFullArticle(article) {
	//alert(article);
}

var popup = {};

function doPopup(url, name, width, height, metrics) {
	var isPrivacy = false;
		
	if ((url.indexOf("privacy") > 0) && (url.indexOf("california") < 0)) // need to set a vertical scrollbar on on privacy policy pop-up (VERY LONG)
		isPrivacy = true;
		
	if (typeof metrics === 'function') metrics();
	if (!width) width = screen.availWidth;
	if (!height) height = screen.availHeight;
	if (!name) name = 'popup';
	if (!url) return;

	var leftX = (1024 - width) / 2;
	var topY = (768 - height) / 2;
	if (screen && screen.availWidth && screen.availHeight) {
		leftX = (screen.availWidth - width) / 2;
		topY = (screen.availHeight - height) / 2;
	}
	if (leftX < 0) leftX = 0;
	if (topY < 0) topY = 0;
	if (window.opera) topY = 2 * topY / 3;

	if (!(name in popup) || popup[name].closed)
	
		if (isPrivacy == true) { // setting a scrollbar on privacy policy pop-up
			popup[name] = open(url, name, 'width=' + width +
				',height=' + height + ',left=' + leftX + ',top=' + topY + ',scrollbars=yes');
		} else {
			popup[name] = open(url, name, 'width=' + width +
				',height=' + height + ',left=' + leftX + ',top=' + topY);
		}
	if (window.focus) popup[name].focus();
}

function extLink(code) {
	switch (code) {
		case 'ford':
			open('http://www.fordvehicles.com/', 'fordvehicles');
			break;
		case 'mediaKit':
			doPopup('/2010taurus/mediakit/', 'mediaKit', 600, 274);
			break;
		case 'tellFriend':
			doPopup('/2010taurus/tellafriend/', 'friend', 600, 674, function() { mContentActivity('fv:2010taurus:reveal:share'); });
			break;
		case 'signUpdate':
			doPopup('/2010taurus/updates/', 'update', 600, 674, function() { mContentActivity('fv:2010taurus:reveal:signup'); });
			break;
		case 'siteFeedback':
			O_LC();
			break;
		case 'policy':
			doPopup('http://www.fordvehicles.com/help/privacy/', 'fordvehicles', 800);
			break;
		case 'policyCA':
			doPopup('http://www.fordvehicles.com/help/privacy/california/', 'fordvehicles', 800);
			break;
		case 'brochure':
			window.open('/assets/modules/2010taurus/pdf/2010_Taurus_PkgGuide.pdf', 'tauruspdf'); function() { mContentActivity('tauruspdf'); }
			break;
	}
}

function popOutside2(link, confirmFlag) {
	if(confirmFlag != null){
		if(confirm("You are linking to a non-Ford website. Your browsing and interaction are subject to the rules and policies of that site. Please read over the site’s rules and policies before proceeding.")){
			window.open(link,'windowName','width=750,height=555, status=1,scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1');
		}
	}
	else{
		window.open(link,'windowName','width=750,height=555, status=1,scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1');
	}
}

