var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try
{
	var pageTracker = _gat._getTracker("UA-9125043-2");
	pageTracker._trackPageview();
} catch(err) {}

function exec_registration() { window.location.href="index.php?action=registration&method="+method_JS; }

function register()
{
	var a = document.getElementById('a').value;
	var b = document.getElementById('b').value;
	var c = document.getElementById('c').value;
	var i = document.getElementById('i').value;

	var err = 0;

	if (a=='') { document.getElementById('a').style.backgroundColor="#ffb4b4"; err++; }
		else { document.getElementById('a').style.backgroundColor=""; }

	if (b=='') { document.getElementById('b').style.backgroundColor="#ffb4b4"; err++; }
		else { document.getElementById('b').style.backgroundColor=""; }

	if (c=='') { document.getElementById('c').style.backgroundColor="#ffb4b4"; err++; }
		else { document.getElementById('c').style.backgroundColor=""; }

	if (i=='') { document.getElementById('i').style.backgroundColor="#ffb4b4"; err++; }
		else { document.getElementById('i').style.backgroundColor=""; }

	if (b!=c) { document.getElementById('b').style.backgroundColor="#ffb4b4";
		document.getElementById('c').style.backgroundColor="#ffb4b4";
		document.getElementById('b').value='';document.getElementById('c').value=''; err++; }
		
	if (err==0) { document.registration.submit(); }
}

function logout() { window.location.href="index.php?action=logout&method="+method_JS; }

function exec_my_adverts() { window.location.href="index.php?action=my_adverts&method="+method_JS; }

function exec_my_information() { window.location.href="index.php?action=my_information&method="+method_JS; }

function addadv()
{
	var a = document.getElementById('a').value;
	var err = 0;

	if (a=='') { document.getElementById('a').style.backgroundColor="#ffb4b4"; err++; }
		else { document.getElementById('a').style.backgroundColor=""; }

	if (err==0) { document.forms['addform'].submit(); }
}
	
function edit_information()
{
	var d = document.getElementById('d').value;
	var e = document.getElementById('e').value;
	var f = document.getElementById('f').value;
	var g = document.getElementById('g').value;
	var h = document.getElementById('h').value;
	var i = document.getElementById('i').value;
	var j = document.getElementById('j').value;

	var err = 0;

	if (d=='') { document.getElementById('d').style.backgroundColor="#ffb4b4"; err++; }
		else { document.getElementById('d').style.backgroundColor=""; }

	if (e=='') { document.getElementById('e').style.backgroundColor="#ffb4b4"; err++; }
		else { document.getElementById('e').style.backgroundColor=""; }

	if (f=='') { document.getElementById('f').style.backgroundColor="#ffb4b4"; err++; }
		else { document.getElementById('f').style.backgroundColor=""; }

	if (g=='') { document.getElementById('g').style.backgroundColor="#ffb4b4"; err++; }
		else { document.getElementById('g').style.backgroundColor=""; }

	if (h=='') { document.getElementById('h').style.backgroundColor="#ffb4b4"; err++; }
		else { document.getElementById('h').style.backgroundColor=""; }

	if (i=='') { document.getElementById('i').style.backgroundColor="#ffb4b4"; err++; }
		else { document.getElementById('i').style.backgroundColor=""; }

	if (j=='') { document.getElementById('j').style.backgroundColor="#ffb4b4"; err++; }
		else { document.getElementById('j').style.backgroundColor=""; }

	if (err==0) { document.my_information.submit(); }
}

function cpass()
{
	var a = document.getElementById('a').value;
	var b = document.getElementById('b').value;
	var c = document.getElementById('c').value;

	var err = 0;

	if (a=='') { document.getElementById('a').style.backgroundColor="#ffb4b4"; err++; }
		else { document.getElementById('a').style.backgroundColor=""; }

	if (b=='') { document.getElementById('b').style.backgroundColor="#ffb4b4"; err++; }
		else { document.getElementById('b').style.backgroundColor=""; }

	if (c=='') { document.getElementById('c').style.backgroundColor="#ffb4b4"; err++; }
		else { document.getElementById('c').style.backgroundColor=""; }

	if (b!=c) { document.getElementById('b').style.backgroundColor="#ffb4b4";
		document.getElementById('c').style.backgroundColor="#ffb4b4";
		document.getElementById('b').value='';document.getElementById('c').value=''; err++; }
		
	if (err==0) { document.change_password.submit(); }
}

function exec_edit_advert()
{
	var a = document.getElementById('a').value;
	var err = 0;

	if (a=='') { document.getElementById('a').style.backgroundColor="#ffb4b4"; err++; }
		else { document.getElementById('a').style.backgroundColor=""; }

	if (err==0) { document.edit_advert.submit(); }
}

function delete_advert100p() { window.location.href="index.php?action=delete_advert100p&id="+id_JS+"&method="+method_JS; }
