function $(id) {
	return document.getElementById(id);
}

function showPol(that) {
	//alert(that.id+'b');
	$(that.id+'b').style.display = 'block';
}

function hidePol(that) {
	$(that.id+'b').style.display = 'none';
}

function makeSubmit(){
	$('submitbutton').src = 'gfx/loading.gif';
	$('submitbutton').onclick = function none(){};
	$('recform').submit();
}

function on(that, co){
	that.src = 'gfx/'+co+'_h.jpg';
}
function off(that, co){
	that.src = 'gfx/'+co+'.jpg';
}

function selectGrabber(that) {
	if (that.id == 'msnlogo') {
		$('gtypemsn').checked = true;
	}
	else if (that.id == 'gmaillogo') {
		$('gtypegmail').checked = true;
	}
	else if (that.id == 'yahoologo') {
		$('gtypeyahoo').checked = true;
	}
	//alert(that.id);
	
	if ($('gtypemsn').checked == true) {
		$('msnlogo').style.border = '2px solid #58595B';
		$('gmaillogo').style.border = 'none';
		$('yahoologo').style.border = 'none';
	}
	else if ($('gtypegmail').checked == true) {
		$('msnlogo').style.border = 'none';
		$('gmaillogo').style.border = '2px solid #58595B';
		$('yahoologo').style.border = 'none';
	}
	else if ($('gtypeyahoo').checked == true) {
		$('msnlogo').style.border = 'none';
		$('gmaillogo').style.border = 'none';
		$('yahoologo').style.border = '2px solid #58595B';
	}
	else {
		$('msnlogo').style.border = 'none';
		$('gmaillogo').style.border = 'none';
		$('yahoologo').style.border = 'none';
	}
}

function selectAll() {
	var inputs = document.getElementsByTagName('input');
	for (var i=0;i<inputs.length;i++) {
		if (inputs[i].type == 'checkbox') {
			inputs[i].checked = true;
		}
	}
}

function deselectAll() {
	var inputs = document.getElementsByTagName('input');
	for (var i=0;i<inputs.length;i++) {
		if (inputs[i].type == 'checkbox') {
			inputs[i].checked = false;
		}
	}
}

function addthem() {
	var inputs = document.getElementsByTagName('input');
	//alert('dziala');
	$('remail').value = '';
	for (var i=0;i<inputs.length;i++) {
		if (inputs[i].type == 'checkbox') {
			if (inputs[i].checked == true) {
				//alert(inputs[i].value);
				//break;
				$('remail').value = $('remail').value + inputs[i].value + ',';
				
			}  
		}
	}
	var value = $('remail').value;
	$('remail').value = value.substr(0,(value.length-1));  
	$('added').innerHTML = 'Thank you for using our service.';
	$('added').style.border = '1px solid #0A0';
}

function grabform() {
	var trs = document.getElementsByTagName('tr');
	for (var i=0;i<trs.length;i++) {
		if (trs[i].className == 'gtr')
			trs[i].className = 'gtrs';
		else if (trs[i].className == 'gtrs')
			trs[i].className = 'gtr';
	}
}