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 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);
		}	
	}

}