// JavaScript Document
// Author: Mike Lipman
// Date: 7/14/2008

// Function Name: showPhoneImage
// Purpose: Show "processing" verbiage and load the phone image
// Input: 	sImg - Image file name
//			iNum - easyedge phone ID
// Output: 	None
function showPhoneImage(sImg, iNum)
{
	// The first step displays a "processing" message as the image is downloaded
	document.getElementById('eeAppDetailPhoneInstructions').innerHTML = 'Generating Preview...';
	document.getElementById('eeAppDetailPhoneInstructions').style.display = 'block';
	document.getElementById('eeAppDetailPhoneImage').style.display = 'none';
	
	// The second step calls the server to retrieve the image and sets the links as appropriate
	document.getElementById('eeAppDetailPhoneImageLink').href = '/uscellular/data/apps/appsToPhone.jsp?phoneId=' + iNum;
	document.getElementById('eeAppDetailPhoneImage').src =sImg;
}

// Function Name: removeImage
// Purpose: Remove the current phone image with the default verbiage and spacer gif
// Input: 	None
// Output: 	None
function removePhoneVerbiage()
{
	// If the "processing" message is displaying, remove it and show the details button
	if (document.getElementById('eeAppDetailPhoneInstructions').innerHTML.indexOf('Generating Preview') > -1)
	{
		document.getElementById('eeAppDetailPhoneImage').style.display = 'inline';
		document.getElementById('eeAppDetailPhoneImage').style.width = '60px';
		document.getElementById('eeAppDetailPhoneInstructions').innerHTML = '';
		document.getElementById('eeAppDetailPhoneInstructions').style.display = 'none';
	}
}

// Function Name: showPhoneImage
// Purpose: Show "processing" verbiage and load the phone image
// Input: 	sImg - Image file name
//			iNum - easyedge phone ID
// Output: 	None
function showPhoneImageVideo(sImg, iNum)
{
	// The first step displays a "processing" message as the image is downloaded
	document.getElementById('eeAppDetailPhoneInstructionsVideo').innerHTML = 'Generating Preview...';
	document.getElementById('eeAppDetailPhoneInstructionsVideo').style.display = 'block';
	document.getElementById('eeAppDetailPhoneImageVideo').style.display = 'none';
	
	// The second step calls the server to retrieve the image and sets the links as appropriate
	document.getElementById('eeAppDetailPhoneImageLinkVideo').href = '/uscellular/data/apps/appsToPhone.jsp?phoneId=' + iNum;
	document.getElementById('eeAppDetailPhoneImageVideo').src = sImg;
}

// Function Name: removeImage
// Purpose: Remove the current phone image with the default verbiage and spacer gif
// Input: 	None
// Output: 	None
function removePhoneVerbiageVideo()
{
	// If the "processing" message is displaying, remove it and show the details button
	if (document.getElementById('eeAppDetailPhoneInstructionsVideo').innerHTML.indexOf('Generating Preview') > -1)
	{
		document.getElementById('eeAppDetailPhoneImageVideo').style.display = 'inline';
		document.getElementById('eeAppDetailPhoneImageVideo').style.width = '60px';
		document.getElementById('eeAppDetailPhoneInstructionsVideo').innerHTML = '';
		document.getElementById('eeAppDetailPhoneInstructionsVideo').style.display = 'none';
	}
}
