//disable Right click
function right( val ) {
  if (navigator.appName == 'Netscape' && (val.which == 3 || val.which == 2))
    return false;
  else if (navigator.appName == 'Microsoft Internet Explorer' && 
          (event.button == 2 || event.button == 3)) {
    alert("Renovate.com.sg. All Rights Reserved. ");
    return false;
  }
  return true;
}

document.onmousedown = right;
document.onmouseup = right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown = right;
window.onmouseup = right;
//-->

function NewWindow(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function tc() {
		window.open('#',"win","width=680,height=500,menubar=0,scrollbars=Auto,resizable=no");
}

//Validation form

function validate_email(field,alerttxt)
	{
		with (field)
	{
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
			if (apos<1||dotpos-apos<2) 
  				{alert(alerttxt);return false}
			else {return true}
		}
	}

function validate_required(field,alerttxt)
	{
		with (field)
	{
		if (value==null||value=="")
 			 {alert(alerttxt);return false}
		else {return true}
		}
	}

function validate_number(field,alerttxt){
	with (field)
	{
	var x=value
	var anum=/(^\d+$)|(^\d+\.\d+$)/
		if (anum.test(x))
			return true
		else{
			alert(alerttxt);return false}
	}
}


function validate_form(thisform)
	{
		with (thisform)
	{
		if (validate_required(Name,"Name must be filled out!")==false)
 			 {Name.focus();return false}
		if (validate_number(Tel,"Not a valid telephone number!")==false)
 			 {Tel.focus();return false}
		}
	}

// End of Validation Form-->

function soundcontrol(){
        document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="220" height="25">\n');
        document.write('<param name="movie" value="sound.swf">\n');
        document.write('<param name="quality" value="high">\n');
        document.write('<embed src="sound.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="220" height="25"></embed>\n');
        document.write('</object>\n');
}

function portfolio() {
	location.href= "bathroom.php";
}

function services() {
	location.href= "door1.php";
}
