/////////////////////////
// Determining Browser //
/////////////////////////
var isFlashNS = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)?true:false;
var isMoz2 = (navigator.userAgent.indexOf("Mozilla/2") != -1)?true:false;
var isIE = (navigator.appName == "Microsoft Internet Explorer")?true:false;
var isGecko = (navigator.userAgent.indexOf("Gecko") != -1)?true:false;
var isNetscape6 = (isGecko && parseInt(navigator.appVersion) >= 5)?true:false;
var isDOM = (document.getElementById) ? true : false;
var isIE4 = (navigator.userAgent.indexOf("MSIE 4.0") != -1)?true:false;
var isIE45 = (navigator.userAgent.indexOf("MSIE 4.5") != -1)?true:false;
var isIE5 = (navigator.userAgent.indexOf("MSIE 5.0") != -1)?true:false;
var isIE6 = (navigator.userAgent.indexOf("MSIE 6.0") != -1)?true:false;
var isMac = (navigator.userAgent.indexOf("Mac") != -1)?true:false;
var isMacIE4 = (isMac && isIE4) ? true : false;
var isMacIE45 = (isMac && isIE45) ? true : false;
var isMacIE5 = (isMac && isIE5) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1)?true:false;
var isOpera3 = (navigator.userAgent.indexOf("Opera 3.")!= -1)?true:false;
var isOpera4 = (navigator.userAgent.indexOf("Opera 4.")!= -1)?true:false;
var isNetscape = (!isOpera && (navigator.appName.indexOf("Netscape") != -1 && navigator.userAgent.indexOf("4.") != -1))?true:false;
var isNS3 = (!isOpera && (navigator.userAgent.indexOf("Netscape") != -1 && navigator.userAgent.indexOf("3.") != -1)) ? true : false;
var isNSDIV = (!isOpera && (isNetscape && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("4.")+2)) > 5)) ? true : false;
var isWin2k = (navigator.userAgent.indexOf("Windows NT") != -1) ? true : false;

if (isIE6) isIE5 = true;

function ora_openWindow(URL,Dimensions,name) {
	var redirectStr = "http://www2.orange.co.uk/cgi-bin/redirect/";
	if(isNetscape && URL.indexOf(redirectStr) != -1) {
		URL = URL.substring(redirectStr.length);
	}
	if(!name) name = "_blank";
	if(!Dimensions) Dimensions = '';
	window.open(URL,name,Dimensions);
}

// Functions to build a popup window
// RPJS - 2002-04-24
// RPJS - 2004-04-21 - added popUps()

//Function to open a popup
function openPopup(popupURL,cancelURL,completeURL,popupTop,popupLeft,popupWidth,popupHeight,popupAttrs) {

	var baseURL = 'http://'+location.hostname+'/';

	if (!popupTop)         { popupTop         = 20};
	if (!popupLeft)        { popupLeft        = 20};
	if (!popupWidth)       { popupWidth       = 640};
	if (!popupHeight)      { popupHeight      = 480};

	cancelURL = baseURL+cancelURL;
	completeURL = baseURL+completeURL;

	if (popupURL.indexOf('?') > 0) {
		popupURL = popupURL+"&_cancel="+escape(cancelURL)+"&_complete="+escape(completeURL)
	} else {
		popupURL = popupURL+"?_cancel="+escape(cancelURL)+"&_complete="+escape(completeURL)
	}
	
	if (isNetscape) {
		popupWin = window.open(popupURL, "emailmadeeasy", popupAttrs);
		popupWin.blur();
		popupWin.moveTo(popupTop,popupLeft);
		popupWin.resizeTo(popupWidth,popupHeight);
		popupWin.focus();
	} else {
		var attrs = new Array;
		attrs[0] = popupAttrs;
		attrs[1] = "left="+popupLeft+",top="+popupTop+",width="+popupWidth+",height="+popupHeight;
		var attrStr = attrs.join(', ');
		popupWin = window.open(popupURL, "emailmadeeasy", attrStr);
		popupWin.focus();
	}

}

function popUp(objAnchor, iWidth, iHeight, iLeft, iTop, sOptions) {

	var sHref = objAnchor.href;
	var sTarget = objAnchor.target;
	iWidth = (iWidth > 0) ? iWidth : 640;
	iHeight = (iHeight > 0) ? iHeight : 480;
	iLeft= (iLeft > 0) ? iLeft : 25;
	iTop = (iTop > 0) ? iTop : 25;
	sOptions = (sOptions && sOptions != '') ? sOptions : 'scrollbars=no,status=no';
	
	sOptions = 'top='+iTop+','+sOptions;
	sOptions = 'left='+iLeft+','+sOptions;
	sOptions = 'height='+iHeight+','+sOptions;
	sOptions = 'width='+iWidth+','+sOptions;
	
	var objWin = window.open(sHref,sTarget,sOptions);
	
}

