

// maximize window
function maximize() {
	window.top.moveTo(0,0);
	var w = screen.availWidth;
	var h = screen.availHeight;
	window.top.resizeTo(w, h);
}

// popup window
function popup(name,url,width,height) {
	var x = (screen.availWidth-width)/2;
	var y = (screen.availHeight-height)/2;
	newWindow = window.open(url,name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height+',top='+y+',left='+x+"'");
	newWindow.focus();
}
// popup window
function popupResize(name,url,width,height) {
	var x = (screen.availWidth-width)/2;
	var y = (screen.availHeight-height)/2;
	newWindow = window.open(url,name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height+',top='+y+',left='+x+"'");
	newWindow.focus();
}

// launch popup window
function launch() {
	var w = screen.width;
	if (w <= 800) {
		window.location.href('ldi_same.htm');
	} else {
		skipDetection();
	}
}

// skip detection
function skipDetection() {
	var w = screen.width;
	if (w <= 800) {
		window.location.href('ldi_same.htm');
	} else {
		popup('tossB', 'ldi_full.htm', screen.availWidth, screen.availHeight);
		
		redirect();
	}
}

// redirect
function redirect() { 
	setTimeout('thanks();', 5000);
}

// thanks
function thanks() { 
	window.location.href = 'goodbye.htm';
}

var loaded = new Array();

function imgPreload(image,imageName) {
	if (image && image.src && (null == image.out || typeof(image.out) == typeof(void(0)))) {
		s = image.src;
		image.out = new Image();
		image.out.src = s;
		image.over = new Image();
		if (imageName.lastIndexOf('/') >= 0 || imageName.lastIndexOf('\\') >=0) {
			s = imageName;
		} else {
			i = s.lastIndexOf('/');
			if (i<0) {
				i = s.lastIndexOf('\\');
			}
			if (i<0) { 
				s = imageName; 
			} else { 
				s = s.substring(0,i+1) + imageName; 
			}
		}
		image.over.src = s;
		loaded[image.name] = image;
	}
}

function imgSwop(imageName,over) {
	if (document.images) {
		if (over) { 
			imageObject = "over"; 
		} else { 
			imageObject = "out"; 
		}
		image = loaded[imageName];
		if (image) {
			ref = eval("image."+imageObject);
			if (ref) {
				image.src = eval("image."+imageObject+".src");
			}
		}
		if (window.event) {
			window.event.cancelBubble = true;
		}
	}
		
}