/*
BTI global JavaScript 6/8/00
Documentation at http://www.btinternet.com/new/global/bti.txt
*/

// frames + pzn
/*if (top == self && location.hostname != 'web') {
	window.location.replace('http://www.btinternet.com/?' + window.location.href);
	}*/
/*else {
	var now = new Date;
	var rnd = 'rnd=' + now.getMilliseconds();
	var loc = 'url=' + self.location + '&';
	var pzn = new Image;
	var pznsrc = 'http://www.btopenworld.com/pzn/btinternet/generic/pixel.gif?';
	pzn.src = pznsrc + loc + 'status=start&' + rnd;
	self.onload = function() { pzn.src = pznsrc + loc + 'status=load&' + rnd; }
	}*/

// spawn window
function pop(url, name, width, height, features) {
	popWin = window.open(url, name, 'width=' + width + ',height=' + height + ',resizable' + ((features) ? ',' + features : ''));
	if (window.focus) setTimeout("popWin.focus()",100);
	}
	
// cookies ## changed arg order expires/path 24/10/00 ##
function setCookie(name,value,path,expires,domain,secure) {
	document.cookie = name + '=' + escape(value) + ((path) ? ';path=' + path : '') + ((expires) ? ';expires=' + expires.toGMTString() : '') + ((domain) ? ';domain=' + domain : '') + ((secure) ? ';secure' : '');
	}

function getCookie(name) {
	var start = document.cookie.indexOf(name+'=');
	var len = start+name.length+1;
	if ((!start && name != document.cookie.substring(0,name.length)) || start == -1) return null;
	var end = document.cookie.indexOf(";",len);
	if (end == -1) end = document.cookie.length;
	return unescape(document.cookie.substring(len,end));
	}

// rollovers
var directory;

function preload() {
	if (!document.images) return;
	directory = arguments[0];
	var cacheArray = new Array;
	for (var i=1; i<arguments.length; i++) {
		cacheArray[i] = new Image;
		cacheArray[i].src = directory + '/' + arguments[i];
		}
	}

function imgSwap(w,s) { if (document.images) eval("document[w].src = '" + directory + '/' + s + "'"); }

// wrapper type 1 -> no popup without wrapper
// wrapper type 1 -> popup without wrapper
// wrapper type 2 -> popup with wrapper
// wrapper type 3 -> no popup with masthead

function makeWin(site,pznurl,masthead,wrapperType,width,height,adbanner)
{
	var winName = Math.round(Math.random()*100000000);
	var currDate = new Date();
	var time = currDate.getMilliseconds();

	if (wrapperType==0) {
		var pznimg = new Image;
		pznimg.src = "/pzn/jump/pixel.gif?path=" +pznurl+ "&time=" +time;
		var newurl = site;
		document.location = newurl;
	} else if (wrapperType==3) {
		var pznimg = new Image;
		pznimg.src = "/pzn/jump/pixel.gif?path=" +pznurl+ "&time=" +time;
		var newurl = "/common/wrapperv2/jump_page/0,4333,1,00.html?site=" + site + "&masthead=" + masthead + "&pznPath=" + pznurl;
		document.location = newurl;
	} else if (wrapperType==4) {
		var pznimg = new Image;
		pznimg.src = "/pzn/jump/pixel.gif?path=" +pznurl+ "&time=" +time;
		var newurl = site;
//		document.location = newurl;		
		var popupref = window.open(newurl, winName, 'scrollbars=no,width=' + width + ',height=' + height + ',resizable=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no');
	} else {
		if (wrapperType==1) {
			var newurl = "/common/wrapperv2/jump_page/0,4333,0,00.html?site=" + site + "&masthead=" + masthead + "&pznPath=" + pznurl;
		} else if (wrapperType==2) {
			var newurl = "/common/wrapperv2/jump_page/0,4333,1,00.html?site=" + site + "&masthead=" + masthead + "&pznPath=" + pznurl;
		}
		var popupref = window.open(newurl, winName, 'scrollbars=no,width=' + width + ',height=' + height + ',resizable=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no');
		popupref.focus();
	}
}
