var __doc__;
var __frm__;
var isFlashPresent = null;	
var isWMPPresent = null;
var isQTPresent = null;	
var isToolTipValue;
var clipsCnt=0;	
var objSpanType; // For Span Type
var intPref; // For Preference
var strASFPrevPath; // For ASF Preview Path
var strQTPrevPath; // For QT Preview Path
var strFLASHPrevPath; // For Flash Preview Path
var strFlashFileName;
var strFlashStreamingIP;
var strAudioPrevPath // For Audio Preview Path
var strThumbPath; // For Thumb image Path
var strAssetType; // For Asset Type
var strVirtualFlashPath;
var strEmbedObject = "NonFlash"; // Get the Embed Object id
var PrevLayerWidth = 800;
var PrevLayerXPos;
var PrevLayerYPos;
var maxw;
var maxh;
var clickedAssetID;





//Start -- SR 9.10 -- Brenton
function openDivLocation()
{
	var x = document.body.scrollTop;	
	document.getElementById("divAssetDownload").style.top = x + 150;
	//document.getElementById("divAssetDownload").style.left = document.body.clientHeight / 2;
}
//End -- SR 9.10 -- Brenton


/********************************************************************************************
   Description: 1)Callback function used to get details based on the Asset id's.
   
   Parameters:  1)strAssetId  : Asset id.
*********************************************************************************************/ 
function AssetDownloadLayer_GetAssetValue_Asset_Control(strAssetId)
{
	clickedAssetID = strAssetId;
	if (txtFirstLogin == 'NONLOGIN')
	{
		if (txtPrevAccessRestriction == 'true')
		{
			var objAsset = returnControlId('AssetDownloadLayer_ascx') + '_' + 'AssetCallback';
			eval(objAsset).Callback(strAssetId);
		}
		else
		{
			var strCLogin = getCookie('TNMLogin');
			if(strCLogin != null)
			{
				var objAsset = returnControlId('AssetDownloadLayer_ascx') + '_' + 'AssetCallback';
				eval(objAsset).Callback(strAssetId);
			}
		}
	}
	else
	{
		var objAsset = returnControlId('AssetDownloadLayer_ascx') + '_' + 'AssetCallback';
		eval(objAsset).Callback(strAssetId);
	}

}

/********************************************************************************************
   Description: 1)Callback function used to get details based on the Asset id's.
   
   Parameters:  1)strAssetId  : Asset id.
*********************************************************************************************/ 


function AssetdownloadLayer_GetAssetValues(strAssetId,strAssetType)
{

clickedAssetID = strAssetId;
	if (txtFirstLogin == 'NONLOGIN')
	{
		if (txtPrevAccessRestriction == 'true')
		{
			var objAsset = returnControlId('AssetDownloadLayer_ascx') + '_' + 'AssetCallback';
			eval(objAsset).Callback(strAssetId,strAssetType);
		}
		else
		{
			var strCLogin = getCookie('TNMLogin');
			if(strCLogin != null)
			{
				var objAsset = returnControlId('AssetDownloadLayer_ascx') + '_' + 'AssetCallback';
				eval(objAsset).Callback(strAssetId,strAssetType);
			}
		}
	}
	else
	{
		var objAsset = returnControlId('AssetDownloadLayer_ascx') + '_' + 'AssetCallback';
		eval(objAsset).Callback(strAssetId,strAssetType);
	}
}



function AssetdownloadLayer_GetAssetValue(strAssetId)
{

clickedAssetID = strAssetId;
	if (txtFirstLogin == 'NONLOGIN')
	{
		if (txtPrevAccessRestriction == 'true')
		{
			var objAsset = returnControlId('AssetDownloadLayer_ascx') + '_' + 'AssetCallback';
			eval(objAsset).Callback(strAssetId);
		}
		else
		{
			var strCLogin = getCookie('TNMLogin');
			if(strCLogin != null)
			{
				var objAsset = returnControlId('AssetDownloadLayer_ascx') + '_' + 'AssetCallback';
				eval(objAsset).Callback(strAssetId);
			}
		}
	}
	else
	{
		var objAsset = returnControlId('AssetDownloadLayer_ascx') + '_' + 'AssetCallback';
		
		eval(objAsset).Callback(strAssetId);
	}
}

/********************************************************************************************
	SR9.10

   Description: 1)Function used to expand the download layer
*********************************************************************************************/
function AssetDownloadLayer_expandAssetDownload()
{
	if (txtFirstLogin == 'NONLOGIN')
	{
		if (txtPrevAccessRestriction == 'true' && IsNonloginPreviewEnabled())
		{
			try{hideErrPageDiv();}catch(ex){}
			blnAssetPreviewFlag = true;
			var objspnPrev = $('spnPrev');
			var objspnNext = $('spnNext');
			var objdivBottomDash = $('divBottomDash');
			objspnNext.style.display = 'none';
			objspnPrev.style.display = 'none';
			objdivBottomDash.style.display = 'none';
			objspnNext.style.visibility = 'hidden';
			objspnPrev.style.visibility = 'hidden';
			var objDivExpandContents = $('divAssetDownload');
			objDivExpandContents.style.display = 'block';
			objDivExpandContents.style.visibility = 'visible';
				
		}
		else
		{
			var strCLogin = 0;
			strCLogin = getCookie('TNMLogin');
			if (strCLogin == null)
			{
				strCLogin = 0;
			}
			if(strCLogin != 0)
			{
				
				try{hideErrPageDiv();}catch(ex){}
				blnAssetPreviewFlag = true;
				var objspnPrev = $('spnPrev');
				var objspnNext = $('spnNext');
				var objdivBottomDash = $('divBottomDash');
				objspnNext.style.display = 'none';
				objspnPrev.style.display = 'none';
				objdivBottomDash.style.display = 'none';
				objspnNext.style.visibility = 'hidden';
				objspnPrev.style.visibility = 'hidden';
				var objDivExpandContents = $('divAssetDownload');
				objDivExpandContents.style.display = 'block';
				objDivExpandContents.style.visibility = 'visible';
				//omnitureFlag=true;
				//omnitureJsCode('APL');
				//s.pageName="The NewsMarket : Asset Preview";
			}
			else
			{
				try{hideErrPageDiv();}catch(ex){}	
				blnAssetPreviewFlag = false;
				var objDivExpandContents = $('divAssetDownload');
				objDivExpandContents.style.display = 'none';
				objDivExpandContents.style.visibility = 'hidden';
				$(returnControlId('MastHeadHome_ascx') + '_' + 'hdRegistrationFlag').value="CPREVIEW";
			}				
		}
	}
	else
	{
		try{hideErrPageDiv();}catch(ex){}
		blnAssetPreviewFlag = true;
		var objspnPrev = $('spnPrev');
		var objspnNext = $('spnNext');
		var objdivBottomDash = $('divBottomDash');
		objspnNext.style.display = 'none';
		objspnPrev.style.display = 'none';
		objdivBottomDash.style.display = 'none';
		objspnNext.style.visibility = 'hidden';
		objspnPrev.style.visibility = 'hidden';
		var objDivExpandContents = $('divAssetDownload');
		objDivExpandContents.style.display = 'block';
		objDivExpandContents.style.visibility = 'visible';
		//omnitureFlag=true;
		//omnitureJsCode('APL');
		//s.pageName="The NewsMarket : Asset Download";
	}
	if (blnAssetPreviewFlag == true)
	{
	
	}
	else
	{
		if (document.body.scrollTop == 0)
		{
			blnCartErrorMsg = false;
			var strHidValue=$(returnControlId('MastHeadHome_ascx') + '_' + 'hdErrmsgNonLoginPreview').value;
			expandPassRemWithCustomMessage(strHidValue,'Y');
		}
		else
		{
			blnCartErrorMsg = false;
			Expand_FloatingLayer();		
		}
	}
}
function AssetDownloadLayer_contractAssetDownload()
{
	try
	{
		
		
		
		var objDivContractContents = $("divAssetDownload");
		objDivContractContents.style.display = "none";
		objDivContractContents.style.visibility = 'hidden';
		
		
		
	}
	catch(ex)
	{
	
	}
}

function AssetDownloadLayer_LastCallBack()
{
/*var objhidFilePath = $(returnControlId('AssetDownloadLayer_ascx') + '_' + 'hidFilePath').value;
var UserLeft = (window.screen.availWidth - 480)/2
var UserTop = (window.screen.availHeight - 280)/2 + 5
window.open('http://ps6582/Previews/PR/VideoAssets/ASF/PR_11018_150083.WMV','','scrollbars=yes,width=480,height=280,top='+UserTop+',left='+UserLeft);
*/
}

/********************************************************************************************
   Description: 1)Last Callback function of the preview layer.
*********************************************************************************************/
//function AssetDownloadLayer_LastCallBack()
//{
	//OmnitureControlCallBackStart();
	
			
	/*AssetPreviewLayer_ShowPlayer();
	if (strEmbedObject != 'standalone')
	{
	 loaded();
	}
	
	GetLayerWidth();
	maxw = PrevLayerWidth;
	if (PrevLayerXPos)
	{ 
		hideselectboxes(0,PrevLayerXPos,PrevLayerYPos,maxw,maxh,0);
	}*/
//}




//SR9.10 end




