// JavaScript Document

function Contactus(FileName) {

	var httpStr = new String();
	var linkSecureRootMotrin = new String();
	var linkContactus = new String();
	
	httpStr = window.location.href;
	
	if ( httpStr.indexOf("localhost") >=0 ) {
//	LocalHost
		if (httpStr.indexOf("/eng/") != -1) {
			linkContactus = "http://localhost/motrin/securejnjcanada/motrin/contactus/en/";
		}
		else {
			linkContactus = "http://localhost/motrin/securejnjcanada/motrin/contactus/fr/";
		}
//	Staging	
	} else {
		if ( httpStr.indexOf(":8093") >=0 ) {
			if (httpStr.indexOf("/eng/") != -1) {
				linkContactus = "http://65.110.160.148:8140/motrin/contactus/en/";
			} else {
				linkContactus = "http://65.110.160.148:8140/motrin/contactus/fr/";
			}
// Production
		} else {
			if (httpStr.indexOf("/eng/") != -1) {
				linkContactus = "https://secure.jnjcanada.com/motrin/contactus/en/";

			} else {
				linkContactus = "https://secure.jnjcanada.com/motrin/contactus/fr/";
			}
			
		}
	}
	
	function openWindow(windowName, theUrl, width, height) {

	agent = navigator.userAgent;
	params  = '';
	params += 'toolbar=0,';
	params += 'location=0,';
	params += 'directories=0,';
	params += 'status=0,';
	params += 'menubar=0,';
	params += 'scrollbars=1,';
	params += 'resizable=0,';
	params += 'width=' + width + ',';
	params += 'height=' + height;

	win = window.open(theUrl, windowName , params);

	if (agent.indexOf('Mozilla/2') != -1 && agent.indexOf('Win') == -1) {
		win = window.open(url, windowName , params);
	}

	if (!win.opener) {
		win.opener = window;
	}
}
	
	var theUrl = String(linkContactus + FileName);
	
	openWindow('Contact', theUrl, 676, 485);
}
