var MessageText = "Welcome to Ez Tax Preparation"
window.status = MessageText;

function Location()
 {
window.open ("http://www.mapquest.com/maps/map.adp?country=US&countryid=US&addtohistory=&searchtab=address&searchtype=address&address=4882+Mayde+Court&city=Fairfax&state=VA&zipcode=22030&search=++Search++","mywindow","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=yes,resizable=yes,width=800,height=450,left=5,top=50");
}

function makeArray() 
{
     for (i = 0; i<makeArray.arguments.length; i++)
         this[i] = makeArray.arguments[i];
}

function getFullYear(d) {
    var y = d.getYear();
    if (y < 1000) {y += 1900};
    return y;
}

//var zone = "EDT";
var days = new makeArray("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var months = new makeArray("January","February","March","April","May","June","July","August","September","October","November","December");

function format_time(t) {

    var Day = t.getDay();
    var Date = t.getDate();
    var Month = t.getMonth();
    var Year = t.getFullYear();

    timeString = "";
    timeString += days[Day];
    timeString += ", ";
    timeString += " ";
    timeString += months[Month];
    timeString += " ";
    timeString += Date;
    timeString += ", ";
    timeString += " ";
    timeString += Year;

   return timeString;
 }

function Footer()
{
document.writeln('<a class=fot href="#" onClick="Javascript:Location(); return false;" title="Click here to Get Direction"> 4882 Mayde Court, Fairfax, VA 22030.</a><br> Cell: 571-331-1041,  Home Office: 703-631-0020. <br>Fax: 703-803-3468. Email: <a class=fot href=mailto:eztax@ymail.com>eztax@ymail.com</a><br><br><b>:.</b> <A class=fot href=default.htm>Home</A></b> |  <b><A class=fot href=contact.htm>Contact Us</A></b> | <b><A class=fot href=Sitemap.htm>Site Map</A></b> | <b><A class=fot href=Feedback.htm>Feedback</A></b> | <b><A class=fot href=Privacy.htm>Privacy Policy</A></b> | <b><A class=fot href=Disclaimer.htm>Disclaimer</A></b>  <b>.:</b><br>© 2004 <font color=003399>Ez Tax Preparation</font> &nbsp;  &nbsp;<b>:.</b>  Designed & Developed by <a class=fot href=http://www.omsai.com target=_blank><font color=000099>www.omsai.com</font></a> <b>.:</b> '); 
}

function Footer2()
{
document.writeln('<a class=fot href="#" onClick="Javascript:Location();" title="Click here to Get Direction"> 4882 Mayde Court, Fairfax, VA 22030.</a><br> Cell: 571-331-1041,  Home Office: 703-631-0020. <br>Fax: 703-803-3468. Email: <a class=fot href=mailto:eztax@ymail.com>eztax@ymail.com</a><br>© 2004 <font color=003399>Ez Tax Preparation</font> &nbsp;  &nbsp;<b>:.</b>  Designed & Developed by <a class=fot href=http://www.mindprowess.com target=_blank><font color=000099>www.mindprowess.com</font></a> <b>.:</b> '); 
}

function RightPage()
{
document.writeln('<table width="180" border="0" cellspacing="0" cellpadding="10" align="center" bgcolor="99CC99" class="fot"><tr> <td> <div align="center"><b>Whether we assist individuals or businesses, <br>our services are timely and personalized.</b></div></td></tr></table><br><span class=cont>We work in partnership with our clients and their other legal and financial advisors. This permits us to provide services that are uniquely tailored to an individuals specific personal or business needs </span><br><br><!-- a href=Faqs.htm><img src="images/faqs.gif" border=0></a-->'); 
}


function terms()
{
window.open("terms.htm","","width=430,height=300,scrollbars=yes")
}


function BanImg()
{
document.write('<a href="login.php" target="_blank" title="Click here to make an Appointment"><img src="images/calevents.jpg" border=0></a>');
}

function topLink(){
document.write('<a href=services.htm>Services</a> : <a href="#">Contact Us</a> : <a href="#">Faq</a> : <a href="#">Feedback</a> : <a href="#">Appointment</a>&nbsp;: <a href="#">E-file  info</a>&nbsp;:&nbsp;<a href="#">Register</a>&nbsp; ');
}

function Header()
{
document.write('<table width="770" border="0" cellpadding="2" class="text" align="center"><tr><td><a href="index.htm"><img src="images/NewLogo3.jpg" alt="Ez Tax Preparation" border=0></a></td><td valign="middle"><a href="login.php" target="_blank" onclick=\"return checkState();\" title="Click here to make an Appointment"><img src="images/appn.jpg"  border=0></a><br><br><a class=fot href="Javascript:Location();" title="Click here to Get Direction"><img src="images/ddrn.jpg" border=0></a></td><td align=right><a href="Documents.htm"><img src="images/drc.gif" border=0></a></tD></tr></table>');
}

function checkState()
{
  return confirm("The appointments are only for local residents of DC Metro, VA and MD States. All out of state tax filers please CALL 703-631-0020 or FAX their documents to 703-803-3468. Continue ?");
}

function chck()
{
		if (frm.company.value=="" )
			{
				alert("Please enter your Companay Name");
				frm.company.focus();
				return false;
			}
		if (frm.person.value=="" )
			{
				alert("Please enter Contact Person name");	
				frm.person.focus();
				return false;
			}
		if (frm.classify.value=="" )
			{
				alert("Please enter Business classification");	
				frm.classify.focus();
				return false;
			}	
		if (frm.oldno.value=="" )
			{
				alert("Please enter Door no");
				frm.oldno.focus();
				return false;
			}
		if (frm.street.value=="" )
			{
				alert("Please enter Street Name");
				frm.street.focus();
				return false;
			}
		if (frm.offphone1.value=="" )
			{
				alert("Please enter your Office Phone No");
				frm.offphone1.focus();
				return false;
			}		
		if ((frm.email.value.indexOf('.')<7)||(frm.email.value.indexOf('@')<3))
			{
				alert("Please enter valid email address");
				frm.email.focus();
				return false;
			}		
}

var dtCh= "/";
var dateNow = new Date();
var minYear=dateNow.getFullYear();
var maxYear=dateNow.getFullYear()+1;
function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : mm/dd/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year ("+minYear+")")
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}

function Validate() 
{
 with (document.OmSaiForm) 
{
var dt=txtDate.value
if (isDate(txtDate.value)==false){
		txtDate.focus()
		return false
	}
if (!PName.value) {alert("Enter Name.."); !PName.focus();  return false } 
if (PName.value.match(/^\d/)) {alert("Name must start with a letter"); !PName.focus(); return false } 

if (!CName.value) {alert("Enter Company Name..."); !CName.focus();  return false } 
if (!Addr1.value) {alert("Enter Address...... "); !Addr1.focus();  return false } 
if (!City.value) {alert("Enter City name...."); !City.focus();  return false } 

if (!Zip.value) {alert("Enter zip code"); !Zip.focus();  return false } 
if (!Zip.value.match(/^\d/)) {alert("Zip code must start with number"); !Zip.focus(); return false } 

if (!Phone.value) {alert("Enter Phone No"); !Phone.focus();  return false } 
if (!Phone.value.match(/^\d/)) {alert("Phone No. must start with a number "); !Phone.focus(); return false } 

if (!CEmail.value) {alert("Enter email id"); !CEmail.focus();  return false } 
if (!CEmail.value.match(/^\w+((-\w+)|(\.\w+|-))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)) {
		alert("Invalid E-mail Address! Please re-enter."); !CEmail.focus();  return false } 

if (comments.value.length<5) {alert("Form cannot be submit without your Comments/Notes "); !comments.focus(); return false } 

}
	return true;
}

function FbValid() 
{
 with (document.ETPForm) 
{

if (TopicMsg.value=='0')  {alert("Select the topic for your messages..."); !TopicMsg.focus();  return false } 	
if (!PName.value) {alert("Enter Your Name.."); !PName.focus();  return false } 
if (PName.value.match(/^\d/)) {alert("Contact Name must start with a letter"); !PName.focus(); return false } 
if (PName.value.length<5) {alert("Contact Name must be at least 5 characters"); !PName.focus(); return false } 

if (!CName.value) {alert("Enter Company Name..."); !CName.focus();  return false } 
if (!Addr1.value) {alert("Enter Address...... "); !Addr1.focus();  return false } 
if (!City.value) {alert("Enter City name...."); !City.focus();  return false } 
if (!State.value) {alert("Enter State/Province name"); !State.focus();  return false } 
if (!Country.value) {alert("Enter Country name"); !Country.focus();  return false } 

if (!Zip.value) {alert("Enter zip code"); !Zip.focus();  return false } 
if (!Zip.value.match(/^\d/)) {alert("Zip code must start with number"); !Zip.focus(); return false } 

if (!Phone.value) {alert("Enter Phone No"); !Phone.focus();  return false } 
if (!Phone.value.match(/^\d/)) {alert("Phone No. must start with a number "); !Phone.focus(); return false } 

if (!CEmail.value) {alert("Enter email id"); !CEmail.focus();  return false } 
if (!CEmail.value.match(/^\w+((-\w+)|(\.\w+|-))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)) {
		alert("Invalid E-mail Address! Please re-enter."); !CEmail.focus();  return false } 

if (comments.value.length<5) {alert("Form cannot be submit without your Comments/Notes "); !comments.focus(); return false } 

}
	return true;
}

