function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//Search boxes
function checksearch() {
	if (document.searchform.query.value == "Search") {
		alert("Please enter a search word before submitting.");
		return;
	}
	else if (document.searchform.query.value == "") {
		alert("Please enter a search word before submitting.");
		return;
	}
	else {
		document.searchform.submit();
	}
}                 
function logincheck() {
	if (loginform.name.value == "") {
		alert("Please enter your name before pressing 'GO'.");
	}
	else if (loginform.password.value == "") {
		alert("Please enter your password before pressing 'GO'.");
	}
	else {
		document.loginform.submit();
	}
}
function reloader(){
//	document.form["theform"].submit();
	document.getElementsByName('theform')[0].submit();
}
function submit_form(formname){
	document.getElementsByName(formname)[0].submit();
}
function feedback(feedbacktext){
	if ((feedbacktext != null) && (feedbacktext != "")) {
		alert(feedbacktext);
	}
}
function passwordconfirm(hash, pwd, pwdconfirm){
	if(document.getElementById(pwd).value != hash){
		if(document.getElementById(pwd).value != document.getElementById(pwdconfirm).value){
			alert("The passwords do not match");
			return false;
		}
		else {
			return true;
		}
	}
	else {
		return true;
	}
}
function clearfill_search(term) {
	if (document.searchform.query.value == term) {
		window.document.searchform.query.value = "";
	}
	else if (document.searchform.query.value == "") {
		window.document.searchform.query.value = term;
	}
}
function MM_checkPlugin(plgIn, theURL, altURL, altTAG, autoGo) { //v4.0
  var ok=false; document.MM_returnValue = false;
  with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) {
    ok=(plugins && plugins[plgIn]);
  } else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
    if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
    else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
    else ok=autoGo; }
	
	if (!ok) {
		the_code = "<img src='" + altURL + "'  width='600' height='200' alt='" + altTAG + "' usemap='#get_flash'>";
		return;
	}
	
	if (theURL) {
		the_code="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='600' height='200'>";
		the_code += "<param name='movie' value='" + theURL + "'>";
		the_code += "<param name='quality' value='high'>";
		the_code += "<embed src='" + theURL + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='600' height='200'>";
		the_code += "</embed></object>";	
	}
}
with (navigator) if (appName.indexOf('Microsoft')!=-1 && appVersion.indexOf('Mac')==-1) document.write(''+
'<scr'+'ipt language="VBScript">\nOn error resume next\n'+
'MM_dir = IsObject(CreateObject("SWCtl.SWCtl.1"))\n'+
'MM_flash = NOT IsNull(CreateObject("ShockwaveFlash.ShockwaveFlash"))\n</scr'+'ipt>');

MM_checkPlugin('Shockwave Flash','images/ugo_anim.swf','images/laundry_static.jpg','UGO - Be where you want to be',true);

function enable_delete_button(id){
	if(document.getElementById('delete_' + id).disabled == true){
		document.getElementById('delete_' + id).disabled = false;
	}
	else if(document.getElementById('delete_' + id).disabled == false){
		document.getElementById('delete_' + id).disabled = true;
	}
}
function openwindow(path){
  	open(path,'windowname','width=800,height=600,scrollbars,resizable');
    //w.document.write("This is a new window");
	//w.document.write("<img src='" + document.getElementById('building_image').value + "'>");
	//w.document.write(document.getElementById('building_image').value);
}
function ccsubmitresize() {
	document.ccresizeform.submit();
	showccprocessing();
}

function showccprocessing() {
	//setTimeout(showsearchloading,1000); 
	if (! document.getElementById('spinnerdiv') || ! document.getElementById('searchimage')) {
		
		spinnerdiv = document.createElement('div');
		spinnerdiv.setAttribute('id', 'spinnerdiv');
		spinnerdiv.setAttribute('class', 'spinner');
		spinnerdiv.setAttribute('className', 'spinner');
		spinnerdiv.innerHTML = "<h1>Processing...</h1>";
	
		document.body.appendChild(spinnerdiv);
	}
}


function submitlogin($fn) {
	
	if(!$fn) {
		$fn = "login_form";
	}
	
	if (document.getElementById($fn).email.value == "Email Address" || document.getElementById($fn).password.value == "Password") {
		alert("Please enter your Email Address and Password before logging in.");
	}
	else {
		document.getElementById($fn).submit();
	}
}

function clearfill_email($fn) {
	if(!$fn) {
		$fn = "login_form";
	}
	var $formname = eval("window.document."+$fn+".email");
	
	if ($formname.value == "Username or Email") {
		$formname.className = "inputwhite";
		$formname.value = "";
	}
	else if ($formname.value == "") {
		$formname.className = "inputblue";
		$formname.value = "Username or Email";
	}
}






function clearfill_password($fn) {
	if(!$fn) {
		$fn = "login_form";
	}
	var $formname = eval("window.document."+$fn+".password");

if ($formname.value == "Password") {
		$formname.type = "password";
		$formname.className = "inputwhite";
		$formname.value = "";
	}
	else if ($formname.value == "") {
		$formname.type = "text";
		$formname.className = "inputblue";
		$formname.value = "Password";
	}
}


function confirm_submit($msg) {
	var $agree = confirm($msg);
	if ($agree) return true;
	else return false;
}

function current_currency() {
	if(document.getElementById('CountryId').value > 4) {
		$curr = "&euro;";
	}
	else {
		$curr = "&pound;";
	}
	document.getElementById('currencya').innerHTML = $curr;
	document.getElementById('currencyb').innerHTML = $curr;
	
	
}