var country;
var region;
var city;

if (typeof(google.loader.ClientLocation.address.city) != null) {
 	
	country=google.loader.ClientLocation.address.country_code;
	city=google.loader.ClientLocation.address.city;
	region=google.loader.ClientLocation.address.region;
  
} else {

	country='';
	city='';
	region='';
  
}

function geo_distance () {

	rand = Math.floor(Math.random()*11);

	document.write('Within ' + rand + ' miles from<br>' + city + ", <br>" + region);
	
}

function geo_distance_nl () {

	rand = Math.floor(Math.random()*11);

	document.write(rand + ' kilometer van<br>' + city + ", <br>" + region);
	
}

function geo_distance_es () {

	rand = Math.floor(Math.random()*11);

	document.write('A menos de ' + rand + ' kilometros<br>de ' + city + ", <br>" + region);
	
}

function geo_distance_de () {

	rand = Math.floor(Math.random()*11);

	document.write('Innerhalb ' + rand + ' Kilometer<br>von ' + city + ", <br>" + region);
	
}

document.body.onload = register_screen (google.loader.ClientLocation.address.country_code);

function register_screen (geo) {

	new Ajax.Request ('http://www.localxxxdates.com/getiton.com/view.php', {
		method: 'get',
		
		//onComplete: function(transport) {
		//	alert (transport.responseText);
		//},
		
		parameters: { country: geo, width: screen.width, height: screen.height, tracking: as, page: t } 
		
	} );

}

function lch (url) { 

	sw=screen.width;sh=screen.height;
	if (country && as && t && sw && sh) {
		u=Base64.encode(url);
		var durl; durl='click.php?u=' + Base64.encode('u=' + u + '&c=' + country + '&a=' + as + '&p=' + t + '&sh=' + sh + '&sw=' + sw);
		var turl; var th;
		dlinkz = document.getElementsByName("dlink");	
		for (var i=0; i<dlinkz.length; i++) {		
			dlinkz.item(i).setAttribute('href', durl);
		}	
		tlinkz = document.getElementsByName("tlink");	
		for (var i=0; i<tlinkz.length; i++) {
			th = tlinkz.item(i).getAttribute('id');
			turl='click.php?u=' + Base64.encode('u=' + u + '&c=' + country + '&a=' + as + '&p=' + t + '&sh=' + sh + '&sw=' + sw + '&th=' + th);
			tlinkz.item(i).setAttribute('href', turl);
		}	
	}

}