
/*
	External - Help Feedback Code
	=============================================================================
	This code has been taken from the help.js file and modified and placed here
*/



function submitFeedback()
{
event.returnValue = false;
var sNoresponse = document.getElementById("NoResponse").value;
if (GetRating() == "None")
{
alert(sNoresponse);
return false;
}

/*var pathFields = top.helpContents.location.pathname.split("/");*/
var pathFields = location.pathname.split("/");

var sURL = pathFields[pathFields.length-1];

var sTitle = ParseTitle(document.title);

var sProductVer  = document.getElementById("ProdVersion").value;
var sDocVer      = document.getElementById("DocVersion").value;
var sSku         = document.getElementById("Sku").value;
var sLang        = document.getElementById("Language").value;
var sDeliverable = document.getElementById("Deliverable").value;

/*if( sDeliverable == "" )
sDeliverable = pathFields[1];*/

/* var sSku = document.getElementById("Sku").value;
if( sSku == "" )
sSku = pathFields[3];
var sLang = document.getElementById("Language").value;
if( sLang == "" )
sLang = pathFields[2];*/

var sExtension = document.getElementById("CustomExtension").value;

var sSubject =  sTitle + ' (' + "/1:" + sDeliverable + "/2:" + sProductVer + "/3:" + sDocVer+ '/4:' +
sURL + '/5:' +  GetRating() + '/6:' + sLang + '/7:' + sSku + sExtension + ")";

var sBody = document.getElementById("fbResponseText").value;

if (sBody == "")
{
sBody = "---" + top.bottomBar.fbTypeHere_Text + "---";
}
location.href = "mailto:mscrmdf@microsoft.com" + '?subject=' + sSubject + '&body=' + sBody;
}
function ParseTitle(theTitle)
{
theTitle = theTitle.replace(/\"/g,"--");
theTitle = theTitle.replace(/'/g,"-");
if (theTitle == "") {theTitle = top.bottomBar.fbTitle_Text;}
if (theTitle.length > 50) {theTitle = theTitle.slice(0,47) + "...";}
return theTitle;
}
function GetRating()
{
if (fbRating[0].checked)
return "Yes";
else if (fbRating[1].checked)
return "No";

else
return "None";
}


