function vendorImage(content) {

	var foreground= document.getElementById('vendorimage');
	foreground.style.display = "block";

	var background= document.getElementById('container');
	background.style.opacity = "0.25";
//	background.style.-moz-opacity = "0.25";
	background.style.filter = 'alpha(opacity=25)';

	document.getElementById('vendorimage').innerHTML = content	
}

function pageSubmit(x,z) {
	document.getElementById('begin').value = x;
	document.hiddensearch.submit();
}

function sendMail(email) {
	document.location = 'mailto:' + email;
}

function showLoading(button) {
	button.style.backgroundImage = 'url(/pix/layout/loading-arrows_12x12.gif)';
	button.style.color = '#676561';
	wait(400);  // Else the form will submit before the background image changes
	return true;
}

function wait(ms) {
	var date = new Date();
	var curDate = null;

	do {
		curDate = new Date();
	} while(curDate - date < ms);
}

function changeBackground() {
	document.getElementById('body').className='black'
	document.getElementById('container').className='plain'
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function checkAll() {
	var field = document.forms['rs'].elements['Advertisers[]'];
	if (! field.length) {
		field = document.forms['rs'].elements;
	}
	for (i = 0; i < field.length; i++) {
		field[i].checked = true;
	}

	field = document.forms['rs'].elements['Editorial[]'];
	if (! field.length) {
		field = document.forms['rs'].elements;
	}
	for (i = 0; i < field.length; i++) {
		field[i].checked = true;
	}
}

function uncheckAll() {
	var field = document.forms['rs'].elements['Advertisers[]'];
	if (! field.length) {
		field = document.forms['rs'].elements;
	}
	for (i = 0; i < field.length; i++) {
		field[i].checked = false;
	}

	field = document.forms['rs'].elements['Editorial[]'];
	if (! field.length) {
		field = document.forms['rs'].elements;
	}
	for (i = 0; i < field.length; i++) {
		field[i].checked = false;
	}
}
