/* 
	JavaScript Includes
   	Copyright (c) Roman VIII Ltd 2004
  	Version 1
	Feb 2004
  	www.romanviii.co.uk
	info@romanviii.co.uk
*/
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//Date display
	dayName = new Array ("Sun","Mon","Tue","Wed","Thu","Fri","Sat")
	monName = new Array ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")

	now = new Date
	function fixDate(date_in_month)
	{
		var extra=date_in_month%10;
		var extra_str="th";
		
		if(extra==1 && date_in_month!=11) extra_str="st";
		else 
			if(extra==2 && date_in_month!=12) extra_str="nd";
		else 
			if(extra==3 && date_in_month!=13) extra_str="rd";
		
		return ( date_in_month+"<sup>"+extra_str+"<\/sup>");
	}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//javascript:PopUpImage('../photos/locationmap.gif',400,550)
function PopUpImage(fname,wd,ht)
{
	var nwHt=(ht?ht+90:600)
	var nwWidth=(wd?wd+20:800)
	var topOff=10
	var leftOff=10

	var page_str="<html><head><title>e-claim ltd<\/title><link rel=\"stylesheet\" href=\"..\/css\/e-claim_main.css\" type=\"text/css\"><\/head><body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\"  style=\"background-image:url(../images/loading2.gif); background-repeat:no-repeat\"><img src=\""+fname+"\" BORDER=\"0\"><p align=right><a href=\"javascript:opener.closePopUpImage()\">Close Window Popup</a> </p><\/body><\/html>";
	//width=\""+wd+"\" height=\""+ht+"\"	
		if(screen.availHeight > nwHt && screen.availWidth > nwWidth)
		{
			topOff=screen.availHeight-(nwHt+90);
			leftOff=screen.availWidth-(nwWidth+10);
		}
		//closePopUp();
		PopUpImageWin=window.open("", "PopUpImageWin",'toolbar=no, location=no, directories=no, width='+nwWidth+',height='+nwHt+',scrollbars=yes,resizable=yes, left='+leftOff+',top='+topOff+'');
		PopUpImageWin.document.write(page_str);
		PopUpImageWin.document.close();
		PopUpImageWin.focus();

}
function closePopUpImage()
{
	if(PopUpImageWin && !PopUpImageWin.closed)
		PopUpImageWin.close()
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//javascript:popUpWin('../section_not_available.htm')
function popUpWin(page,wd,ht)
{
	var puHt=600
	var puWidth=600
	var putopOff=10
	var puleftOff=10
	if (wd) {puWidth=wd;}
	if (ht) {puHt=ht;}
	if(screen.availHeight > puHt && screen.availWidth > puWidth)
	{
		putopOff=screen.availHeight-(puHt+90);
		puleftOff=screen.availWidth-(puWidth+10);
	}
	popUpWindow=window.open(page+'','popUpWindow','width='+puWidth+',height='+puHt+',scrollbars=yes,resizable=yes,toolbar=no,location=no,left='+puleftOff+',top='+putopOff+'');
	popUpWindow.focus();
}
function closePopUpWin()
{
	if(popUpWindow && !popUpWindow.closed)
		popUpWindow.close()
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
function checkForm()
{
	if (document.all("firstname").value == "")
	{
		alert("'First Name' is a required field.");
		document.all("firstname").focus();
		window.event.returnValue = false;
	}
	else if (document.all("lastname").value == "")
	{
		alert("'Surname' is a required field.");
		document.all("lastname").focus();
		window.event.returnValue = false;
	}
	else if (document.all("streetaddress").value == "")
	{
		alert("'Address' is a required field.");
		document.all("streetaddress").focus();
		window.event.returnValue = false;
	}
	else if (document.all("towncity").value == "")
	{
		alert("'Town/City' is a required field.");
		document.all("towncity").focus();
		window.event.returnValue = false;
	}
	else if (document.all("expectedsalary").value == "")
	{
		alert("'Expected Salary' is a required field.");
		document.all("expectedsalary").focus();
		window.event.returnValue = false;
	}
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
function TimeDatePrepare()
{
	var CurrentValue=window.event.srcElement

	if (CurrentValue == ("DD/MM/YY") || ("HH:MM"))
	{
  		window.event.srcElement.value = "";
	}
}

function KeyCheck()
	{
	var CurrentKeyCode=window.event.keyCode

	if (((CurrentKeyCode >= 47) && (CurrentKeyCode <= 58)) 
		|| ((CurrentKeyCode >= 96) && (CurrentKeyCode <= 105)) 
		|| (CurrentKeyCode == 8) || (CurrentKeyCode == 46) 
		|| ((CurrentKeyCode >= 37) && (CurrentKeyCode <= 40)) 
		|| (CurrentKeyCode == 9) || (CurrentKeyCode == 186))
	{
		window.event.returnValue = true;
	}
	else
		window.event.returnValue = false;
}

function DateInput()
{
	var DateCheck=window.event.srcElement
	var CurrentKeyCode=window.event.keyCode

	if (((DateCheck.value.length == 2) || (DateCheck.value.length == 5)) && (CurrentKeyCode != 8))
	{
		DateCheck.value = DateCheck.value+"/";
	}
}

function TimeInput()
{
	var TimeCheck=window.event.srcElement
	var CurrentKeyCode=window.event.keyCode

	if ((TimeCheck.value.length == 2) && (CurrentKeyCode != 8))
	{
		TimeCheck.value = TimeCheck.value+":";
	}
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>