window.focus();

timer_id = "";




// START FULLSTOP ANIMATOR
		
function mouseover_dots(element_name) {
	add_dots(element_name);
}


function add_dots(element_name) {
	
	current_text = document.getElementById(element_name).innerHTML;
	original_text_length = original_text.length;
	
	if (current_text.substring(original_text.length, current_text.length) == "...") {
		document.getElementById(element_name).innerHTML = original_text;
	} else {
		document.getElementById(element_name).innerHTML = document.getElementById(element_name).innerHTML + ".";
	}
	
	function_call = "add_dots('" + element_name + "')";
	
	if (window.timer_id) {
		clearTimeout(timer_id);
	}
	
	timer_id = setTimeout(function_call,1000);
}


function mouseout_dots(element_name) {
	clearTimeout(timer_id);
	document.getElementById(element_name).innerHTML = original_text;
}

// END FULLSTOP ANIMATOR




// START LAYER VISIBILITY SWITCH

function visibility_switch(id) {
	current_id = document.getElementById(id);
	if (current_id.style.display == "none") {
		current_id.style.display = "block";
	} else {
		current_id.style.display = "none";
	}
}

// END LAYER VISIBILITY SWITCH




// START POP-UP AND CENTRE

function open_popup(url, winName, winWidth, winHeight, status, scrollbars, resizable) {
	popped_window = window.open(url,winName,'toolbar=0,location=0,directories=0,status='+status+',menubar=0,scrollbars='+scrollbars+',resizable='+resizable+',left='+centre(winWidth,screen.availWidth)+',top='+centre(winHeight,screen.availHeight-40)+',width='+winWidth+',height='+winHeight);

	if (popped_window == undefined) {
		window.parent.location.href = "/pop-up-blocker.html";
	}
}

function centre(size,area) {
	return Math.round((area/2)-(size/2));
}

// END POP-UP AND CENTRE
