// JavaScript Document

function buttonChange(obj, new_style) {
	if (new_style == "over") {
		obj.className = "buttonOver";
	}else{
		obj.className = "button";
	}
}

// help window
function helpWindow(screenwidth,screenheight,url,scroll) {
	var winl = ((screen.width - (screenwidth)) / 2)-12;
	var wint = ((screen.height - (screenheight)) / 2)-20;
	
	winprops = 'height='+screenheight+',width='+screenwidth+',top='+wint+',left='+winl+',scrollbars='+scroll+',toolbar=no';
	
	win = window.open('help/'+url, 'wallpaper', winprops);
}

function newWindow(screenwidth,screenheight,url,scroll) {
	var winl = ((screen.width - (screenwidth)) / 2)-12;
	var wint = ((screen.height - (screenheight)) / 2)-20;
	
	winprops = 'height='+screenheight+',width='+screenwidth+',top='+wint+',left='+winl+',scrollbars='+scroll+',toolbar=no';
	
	win = window.open(url, 'wallpaper', winprops); win.focus();
}

function newProductWindow(url) {
	var winl = ((screen.width - 500) / 2)-12;
	var wint = ((screen.height - 600) / 2)-20;

	win = window.open(url, 'producten', 'height=600,width=500,top='+wint+',left='+winl+',scrollbars=NO,toolbar=no'); win.focus();
}

function paperOpen(screenwidth,screenheight,url,title,link) {
	if (screenwidth == "640") {
		screenheight = 480;
	}else if (screenwidth == "800") {
		screenheight = 600;
	}else if (screenwidth == "1024") {
		screenheight = 768;
	}else {
		screenheight = 864;
	}
	var winl = ((screen.width - (screenwidth)) / 2)-12;
	var wint = ((screen.height - (screenheight)) / 2)-20;
	window.open("wallpaper.php?id="+title+"&size="+screenwidth+"&style="+ url+"&link="+link, 'wallpaper', 'height='+screenheight+',width='+screenwidth+',top='+wint+',left='+winl+',scrollbars="auto');
}


function doLogin() {
	if (document.getElementById('login_username').value == "username") {
				alert(":::: FOREVERFRIENDS MESSAGE :::: \n\nPlease type your foreverfriends username and password in the boxes provided");	
				return false;
	}else{
		if (document.getElementById('login_remember').checked) {
			if (window.confirm(":::FOREVERFRIENDS MESSAGE::: \n\nYour username and password will be stored on this computer\n\nIf this is a shared computer you may not want to use this option.\n\nIf you choose to be remembered, every time you visit foreverfriends.co.uk you will be automatically logged in.\n\nClick 'OK' to continue or Click 'CANCEL' to login normally\n\nPlease note: You can deactivate this feature at any time by clicking 'log out'.")) {
				return true;
			} else {
				document.getElementById('login_remember').checked = false;
				return true;
			}
		}else{
			return true;
		}
	}
}

// nedstat:

function sitestat(ns_l){ns_l+='&amp;ns__t='+(new Date()).getTime();ns_pixelUrl=ns_l;
ns_0=document.referrer;
ns_0=(ns_0.lastIndexOf('/')==ns_0.length-1)?ns_0.substring(ns_0.lastIndexOf('/'),0):ns_0;
if(ns_0.length>0)ns_l+='&amp;ns_referrer='+escape(ns_0);
if(document.images){ns_1=new Image();ns_1.src=ns_l;}else
document.write('<img src="'+ns_l+'" width="1" height="1" alt="">');}

