function ContactUsPopupSize(strFormKey)
{
    if(strFormKey == "FNYAM" || strFormKey == "FNYAS" || strFormKey == "FNYEUR" || strFormKey == "FINDDC" || strFormKey == "FINDDCSR" || strFormKey == "FINDDCPR")
    {
        return "scrollbars=yes,resizable=yes,height=500,width=800,top=75,left=75";
    }
    else
    {
        return "scrollbars=yes,resizable=yes,height=500,width=580,top=75,left=75";
    }
}
function callPopup(mylink, windowname, strStyle)
{
    var href;
    if (! window.focus)
	{
	    return true;
	}

    if (typeof(mylink) == "string")
	{
	    href = mylink;
	}
    else
	{
	    href = mylink.href;
	}
    window.open(href, windowname, strStyle);
}
function callParent(mylink, blnKeepOpen)
{
	var pos, strLink;
	pos = mylink.indexOf("popup=true");
	if (pos >= 0)
	{
	    mylink = mylink.substring(0, pos - 1);
	}
	if (window.name.indexOf("1") >= 0)
	{
	    if (mylink.indexOf("?") >=0)
	    {
	        strLink = myLink + "&popup=true";
        }
        else
	    {
	        strLink = mylink + "?popup=true";
	    }
	}
	else
	{
	    strLink = mylink;
	}
	window.opener.location.href = strLink;
	if (!blnKeepOpen)
	{
	    window.close();
	}
}
function ContactUsPopup(DccRoot, strFormKey, strAppText, strHiddenText)
{
    ContactUsPopupExtraQueryString(DccRoot, strFormKey, strAppText, strHiddenText, "");
}	

function ContactUsPopup2(strFormKey, strAppText, strHiddenText)
{
	ContactUsPopupExtraQueryString("", strFormKey, strAppText, strHiddenText, "");
}

function ContactUsPopupWcm(strFormKey)
{
    ContactUsPopupExtraQueryString("", strFormKey, "", "", "");
}

function ContactUsPopupExtraQueryString(DccRoot, strFormKey, strAppText, strHiddenText, strExtraQueryString)
{
	var strCallingPage;
	strCallingPage = location.href;
	if (! window.focus)
	{
	    return true;
	}
	ContactUsPopupPassAllParameters(DccRoot, strFormKey, strAppText, strHiddenText, strExtraQueryString, strCallingPage);
}	

function ContactUsPopupPassAllParameters(DccRoot, strFormKey, strAppText, strHiddenText, strExtraQueryString, strCallingPage)
{
    var strURL = BuildContactUsUrl(DccRoot, strFormKey, strAppText, strHiddenText, strExtraQueryString, strCallingPage);
	window.open(strURL, "ContactUS", ContactUsPopupSize(strFormKey));
}

function CallContactUsNoPopup(DccRoot, strFormKey, strAppText, strHiddenText, strExtraQueryString, strCallingPage)
{
	 var strUrl;
	 strUrl = BuildContactUsUrl(DccRoot, strFormKey, strAppText, strHiddenText, strExtraQueryString, strCallingPage);
	 location.href = strUrl;
}

function BuildContactUsUrl(DccRoot, strFormKey, strAppText, strHiddenText, strExtraQueryString, strCallingPage)
{
	return DccRoot + "/applications/Contact/Contact.asp?key=" + escape(strFormKey) + "&apptext=" + escape(strAppText) + "&hiddentext=" + escape(strHiddenText) + "&caller=" + escape(strCallingPage) + "&" + strExtraQueryString;
}

function ContactUsPopupGlobalTools(DccRoot)
{
    var strURL, strCallingPage;
    strCallingPage = location.href;
    if (! window.focus)
	    {
	    return true;
	    }
    strURL = DccRoot + "/content/support/contact_us.aspx?popup=true&caller=" + escape(strCallingPage);
    window.open(strURL, "ContactUS", "scrollbars=yes,resizable=yes,height=500,width=800,top=75,left=75");
}
function ContactUsPopupAskExpert(DccRoot)
{
    var strURL, strCallingPage;
    strCallingPage = location.href;
    if (! window.focus)
	    {
	    return true;
	    }
    strURL = DccRoot + "/applications/Contact/ask_an_expert_menu.asp?caller=" + escape(strCallingPage);
    window.open(strURL, "ContactUS", "scrollbars=yes,resizable=yes,height=500,width=580,top=75,left=75");
}
function LogPdfClickToWebTrends(uri, referrer, application, section, subsection)
{
	dcsMultiTrack("DCS.dcsuri",uri);
	dcsMultiTrack("DCS.dcsref", referrer);
	if(application.length > 0)
	{
		dcsMultiTrack("DCSext.APP",application);
	}
	if(section.length > 0)
	{
		dcsMultiTrack("WT.cg_n", section)
	}
	if(subsection.length > 0)
	{
		dcsMultiTrack("WT.cg_s", subsection)
	}
	dcsTagAut();
}
function DropDownMenuChanged(dropDownId)
{
	var dropDown = document.getElementById(dropDownId);
	
	var gotoLocation = dropDown.options[dropDown.selectedIndex].value;
	
	var beginning = gotoLocation.substring(0,10);
	var rest = gotoLocation.substring(11);
	
	if(beginning == "javascript")
	{
		setTimeout(rest, 0);		
	}
	else
	{
		location.href = gotoLocation;
	}
	
}

