///quicklinks dropdown select
function surfto(form) {
	var myindex = form.select1.selectedIndex;
	
	if (form.select1.options[myindex].value != "0") {
		location = form.select1.options[myindex].value;
	}
}

function productPopup(url) {
	var width = 525;
	var height = 350;
	var left = (screen.width-width)/2;
	var top = (screen.height*0.8-height)/2;
		
	newWin = window.open(url, "popup", "width="+width+",height="+height+",toolbar=no,location=no,directories=no,resizable=no,status=no,menubar=no,screenX=100,screenY=100, left="+left+", top="+top);
}

//Dedicated servers sign up popup

function dedicatedPopup() {
	var width = 460;
	var height = 550;
	var left = (screen.width-width)/2;
	var top = (screen.height*0.8-height)/2;
		
	newWin = window.open("https://signup.fasthosts.co.uk/dedicated/signup.exe?choose=2", "dedicatedsignup", "width="+width+",height="+height+",scrollbars=yes,toolbar=yes,location=yes,directories=yes,resizable=yes,status=yes,menubar=yes,screenX=100,screenY=100, left="+left+", top="+top);
}


//Hosting account sign up popup

function hostingSignup (url) {
	var width = 800;
	var height = 600;
	var left = (screen.width-width)/2;
	var top = (screen.height*0.8-height)/2;
		
	newWin = window.open(url, "hostingsignup", "width="+width+",height="+height+",scrollbars=yes,toolbar=yes,location=yes,directories=yes,resizable=yes,status=yes,menubar=yes,screenX=100,screenY=100, left="+left+", top="+top);
}


//Screenshot popup

function screenShot (url) {
	var width = 500;
	var height = 400;
	var left = (screen.width-width)/2;
	var top = (screen.height*0.8-height)/2;
		
	newWin = window.open(url, "screenshot", "width="+width+",height="+height+",scrollbars=no,toolbar=no,location=no,directories=no,resizable=no,status=no,menubar=no,screenX=100,screenY=100, left="+left+", top="+top);
}


// Animates a button when clicked.
// To call, use onClick="startAnim(this);"

var objClickedBtn = '';
var i = 0;
var bolAnimating = false;

function startAnim(btn) {
	if (!bolAnimating) {
		objClickedBtn = btn;
		objClickedBtn.style.backgroundColor = '#999999';
		objClickedBtn.value = 'Please wait   ';
		bolAnimating = true;
		btnanim = setInterval('moretext()', 250);
	}
}
 
function moretext() {
	if (i == 0) {
		objClickedBtn.value = 'Please wait.  ';
	}
	else if (i == 1) {
		objClickedBtn.value = 'Please wait.. ';
	}
	else if (i == 2) {
		objClickedBtn.value = 'Please wait...';
	}
	else if (i == 3) {
		objClickedBtn.value = 'Please wait   ';
		i = -1;
	}
	i++;
}

//Opens a new popup window based on the URL provided

function popupWindow(url) {
	var width = 500;
	var height = 450;
	var left = (screen.width-width)/2;
	var top = (screen.height*0.8-height)/2;
	
	newWin = window.open(url, "FHDetails", "width="+width+", height="+height+", status=no, scrollbars, resizable=no, screenX=20, screenY=40, left="+left+", top="+top);
}

function newWindowResize(url, width, height, name) {
	var left = (screen.width-width)/2;
	var top = (screen.height*0.8-height)/2;
	
	newWin = window.open(url, name, "width="+width+", height="+height+", status=yes, scrollbars, resizable=yes, location=yes, toolbar=yes, menubar=yes, screenX=20, screenY=40, left="+left+", top="+top);
	newWin.focus();
}