function OpenDialogForDisplay(TargetURL, TargetQueryString, DialogStyle, Width)
{
	var ScreenWidth=screen.width;
	var ScreenHeight=screen.availHeight;
	var FrameURL = "/C02A_Marketing/C02A_Frame.aspx";
	var QueryString = "?TargetURL=" + TargetURL + "&" + TargetQueryString;

	switch ( DialogStyle )
	{
		case 1 :
			window.showModalDialog(FrameURL + QueryString, document, 'dialogWidth:' + Width + 'px; dialogHeight:' + (ScreenHeight-0) + 'px; help:0; dialogTop:0px; dialogLeft:0px; status:1; resizable:0; center:1');			
			break;
		case 2 :
			window.showModalDialog(FrameURL + QueryString, document, 'dialogWidth:' + Width + 'px; dialogHeight:' + (ScreenHeight-0) + 'px; help:0; dialogTop:0px; dialogLeft:' + (ScreenWidth - Width) + 'px; status:1; resizable:0; center:1');			
			break;
	}
}

function GoHome()
{				
	location.href = "http://" + document.domain;
}

function RedirectHtm(TargetURL)
{
	location.href = "http://" + document.domain + "/B2C_PageDesign/C02A_Marketing/Album/" + TargetURL;
}

function closeself()
{
	document.close();
}

// 會員專區加密處理(https://)
function GoToURL(URL)
{
	var myDomain = document.URL;

	if ( myDomain.indexOf("www") == -1 )
	{
		location.href = "http://ntestb2c.colatour.com.tw" + URL;
	}
	else
	{
		if ( myDomain.substring(0, myDomain.indexOf(":")).toUpperCase() == "HTTP" )
		{
			location.href = myDomain.substring(0, myDomain.indexOf(".") + 1).replace("http", "https") + document.domain.replace("www.", "") + URL;
		}	
		else
		{
			location.href = myDomain.substring(0, myDomain.indexOf(".") + 1) + document.domain.replace("www.", "") + URL;
		}
	}
}