var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

if (checkIt('msie'))
{
	browser = "Internet Explorer";
}
else if (!checkIt('compatible'))
{
	browser = "Netscape Navigator"
	version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
}

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

if (OS == ("Windows" || "Linux" || "Unix") && browser != "Internet Explorer")
{
	document.write('<'+'link rel="stylesheet" href="ie.css" />');
}

if (OS == ("Windows" || "Linux" || "Unix") && browser == "Internet Explorer")
{
	document.write('<'+'link rel="stylesheet" href="ie.css" />');
} 

function checkEmail(inputvalue){	
    var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
    if(pattern.test(inputvalue)){         
		return(true);   
    }else{   
        return(false);
    }
}
function CheckPhoneNumber(inputvalue) 
{

     // Check for correct phone number
     rePhoneNumber = new RegExp(/^\([1-9]\d{2}\)\s?\d{3}\-\d{4}$/);

     if (!rePhoneNumber.test(inputvalue)) {

          return false;
     }
     return true;
}
function WriteFooterImage()
{
    var rand = Math.round(Math.random() * 6);
    document.write('<img src=\"/images/footer.' + rand + '.gif\" width=\"130\" alt=\"' + rand +'\" height=\"125\" border=\"0\">');

}
    function OpenWindow(Url)
    {
        window.open(Url, 'windowname', 'height=600,width=800,status=0,toolbar=0,menubar=0,resizable=1,scrollbars=1') 
    }
