

function IsSymphony() {
	var bRet = false;
	
	// Get the Media Center object
	try {
		var oMCE = window.external.MediaCenter();
	} catch(e) {
		return false;
	}
	
	if (oMCE != null) {
		// The Symphony is 6.7 or greater
		var nVer = oMCE.MajorVersion + (oMCE.MinorVersion / 10);
		if (nVer >= 6.7) {
			bRet = true; //Symphony
		}
	}
	return bRet;
}

var MCEVer = (IsSymphony()) ? "2005":"2004";

    
// Return values
// -1 Exception occured
// else whatever returned by CreateDesktopShortcut()
function CreateDesktopShortcutWrapper(sName,strHTTPURL) {
	var nRet = -1;
	// this function calls the CreateDesktopShortcut method
	// Exit out of this function if the OS is Symphony
	
	if (IsSymphony() == false) {
		return -1;
	}     
	
	try {
		var oMCE = window.external.MediaCenter();
	} catch(e) {
		return -1;
	}
	
	
	if (oMCE != null) {
		// Return codes to CreateDesktopShortcut
		// 0 - The user clicked the Open Website in Browser button. 
		// 1 - The user clicked the Save Link To Desktop button. 
		// 2 - The user clicked the Cancel button. 

		nRet = oMCE.CreateDesktopShortcut(sName,strHTTPURL);
		
		// If the user chose to create a shortcut, message them.
		if (nRet == 1) {
			// check IsMCExtender function (located in BasicFunction.js) to see if this is an Extender session
			if (IsMCExtender() == true) {
				// Message for Extender users.
				sUserMessage = "To continue, please access your shortcut in the 'Media Center Shortcuts' folder on your Media Center PC desktop."
			} else {
				// Message for console users
				sUserMessage = "To continue, please access your shortcut in the 'Media Center Shortcuts' folder on your desktop."
			}
			
			//show MCE dialog containing sUserMessage from above
			oMCE.Dialog(sUserMessage,'',1,10,true)
		}
	}
//return nRet;
}
