//----------------------------------------------------------------------------------------------------
//-- openWindow(image, title, newWidth, newHeight, desc, histBack)
//-- ('imagename', 'pageTitle', imageWidth, imageHeight, 'description, historyBackLink')
//----------------------------------------------------------------------------------------------------
function openWindow(image, title, newWidth, newHeight, desc, histBack) {
	var calcLeft = 100;
	var calcTop = 100;
	var imageTag;
	var widthTag;
	var heightTag;
	var titleTag;
	var descTag;
	var histBackTag;
	
	titleTag = title;
	imageTag = image;
	widthTag = newWidth;
	heightTag = newHeight;
	descTag = desc;
	histBackTag = histBack;
	variables = imageTag + '&width=' + widthTag +'&height=' + heightTag + '&title=' + escape(titleTag) + '&desc=' + escape(descTag) + '&back=' + escape(histBackTag)

	if (newWidth < 480) {
	newWidth = 520 }
	else {	
	newWidth = newWidth + 40;
	}
	newHeight = newHeight + 160;
	
	if (parseInt(navigator.appVersion) >= 4){
	  calcTop = screen.availHeight /2 - newHeight / 2;
	  calcLeft = screen.availWidth / 2 - newWidth / 2;}

   remoteWindow = window.open('/shared/text/popup.asp?image=' + variables, + 'remote', 'status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resize=no,width=' + newWidth + ',height=' + newHeight + ',left=' + calcLeft + ',top=' + calcTop + ',resizable=yes');

	remoteWindow.focus();
}

//----------------------------------------------------------------------------------------------------
//-- open window function to display popup windows for solution pages 
//-- non image pop ups, just text
//----------------------------------------------------------------------------------------------------
function openSolWindow(title, newWidth, newHeight, desc) {
	var calcLeft = 100;
	var calcTop = 100;
	var widthTag;
	var heightTag;
	var titleTag;
	var descTag;
	
	titleTag = title;
	widthTag = newWidth;
	heightTag = newHeight;
	descTag = desc;
	variables = widthTag +'&height=' + heightTag + '&title=' + escape(titleTag) + '&desc=' + escape(descTag)

	newWidth = newWidth + 40;
	newHeight = newHeight + 160;
	
	if (parseInt(navigator.appVersion) >= 4){
	  calcTop = screen.availHeight /2 - newHeight / 2;
	  calcLeft = screen.availWidth / 2 - newWidth / 2;}

   remoteWindow = window.open('/shared/text/solpopup.asp?width=' + variables, + 'remote', 'status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resize=no,width=' + newWidth + ',height=' + newHeight + ',left=' + calcLeft + ',top=' + calcTop + ',resizable=yes');

	remoteWindow.focus();
}

//----------------------------------------------------------------------------------------------------
//-- Opens product wizard in a popup
//----------------------------------------------------------------------------------------------------
function openProductWizard(loc, newWidth, newHeight){
	var newWindow

	//newWindow = window.open(loc,"popup","width=560,height=480,location=no,status=no,scrollbars=yes,toolbar=no,resizable=yes");		
//	newWindow.focus();

// Added parameters for width & height of window 7/18/03 - Eric Phanthavong
	newWindow = window.open(loc, 'popup', 'status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=' + newWidth + ',height=' + newHeight);
	newWindow.focus();

}	

//----------------------------------------------------------------------------------------------------
//-- Opens WRC/WRS Sample Reports in a popup
//----------------------------------------------------------------------------------------------------
function openSampleReports(loc, newWidth, newHeight){
	var reportWindow

	reportWindow = window.open(loc, 'report', 'status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=' + newWidth + ',height=' + newHeight);
	reportWindow.focus();
}	

//----------------------------------------------------------------------------------------------------
//-- Opens Generic window
//----------------------------------------------------------------------------------------------------
function openGenericLockedWindow(loc, newWidth, newHeight){
	var reportWindow

	reportWindow = window.open(loc, 'report', 'status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=' + newWidth + ',height=' + newHeight);
	reportWindow.focus();
}	

//----------------------------------------------------------------------------------------------------
//-- Opens Generic window
//----------------------------------------------------------------------------------------------------
function openGenericUnLockedWindow(loc, newWidth, newHeight){
	var reportWindow

	reportWindow = window.open(loc, 'report', 'status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=' + newWidth + ',height=' + newHeight);
	reportWindow.focus();
}	

//----------------------------------------------------------------------------------------------------
// Built for opening WebBoard and eServices in a new window for support 
//----------------------------------------------------------------------------------------------------
function eSupportWindow(gotoURL, winName){
	var arguments;
	var eSupportWindow;
	
	switch(winName) {
		case "eservice":
			arguments = "width=915,height=680,menubar=no,location=no,status=no,scrollbars=yes,toolbar=no,resizable=yes";
			break
		case "webboard":
			arguments = "width=850,height=610,resizable=yes,toolbar=yes,location=yes,directories=yes,addressbar=yes,scrollbars=yes,status=yes,menubar=yes";
			break
		default:
			arguments = "width=850,height=610,resizable=yes,toolbar=yes,location=yes,directories=yes,addressbar=yes,scrollbars=yes,status=yes,menubar=yes";
	} 
	
	eSupportWindow = window.open(gotoURL,winName,arguments);
	eSupportWindow.focus();
}

//open new window for prev. html version of the html newsletters
function NLWindow(NLtype) {
	var NLURL, remoteWindow;
	
	if(NLtype == "net"){
		if ("undefined" == typeof(server)) {
			NLURL = "/shared/newsletters/htmlnewsletters/netresults/default.htm";
		}
		else {
			NLURL = server + "shared/newsletters/htmlnewsletters/netresults/default.htm";
		}
		newWidth = "617";
		newHeight = "548";		
	}
	else if(NLtype == "secure"){
		if ("undefined" == typeof(server)) {
			NLURL = "/shared/newsletters/htmlnewsletters/secureresults/default.htm";
		}
		else {
			NLURL = server + "shared/newsletters/htmlnewsletters/secureresults/default.htm";
		}
		newWidth = "617";
		newHeight = "548";		
	}
	else if(NLtype == "web"){
		if ("undefined" == typeof(server)) {
			NLURL = "/shared/newsletters/htmlnewsletters/webresults/default.htm";
		}
		else {
			NLURL = server + "shared/newsletters/htmlnewsletters/webresults/default.htm";
		}
		newWidth = "617";
		newHeight = "548";
	}
	else if(NLtype == "take10"){
		NLURL = "/webtrends/conversionpopup.asp";
		newWidth = "775";
		newHeight = "479";
	}
	else if(NLtype == "take10Calc"){
		NLURL = "/webtrends/conversioncalc.asp";
		newWidth = "775";
		newHeight = "585";
	}
	
	 remoteWindow = window.open(NLURL, 'newsletter', 'status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=' + newWidth + ',height=' + newHeight);
	remoteWindow.focus();
}

//open new window for prev. html version of the html newsletters
function campaignWindow(campaigntype) {
	var NLURL, remoteWindow;
	
	if(campaigntype == "conversion"){
		campaignURL = "/webtrends/resources/take10/conversionpopup.asp";
		newWidth = "775";
		newHeight = "479";
	}
	else if(campaigntype == "take10Calc"){
		campaignURL = "/webtrends/resources/conversion/conversioncalc.asp";
		newWidth = "775";
		newHeight = "585";
	}
	else if(campaigntype == "sem"){
		campaignURL = "/webtrends/resources/take10/sempopup.asp";
		newWidth = "775";
		newHeight = "479";
	}	
		else if(campaigntype == "ret"){
		campaignURL = "/webtrends/resources/take10/retpopup.asp";
		newWidth = "775";
		newHeight = "479";
	}	
	else if(campaigntype == "semtour"){
		campaignURL = "http://netiq.breezecentral.com/p98248311/";
		newWidth = "780";
		newHeight = "640";
	}
	else if(campaigntype == "ab"){
		campaignURL = "/webtrends/resources/take10/abpopup.asp";
		newWidth = "780";
		newHeight = "479";
	}	
	else if(campaigntype == "analytics"){
		campaignURL = "/webtrends/resources/take10/analyticspopup.asp";
		newWidth = "780";
		newHeight = "479";
	}
	else if(campaigntype == "wm"){
		campaignURL = "http://netiq.breezecentral.com/p85068857/";
		newWidth = "780";
		newHeight = "479";
	}
	else if(campaigntype == "flash"){
		campaignURL = "http://netiq.breezecentral.com/p67943344/";
		newWidth = "780";
		newHeight = "479";
	}	
	else if(campaigntype == "leadgen"){
		campaignURL = "http://netiq.breezecentral.com/p77461893/";
		newWidth = "780";
		newHeight = "479";
	}	
	 remoteWindow = window.open(campaignURL, 'campaign', 'status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=' + newWidth + ',height=' + newHeight);
	remoteWindow.focus();
}

//wrote for support pages to allow user to bookmark a specific page.  link is on the sidebar
function bookmark()
{
	if (document.all)
		{
			window.external.AddFavorite(location.href, document.title); return false
		}
}
