﻿var moodysJpRootUrl = "http://www.moodys.co.jp/";
var moodysJpSecoundDir = "pages/";
var moodysJpPopupParams = "width=600, height=500, left=10, top=10, menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes";
var helpRootUrl = window.location.protocol + "//" + window.location.host + "/";
var helpSender = "help/help.pdf";
var publicSiteUrl = "http://www.moodys.co.jp/";
var logOutPageUrl = "/ExternalPages/logout.aspx";

function Logout()
{
	//self.opener = null;
	//self.close();

	var fAnswer;
	fAnswer = confirm("ログアウトしますか？");
	if (fAnswer)
	{
		//はい、が選択されたときの処理を記述します
		sendLogoutPage();
	}
	else
	{
		//キャンセル、が選択されたときの処理を記述します
	}
}

function rollInHeader(obj)
{
	obj.className = 'mdy-header1hover';
}

function rollOutHeader(obj)
{
	obj.className = 'mdy-header1link';
}

function rollInHeaderForLogout(obj)
{
	obj.className = 'mdy-Logouthover';
}

function rollOutHeaderForLogout(obj)
{
	obj.className = 'mdy-Logoutlink';
}

function forwardHeaderHome()
{
	window.open(moodysJpRootUrl + moodysJpSecoundDir + "HomePage.aspx", null, "");
}

function forwardHeaderCompany()
{
	window.open(moodysJpRootUrl + moodysJpSecoundDir + "Company.aspx", null, "");
}

function forwardHeaderCareer()
{
	window.open(moodysJpRootUrl + moodysJpSecoundDir + "Career.aspx", null, "");
}

function forwardHeaderFAQ()
{
	window.open(moodysJpRootUrl + moodysJpSecoundDir + "FAQ.aspx", null, "");
}

function forwardHeaderContactUs()
{
	window.open(moodysJpRootUrl + moodysJpSecoundDir + "ProductNServices_Contact.aspx", null, "");
}

function forwardHeaderLink()
{
	window.open(moodysJpRootUrl + moodysJpSecoundDir + "Links.aspx", null, "");
}

function forwardHeaderHelp()
{
	//window.open(moodysJpRootUrl + moodysJpSecoundDir + "Help.aspx", null, moodysJpPopupParams);

/*
	var rootUrl = window.location.protocol + "//" + window.location.host + "/";
	var sender = "help/help.pdf";
	window.open(rootUrl + sender, null, moodysJpPopupParams);
//	window.location.assign(rootUrl + sender);
*/
	window.open(helpRootUrl + helpSender, null, moodysJpPopupParams);

}

/* Add at 20070925 - yotsumoto - ヘッダリンク追加 - add start */
function forwardHeaderArchive()
{
	window.open(moodysJpRootUrl + moodysJpSecoundDir + "videoarchive.htm", null, "");
}
/* add end */

function forwardHeaderClientDesk()
{
	window.open(moodysJpRootUrl + moodysJpSecoundDir + "ClientDesk.aspx", null, moodysJpPopupParams);
}

function forwardFooterDisclaimer()
{
	window.open(moodysJpRootUrl + moodysJpSecoundDir + "Disclaimer.aspx", null, moodysJpPopupParams);
}

function forwardFooterCopyright()
{
	window.open(moodysJpRootUrl + moodysJpSecoundDir + "Copyrights.aspx", null, "");
}

function forwardFooterPrivacy()
{
	window.open(moodysJpRootUrl + moodysJpSecoundDir + "Privacy.aspx", null, "");
}

function forwardFooterAccessibility()
{
	window.open(moodysJpRootUrl + moodysJpSecoundDir + "Accessibility.aspx", null, "");
}


function sendHome()
{
	var rootUrl = window.location.protocol + "//" + window.location.host + "/";
	var sender = "Default.aspx";

	window.location.assign(rootUrl + sender);
}

function showSatusHomeUrl()
{
	var rootUrl = window.location.protocol + "//" + window.location.host + "/";
	var sender = "Default.aspx";

	window.status = rootUrl + sender;
}

function clearStatusHomeUrl()
{
	window.status = "";
}


function showStatusHeaderHomeUrl()
{
	window.status = moodysJpRootUrl + moodysJpSecoundDir + "HomePage.aspx";
}

function showStatusHeaderCompanyUrl()
{
	window.status = moodysJpRootUrl + moodysJpSecoundDir + "Company.aspx";
}

function showStatusHeaderCareerUrl()
{
	window.status = moodysJpRootUrl + moodysJpSecoundDir + "Career.aspx";
}

function showStatusHeaderFAQUrl()
{
	window.status = moodysJpRootUrl + moodysJpSecoundDir + "FAQ.aspx";
}

function showStatusHeaderContactUsUrl()
{
	window.status = moodysJpRootUrl + moodysJpSecoundDir + "ProductNServices_Contact.aspx";
}

function showStatusHeaderLinkUrl()
{
	window.status = moodysJpRootUrl + moodysJpSecoundDir + "Links.aspx";
}

function showStatusHeaderHelpUrl()
{
	//window.status = moodysJpRootUrl + moodysJpSecoundDir + "Help.aspx";

/*
	var rootUrl = window.location.protocol + "//" + window.location.host + "/";
	var sender = "help/help.pdf";
	window.status = rootUrl + sender;
*/
	window.status = helpRootUrl + helpSender;

}

/* Add at 20070925 - yotsumoto - ヘッダリンク追加 - add start */
function showStatusHeaderArchiveUrl()
{
	window.status = moodysJpRootUrl + moodysJpSecoundDir + "videoarchive.htm";
}
/* add end */

function showStatusHeaderClientDeskUrl()
{
	window.status = moodysJpRootUrl + moodysJpSecoundDir + "ClientDesk.aspx";
}

function showStatusFooterDisclaimerUrl()
{
	window.status = moodysJpRootUrl + moodysJpSecoundDir + "Disclaimer.aspx";
}

function showStatusFooterCopyrightUrl()
{
	window.status = moodysJpRootUrl + moodysJpSecoundDir + "Copyrights.aspx";
}

function showStatusFooterPrivacyUrl()
{
	window.status = moodysJpRootUrl + moodysJpSecoundDir + "Privacy.aspx";
}

function showStatusFooterAccessibility()
{
	window.status = moodysJpRootUrl + moodysJpSecoundDir + "Accessibility.aspx";
}

function clearStatusBar()
{
	window.status = "";
}

function BaseSearchFieldInputValidation(keywordObject, searchForObject, fromDateObject, toDateObject, lstPublicationObject, divSelectedvaluesObjectArray)
{
	var inputCount = new Number(0);

	if (Trim(keywordObject) != "") { inputCount++; }
	if (Trim(searchForObject) != "") { inputCount++; }

	if(fromDateObject)
	{
		if(fromDateObject.getValue() && fromDateObject.getValue() != "") { inputCount++; }
	}

	if(toDateObject)
	{
		if(toDateObject.getValue() && toDateObject.getValue() != "") { inputCount++; }
	}

	if(lstPublicationObject)
	{
		if(lstPublicationObject.options.length > 0)
		{
			if(lstPublicationObject.selectedIndex > -1) { inputCount++; }
		}
	}

	if(divSelectedvaluesObjectArray != undefined)
	{
		for(i = 0; i < divSelectedvaluesObjectArray.length; i++)
		{
			if(divSelectedvaluesObjectArray[i])
			{
				var divSelectedvaluesObject = divSelectedvaluesObjectArray[i];
				if(divSelectedvaluesObject.innerText != null && divSelectedvaluesObject.innerText != "")
				{ inputCount++; }
			}
		}
	}

	return inputCount;
}

function sendPublicSite()
{
	window.location.replace(publicSiteUrl);
}

function sendLogoutPage()
{
	window.location.replace(logOutPageUrl);
}

/* Add at 20070925 - yotsumoto - バナー表示制御 - add start */
function showBanner1()
{
	var objIFBanner1 = document.getElementById("ifVideoBanner1");
	if(objIFBanner1)
	{
		objIFBanner1.style.display = "inline";
	}
}
function showBanner2()
{
	var objIFBanner2 = document.getElementById("ifVideoBanner2");
	if(objIFBanner2)
	{
		objIFBanner2.style.display = "inline";
	}
}
/* add end */

/* added by tanaka 2008/01/15/ start */
var nWin;
function openHelp(loc)
{
	var strUrl;
	strUrl = "../ExternalPages/Help/MainHelp.htm#" + loc;

	nWin=window.open("","_help","width=600,height=350,left=100,top=100,status=yes,location=no,toolbar=no,scrollbars=yes,resizable=yes");
	window.nWin.location.href=strUrl;
	nWin.focus();
}
/* added by tanaka 2008/01/15/ end */

/* added by tanaka 2008/07/16/ start */
function openChangePW()
{
	var strUrl = "../ChangePW.aspx";
	window.open(strUrl,'ChangePW','width=1012, height=500, left=0, top=10, menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes');
}
function openForgetPW()
{
	var strUrl = "../Login/forgetPW.aspx";
	window.open(strUrl,'forgetPW','width=1012, height=500, left=0, top=10, menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes');
}
function openChangePWHelp()
{
	var strUrl = "ExternalPages/Help/changePWHelp.htm";
	window.open(strUrl,'forgetPW','width=300, height=500, left=0, top=10, menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes');
}
/* added by tanaka 2008/07/16/ end */

/* added by myamamoto 2008/07/23 start */
function helpAboutJapaneseService()
{
	var strUrl = "http://www.moodys.co.jp/Pages/ProductInformation.aspx?Name=PI_JapanResearchService";
	window.open(strUrl,'aboutJPS','width=1012, height=500, left=0, top=10, menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes');
}

/* added by myamamoto 2008/07/23 end */

