// <--
// ------------------------------ Frame rollover functions -------------------------------------- //
var siteText = [
					'<h1>Welcome to Sitges.me</h1><p>Please run your mouse over a frame to learn more, or click on a frame to visit the site.</p>',
					'<h1>Sitges Web Design</h1><p>Our Graphic & Web Design company offering major & low cost websites from within Sitges and Barcelona.</p>', 
					'<h1>Sitges Club</h1><p>A free, invite only, private members social club for residents in Sitges, near Barcelona, Spain. A resource for social and business networking.</p>', 
					'<h1>Sitges Events</h1><p>A resource to list all Sitges Events, near Barcelona, for local residents & visitors. Reviews, photos and advice on where to be, for the best experience.</p>', 
					'<h1>Sitges Holidays</h1><p>Offers budget users everything needed to go it alone, & a hand made holiday service, for bigger budgets, using our local knowledge.</p>', 
					'<h1>Sitges Property</h1><p>Free ads of land and Property for sale in Sitges, near Barcelona. Vendors can pay for an advanced advert if they wish.</p>', 
					'<h1>Sitges Lettings</h1><p>Free ads of land and Property for let in Sitges, near Barcelona. Vendors can pay for an advanced advert if they wish.</p>', 
					'<h1>Business Site Maker</h1><p>Just sign up and off you go. Site LIVE in minutes. Perfect for bars, hotels, business start-ups, Choose from a range of designs.</p>', 
				];   // rollover text

// Change the mouseover image
function textDisplay(site) {
	document.getElementById("frame").innerHTML = siteText[site];
}

// reset the mouseover image
function textReset() {
	document.getElementById("frame").innerHTML = siteText[0];
}

// ------------------------------ Roller Over Image Functions -------------------------------------- //
function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '-o'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('-o'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

window.onload = initRollovers;

// ------------------------------------ Image pop ups --------------------------------------- //
function popup(url,name,height,width) {
	var newWindow = window.open(url, name, "height="+height+",width="+width+",toolbar=no,menubar=no,scrollbars=yes,resizable=yes,status=no");
	newWindow.focus();
	return newWindow;
}

// -------------------------------- Show Progress of Upload ---------------------------------- //
function showProgress() {
	document.getElementById('uploadprogress').style.display = 'block';    
   	return true;
}

// --------------------------------------- Stop a Link --------------------------------------- //
function stopLink() {
	alert('You can only book one slot, to book another slot you must first delete your existing slot');
	
	return false;
}

// --------------------------------------- Print Page --------------------------------------- //
function printPage() {
	window.print();  
}

// --------------------------------------- Submit Form --------------------------------------- //
function submitForm()
{
  document.form.submit();
}
// -->