document.cookie = 'cookiecheck' + escape('nothing');

var days = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var months = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var dt = new Date();
var yr = dt.getYear();
var dayStr="";
if (yr<1000)
	yr = yr+1900;
if (screen.width > 800) 
	dayStr = days[dt.getDay()]+' ';
var today = dayStr+months[dt.getMonth()]+" "+dt.getDate()+", "+yr;

function rightdiv(width_left,width_right)
{
	var w = screen.width;
	document.writeln("<div style='float:right; padding:8px; margin-top:0px; padding-top:0px;width:"+.74*w+"px; vertical-align:top; position:absolute; left:"+.207*w+"px;'>");
}

function bground()
{
	var vert;
	var cont = true;
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))
	{
		var iever=new Number(RegExp.$1);
		if (iever < 7)
			cont = false;
	}
	if (cont)
	{
		if (screen.width <= 900)
			document.writeln("<div style='background-image:url(image/DF_BG_Small.jpg); background-repeat: no-repeat; background-attachment:fixed; background-position: 61% 85%;'>");
			else 
			{
				if (screen.width <= 1024)
					vert = 78;
					else
						vert = 50;
				document.writeln("<div style='background-image:url(image/DF_BG.jpg); background-repeat: no-repeat; background-attachment:fixed; background-position: 61% "+ vert+"%;'>");
			}
	}
		else
			document.writeln("<div>");
}

function imageCode()
{
	var width = screen.width;
	if (width < 800)
		width = 640;
		else if (width < 900)
			width = 800;
			else if (width < 1024)
				width = 900;
				else if (width < 1152)
					width = 1024;
					else if (width < 1280)
						width = 1152;
						else if (width < 1400)
						     width = 1280;
                                                     else if (width < 1440)
							width = 1400;
							else if (width < 1600)
								width = 1440;
								else if (width < 1680) 
									width = 1600;
									else if (width < 1920) 
										width = 1680;
										else
											width = 1920;
	document.write("<a href='/' class='imglink'><div style='margin:0px; border:0;'><img src='image/DF_Top_"+width+".png' style='border:0px; margin:0px;'></div><div style='margin:0px; border:0px;'><img src='image/DF_Center_"+width+".jpg' class='headerimg'></div><div style='margin:0px; border:0px;'><img src='image/DF_Bottom_"+width+".png' style='border:0px; margin:0px;'></div></a>");
}

function dateTD()
{
	if (navigator.appName == "Microsoft Internet Explorer")
		document.write("<TD align='center' width='19%' rowspan='2' style='font-style:oblique; font-size:small; color:white; padding-top:1ex; padding-bottom:1ex;' class='Date'>");
		else
			document.write("<TD align='center' width='19%' rowspan='2' style='font-size:small; color:white; padding-top:0; padding-bottom:0;' class='Date'>");
}

function calculate(from)
{
	var price = "$";
	if (from == 1)
	{
		var v = document.calc.comType.options[document.calc.comType.selectedIndex].value;
		document.calc.entity.selectedIndex = 0;
	}
        if (from == 2)
        {
          var v = document.calc.entity.options[document.calc.entity.selectedIndex].value;
          document.calc.comType.selectedIndex = 0;
        }
        if (v != "")
        {
          if (v == "Please Select:")
            document.calc.price.value = "";
            else
            {
              price += v;
              document.calc.price.value = price;
            }
        }
          else
            document.calc.price.value = "";
}

function techPopUp()
{
	props=window.open('technical_support.html', 'poppage', 'toolbars=0, scrollbars=1, location=0, statusbars=0, menubars=0, resizable=0, width=370, height=350');
}

function validate()
{
       var error = false;	       	
       if (document.email_us.submit_to.selectedIndex == 0)
       {
         alert("Please select a message recipient");
         document.email_us.submit_to.focus();
         error = true;
       }
       
	   if (document.email_us.sender_name.value == "" || document.email_us.sender_name.value == "You must enter your name")
       {
	     document.email_us.sender_name.value = "You must enter your name"
		 if (!error)
      	 	document.email_us.sender_name.select();
		 error = true;	     
       }
       
       if (document.email_us.submit_by.value == "" || document.email_us.submit_by.value == "You must enter an email address")
       {
         document.email_us.submit_by.value = 'You must enter an email address';
         if (!error)
      	 	document.email_us.submit_by.select();
         error = true;
       }
         else if (document.email_us.submit_by.value.indexOf("@") < 1 || document.email_us.submit_by.value.lastIndexOf(".") - document.email_us.submit_by.value.indexOf("@") < 2 )
         {
           alert("You must enter a valid email address");
           if (!error)
		     document.email_us.submit_by.select();
           error = true;         	
         }
       
	   if (document.email_us.message.value == "" || document.email_us.message.value == "You must enter a message")
       {
         document.email_us.message.value = "You must enter a message";
         if (!error)
           document.email_us.message.select();
         error = true;
       }
       if (error)
         return false;
         else
       		return true;
}
	 
function description(desc)
{
        if (desc == "memName")
        {
          alert("Desired Primary Member Name:\n\n" +
            "This name is used when you login to your account as an administrator.\n" +
            "Your DirectFile account can have an unlimited number of member names,\n" + 
            "but this is the member name that we will setup as your account's first\n" +
            "administrator. Once you are logged in, you may add other members to your\n" +
            "account with varying levels of permissions. Examples of member names:\n\n" +
            "Tom For Assembly, TFA Admin, Suzanne Baker, CentralPAC, CSA Plumbing\n\n" +
            "You may also choose to use the prefix of your email address. Note: for your\n" +
            "convenience, member names are case-insensitive.");
        }
}

function User_Login()
{
	if (document.cookie == "")
		window.location.href = "need_cookies.php";
		else
			window.location.href = "https://df1.directfile.com/app/prod/user_login.php";
}


function User_Login_Down()
{
	window.location.href = "temp_down.php";
}