/* 
 * conversation.js
 *
 * Javascript document for use on the hpv.com website
 *
 * Rapp.com
 */

function trace(msg) {
	alert(msg);
}
function flashEvent(EventName) {
	//alert(EventName);
	
	// Spotlight Tagging
	switch(EventName) {
		case "Navigation_Start_over_click":
		case "What_canido_watch_click":
		case "Want_more_watch_convo_click":
			writeSpotlightTag("d-hom347");
			break;
		case "Navigation_What_canido_click":
		case "Video_Mess7_forward_click":
		case "Want_more_what_canido2_click":
			writeSpotlightTag("d-wha212");
			break;
		case "What_canido_bringtodoc_click":
			writeSpotlightTag("d-wci491");
			//writeSpotlightTag("d-pdf909");
			break;
		case "Want_more_exit_to_hpv_com_click":
			writeSpotlightTag("d-lin374");
			break;			
		default:
			break;
	}

	// Webtrends Tagging
	dcsMultiTrack( "DCS.dcsuri", "FLASH_" + EventName + ".exe",
                   "WT.ti",      "FLASH_" + EventName,
                   "DCS.dcsref", window.location.pathname,
                   "WT.tx_e", "",
                   "WT.tx_id", "",
                   "WT.tx_it", "",
                   "WT.tx_u", "",
                   "WT.pn_sku", "",
                   "WT.pi", "",
                   "WT.tx_s", "",
                   "DCSext.QualityIndex", "");

  }
function getWidth() {
	var x = 0;
	if (self.innerHeight) {
		x = self.innerWidth;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		x = document.documentElement.clientWidth;
	} else if (document.body) {
		x = document.body.clientWidth;
	}
	return x;
}

function getHeight() {
	var y = 0;
	if (self.innerHeight) {
		y = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		y = document.documentElement.clientHeight;
	} else if (document.body) {
		y = document.body.clientHeight;
	}
	return y;
}
function shareFact(site) {
	var SHARE_EMAIL			= 0;
	var SHARE_FACEBOOK 		= 1;
	var SHARE_TWITTER		= 2;
	var SHARE_DIGG			= 3;
	var SHARE_STUMBLE		= 4;
	var SHARE_REDDIT		= 5;
	var SHARE_TECHNO		= 6;
	var SHARE_DELICIOUS		= 7;
	
	var shareLink = window.location.href;
	var title = "The Right Conversation.";

	//alert();
				
	switch(site) {
		case SHARE_FACEBOOK:
			window.open('http://www.facebook.com/share.php?u='+encodeURIComponent(shareLink), 'facebook');
			break;			
		case SHARE_TWITTER:
			window.open('http://twitter.com/home?status=Check out this site - '+encodeURIComponent(shareLink), 'twitter');
			break;
		
		case SHARE_DIGG:
			window.open('http://digg.com/submit?url='+encodeURIComponent(shareLink)+'&topic=health', 'digg');
			break;
		case SHARE_STUMBLE:
			window.open('http://www.stumbleupon.com/submit?url='+encodeURIComponent(shareLink)+'&title='+encodeURIComponent(title), 'stumbleupon');
			break;	
		case SHARE_REDDIT:
			window.open('http://www.reddit.com/submit?url='+encodeURIComponent(shareLink)+'&title='+encodeURIComponent(title), 'reddit');
			break;	
		case SHARE_TECHNO:
			window.open('http://technorati.com/faves?add='+encodeURIComponent(shareLink), 'technorati');
			break;				
		case SHARE_DELICIOUS:
			window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent(shareLink)+'&title='+encodeURIComponent(title), 'delicious');
			break;	
		default:
			break;
	}
}
