// JavaScript Document
// Roma Palace Restaurant Hours


function getMyMonth(month)
{
	switch (month)
	{
		case 0:		
			return "January";		
			break;
		case 1:		
			return "February";		
			break;
		case 2:		
			return "March";			
			break;
		case 3:		
			return "April";			
			break;
		case 4:
			return "May";			
			break;
		case 5:		
			return "June";			
			break;					
		case 6:		
			return "July";			
			break;
		case 7:		
			return "August";		
			break;
		case 8:		
			return "September";		
			break;
		case 9:		
			return "October";		
			break;
		case 10:	
			return "November";		
			break;
		case 11:	
			return "December";		
			break;
	}
}

			
function getMyDay (day)
{
	switch (day)
	{
		case 0: 
			return "Sunday";
			break;
		case 1: 
			return "Monday";
			break;
		case 2: 
			return "Tuesday";
			break;
		case 3:
			return "Wednesday";
			break;
		case 4:
		 	return "Thursday";
			break;
		case 5:
			return "Friday";
			break;
		case 6:
			return "Saturday";
			break;
	}
				
}

								
function ourHours (day)
{
	switch (day)
	{
		case 0: 
			document.write("Our Office is Closed Today");
			break;
		case 1: 
			document.write("Office Hours: 9:00 am - 5:00 pm");
			break;
		case 2: 
			document.write("Office Hours: 9:00 am - 5:00 pm");
			break;
		case 3:
			document.write("Office Hours: 9:00 am - 5:00 pm");
			break;
		case 4:
			document.write("Office Hours: 9:00 am - 5:00 pm"); 
			break;
		case 5:
			document.write("Office Hours: 9:00 am - 5:00 pm"); 
			break;
		case 6:
			document.write("Our Office is Closed Today");  
			break;
	}
				
}	




function popUp(url){
	window.open(url, "pop","width=650,height=500,toolbars=0,scrollbars=1")
}

function open_win(url) 
{
window.open(url, "_blank", "width=650,height=500,toolbars=0,scrollbars=1,fullscreen=no");
}


function validateForm(thisform)
{
	valid2 = true;
	
	var alertMessage = "_______________________________________________________________\n\n";
	alertMessage    += "This form was not sent, because of some error(s).\n";
	alertMessage    += "Please fix these error(s), and submit the form again. Thanks. \n";	
	alertMessage    += "_______________________________________________________________\n\n";
	
	with (thisform)
  		{
  			/* VALIDATING the Name Field */
			if (Name.value == "")
			{
				changeBackground (Name);
				alertMessage += "Please enter Your Name.\n";
				valid2 = false;
			}
			
			else
				changeBackground1 (Name);
			
			
			/* VALIDATING the Phone Field */
			if (Phone1.value == "" || Phone2.value == "" || Phone3.value == "")
			{
				changeBackground (Phone1);
				changeBackground (Phone2);
				changeBackground (Phone3);
				alertMessage += "Enter a Phone No. like: 123-456-7890\n";
				valid2 = false;
			}
			
			else
			{
				changeBackground1 (Phone1);
				changeBackground1 (Phone2);
				changeBackground1 (Phone3);	
			}
				
				
			
			/* VALIDATING the Email Field */
			if (Email.value == "")
			{
				changeBackground (Email);
				alertMessage += "Enter an Email like: myname@email.com\n";
				valid2 = false;
			}
			else
				changeBackground1 (Email);
				
			
		}
		
		
		alertMessage    += "\n\n_______________________________________________________________\n";
		alertMessage    += "Copyright (C) 2010 - M&A Law Firm";		
		
		if (valid2 == false)
			alert (alertMessage);
		
		return valid2;
}


/* Function to change the background color of the field, 
   that doesn't have a valid value. 
*/		
function changeBackground (fld)
{
	fld.style.background = 'Yellow';
}


function changeBackground1 (fld)
{
	fld.style.background = 'White';
}




/* ------------------------------------------------------------------------------
   	FOR AUTO SHIFT OF THE TELEPHONE NUMBER FIELDS 
   ------------------------------------------------------------------------------ */
function autotab(current,to){
    if (current.getAttribute && 
      current.value.length==current.getAttribute("maxlength")) {
        to.focus() 
        }
}







// (C) 2003 CodeLifter.com
// Source: CodeLifter.com
// Do not remove this header

// Set the message for the alert box
am = "_____________________________________________________\nSorry, this function is Disabled!\nCopyrights (C) 2010 - M&A Law Firm\n_____________________________________________________";

// do not edit below this line
// ===========================
bV  = parseInt(navigator.appVersion)
bNS = navigator.appName=="Netscape"
bIE = navigator.appName=="Microsoft Internet Explorer"

function nrc(e) {
   if (bNS && e.which > 1){
      alert(am)
      return false
   } else if (bIE && (event.button >1)) {
     alert(am)
     return false;
   }
}

document.onmousedown = nrc;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (bNS && bV<5) window.onmousedown = nrc;
		
		
		
		
		
		
		
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];}
}
		
		
					
