﻿//var gUserDefWidth;
//var gBgImageHeight = 105;

/*function ResizeContentDivWidth(pDivID)
{	
	var objDiv = document.getElementById(pDivID);		
	if (objDiv != null && gUserDefWidth != null)
	{	
		objDiv.parentElement.width = gUserDefWidth;
	}
}

function InitialContentDivWidth(pDivID)
{	
	var objDiv = document.getElementById(pDivID);
	if (objDiv != null)
	{
		gUserDefWidth = objDiv.parentElement.width;
		objDiv.parentElement.width="100%";				
	}
}
*/
/*
function ContentDivBlockVisible(pDivID)
{
	try
	{	
		var strContent="";
		var spanID = "MainContent_" + pDivID;	
		var PaddingTRID= "PaddingTR_" + pDivID;
		var oItems = document.getElementById(spanID);		
		var tdCount=0;

		if (oItems !=null)
		{			
			for(itemIndex=0;itemIndex<oItems.children.length;itemIndex++)
			{
				strContent +=oItems.children.item(itemIndex).innerText;			
			}

			tdCount = itemIndex;
			
			if (strContent.length<=0)
			{								
				document.getElementById(pDivID).style.display ="none";				
				return false;
			}
			else
			{	
				var objTR = document.getElementById(PaddingTRID);
				var nHeight = Math.max(0,gBgImageHeight - tdCount*15);
				if (objTR !=null && nHeight >0)
					objTR.height = nHeight;
				
				document.getElementById(pDivID).style.display = "";
				return true;
			}
		} 
	}
	catch(e)
	{
		alert(e.message);
	}
	return false;
}
*/

function GoToCMSPosting(pName,pQS)
{	
	document.domain = "Polaris.com.tw";
	var contentPosting="";
	switch (pName.toUpperCase())
	{
	case "NAV_QUERY_LATEST":		
		contentPosting = "/Finairport/Chn_1/Chn_1_3/Chn_1_3_5/Chn_1_3_5_3/NAV_QUERY_LATEST";
		break;
	case "NAV_QUERY_BYDATE":		
		contentPosting = "/Finairport/Chn_1/Chn_1_3/Chn_1_3_5/Chn_1_3_5_3/NAV_QUERY_BYDATE";
		break;
	case "NAV_QUERY_BYPERIOD":
		contentPosting = "/Finairport/Chn_1/Chn_1_3/Chn_1_3_5/Chn_1_3_5_3/NAV_QUERY_BYPERIOD";
		break;
	case "HOME":
		contentPosting = "/Finairport/";
		break;
	default:
		alert("GoToCMSPosting() Error: can't find posting name-" + pName);
		return;
		break;
	}
	if (pQS !=null && pQS!="")		
		contentPosting += "?=" + pQS;	
	window.location.href = contentPosting ;
}