var result = null;
			
	

function insertContact(theName, linkText)
{
	theDomain = 'hydegate' + 'petresort' + '.co.uk';
	theAddress = theName + "&#064;" + theDomain;

	document.write("<A class='menu' HREF=\"mailto");
	document.write(":" + theAddress);
	document.write( "\">" + linkText + "<\/a>");
}

function showEmail(theName)
{
	theDomain = 'hydegate' + 'petresort' + '.co.uk';
	theAddress = theName + "&#064;" + theDomain;
	document.write("<A HREF=\"mailto" + ":" + theAddress + "\">" + theAddress + "<\/a>");
	return (showEmail);
}


function openWindow(url, width, height) 
{
	var winW = 630;

	if (parseInt(navigator.appVersion)>3) 
	{
 		if (navigator.appName=="Netscape") 
  			winW = window.innerWidth;
 		if (navigator.appName.indexOf("Microsoft")!=-1) 
 		{
  			winW = document.body.offsetWidth;
  			winW += 100;	// just because it is Microsoft
  		}
	}
	
	newWindow = window.open(url,"newWindow","width="+width+",height="+height+",top=100,left="+(winW - width - 50));
	newWindow.focus();
	
	return newWindow;
}


// image handling

var preloadFlag = false;
function preloadImages() 
{
	if (document.images) 
	{
		pre_guarantee = newImage('Images/guarantee.jpg');
		preloadFlag = true;
	}
}

function newImage(arg) 
{
	if (document.images) 
	{
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImagesArray(array) 
{
	if (preloadFlag == true) 
	{
		var d = document; var img;
		for (var i=0; i<array.length; i+=2) 
		{
			img = null; 
			var n = array[i];
			if (d.images) 
				img = d.images[n];
			if (!img && d.getElementById) 
				img = d.getElementById(n);
			
			if (img) 
				img.src = array[i+1];
		}
	}
}

function changeImages() 
{
	changeImagesArray(changeImages.arguments);
}


function copyValueToParentWindow(radioButtonValue)
{
	window.opener.result = radioButtonValue;
	return;
}

function handleLuxury()
{
/*	result = '';
	openWindow('luxury.html','400','400'); 
	
	if (result == 'more') */
		location.href='luxury-apartment.shtml'; 
	return false;
}
	
function handleTestimonial()
{
/*	result = '';
	openWindow('testimonial.html','420','600'); 
	
	if (result == 'more') */
		location.href='testimonials.shtml'; 
	return false;
}

function Callback(newpage)
{
	location.href = newpage;
}