/*******************************************************************************
 * File Name            : JCPHomePage.js
 * Author               : Keane India Pvt Ltd.,
 * Date of Creation     : 29 September 2008.
 * Description          : Created for HomePage Module.
 * Version Number       : 1.0
 * Modification History :
 Date         Version  Who             Description of change
 2008-09-29   1.0      Keane India     Initial - created methods for displaying
 									   different languages for the selected
 									   Country flag.
*******************************************************************************/
// Function to display the available languages onmouseover of country flag.
function showdisplay(pValue) {
	
	if (pValue == "USA") {
		document.getElementById("usa_Id").style.visibility = "visible";
	} else if(pValue == "UK") {
		document.getElementById("uk_Id").style.visibility = "visible";
	} else if(pValue == "GERMAN") {
		document.getElementById("German_Id").style.visibility = "visible";
	} else if(pValue == "FRENCH") {
		document.getElementById("French_Id").style.visibility = "visible";
	} else if(pValue == "SPANISH") {
		document.getElementById("Spanish_Id").style.visibility = "visible";
	} else if(pValue == "AUSTRALIA") {
		document.getElementById("Australia_Id").style.visibility = "visible";
	} else if(pValue == "OTHER") {
		document.getElementById("otherCountry_Id").style.visibility = "visible";
	}
}

// Function to hide the available languages onmouseover of country flag.
function hideDisplay(pValue) {

	if (pValue == "USA") {
		document.getElementById("usa_Id").style.visibility = "hidden";
	} else if(pValue == "UK") {
		document.getElementById("uk_Id").style.visibility = "hidden";
	} else if(pValue == "GERMAN") {
		document.getElementById("German_Id").style.visibility = "hidden";
	} else if(pValue == "FRENCH") {
		document.getElementById("French_Id").style.visibility = "hidden";
	} else if(pValue == "SPANISH") {
		document.getElementById("Spanish_Id").style.visibility = "hidden";
	} else if(pValue == "AUSTRALIA") {
		document.getElementById("Australia_Id").style.visibility = "hidden";
	} else if(pValue == "OTHER") {
		document.getElementById("otherCountry_Id").style.visibility = "hidden";
	}
}

// Function to pass the selected country, application Type and languageId to set
// the values into FrameTop.
function setDetails(pCountry, pLanguageId) {
	var itemArray = null;
	var itemDetails = null;
	var applicationType = "JCP";
	var data = readCookie(JCPCartCookie);

	if (data != "" && data != undefined && data != null) {
		itemArray = data.split ("^^");
		itemDetails = itemArray[0].split(",");
		
		if (itemDetails[1] != pCountry) {

			if (confirm(eval("CONFIRM_FLAG_SELECTION" + getLanguageCode(pLanguageId)))) {
				createCookie(JCPCartCookie, "");
			} else {
				return;
			}
		}
	}
	
	document.location = "JCPFrames.html?languageId="
			+ pLanguageId + "&Country=" + escape(pCountry) 
			+ "&applicationType="+ escape(applicationType);
}

// Function to Change the source of Image.
function moveImage(img_name,img_src) {
	document[img_name].src=img_src;
}

// Function to Change the source of Image.
function restoreImage(img_name,img_src) {
	document[img_name].src=img_src;
}