
/**************************************************************************************************************************************/
/** Following  are the wrapper functions for the Omniture calls.
/***************************************************************************************************************************************/

		var strSection = "";
		var strSubSection = "";

		/*
		This function reads the META tags. and populates the section and subsections.
		*/
		function readMetaKeywords () {
			var metaElements = document.all ? document.all.tags('META') : document.getElementsByTagName ? document.getElementsByTagName ('META') : new Array();

			for (var m = 0; m < metaElements.length; m++) {

				if (metaElements[m].name == "section") {
					strSection = metaElements[m].content;
				}
				else if (metaElements[m].name == "subsection") {
					strSubSection = metaElements[m].content;
				}
			}
		}

		/*
		This is  a helper function to calculae the Percentage of video completed.
		Input:
			nTotalVideoLegth - Number. Total length of the video.
			nCompletedVideoLength - Number. Length of the video watched by the user so far.
		Returns:
			Number. Percentage of the Video watched.
		*/
		function calculatePercentage(nTotalVideoLegth, nCompletedVideoLength) {

			//Rounding the Percentage to
			return (Math.round((nCompletedVideoLength/nTotalVideoLegth) * 10) * 10);

		}

		/*
		This function makes an Omniture call to record the Video name with
		total length and watched length of the video.
		Input:
			sVideoName - String. Name of the video.
			sVideoLink - String. URL of the video.
			nTotalVideoLegth - Number. Total length of the video.
			nCompletedVideoLength - Number. Length of the video watched by the user so far.
			sEventName - String. Event name. start/stop

		Returns:
			void.
		*/
		function trackVideo(sVideoName, sVideoLink, nTotalVideoLegth, nCompletedVideoLength, sEventName) {
			var s=s_gi(s_account);
			s.pageName = sVideoName + "_" + sEventName;
			s.pageURL = sVideoLink;
			s.prop4 = nCompletedVideoLength;
			s.prop5 = calculatePercentage(nTotalVideoLegth, nCompletedVideoLength) + "";
			void(s.t());
		}

		/*
		This function makes an Omniture call to record the flash page view.
		Input:
			lnk - Boolean. Pass "true" for all flash calls.
			pageType - String. pass "o" for all flash calls.
			pageName - String. Name/Title of the Flash Page.
		Returns:
			void.
		*/
		function trackFlashPage(lnk, pageType, pageName) {
			var s=s_gi(s_account);
			void(s.tl(lnk,pageType,pageName));
		}


