// ISSPT Global JavaScript Document

// Legal Alert Message for Footer
function legal() {
	alert("The materials on Idaho Spine and Sport Physical Therapy's Internet sites are provided 'as is.' Idaho Spine and Sport Physical Therapy makes no warranties, express or implied, and Idaho Spine and Sport Physical Therapy disclaims and negates all other warranties, including without limitation, implied warranties of merchantability, fitness for a particular purpose, or noninfringement of intellectual property or other violation of rights.")
}
// Opens EMAIL window in the center of the screen
function openWindow(url,width,height) 	{
    x = (800 - width)/2, y = (600 - height)/2;

    if (screen) {
        y = (screen.availHeight - height)/2;
        x = (screen.availWidth - width)/2;
    }
	    window.open(url,'emailWindow','resizable=no,scrollbars=no,menubar=no,status=no,width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
}
function openPTWindow(url,width,height) 	{
    x = (800 - width)/2, y = (600 - height)/2;

    if (screen) {
        y = (screen.availHeight - height)/2;
        x = (screen.availWidth - width)/2;
    }
	    window.open(url,'ptWindow','resizable=no,scrollbars=yes,menubar=no,status=yes,width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
}

//Coming Soon Message
function comingSoon()	{
	alert('Coming Soon!');
}

// Validate Email address and password
function isEmail(string) {

   if (!string) return false;
   var iChars = "*|,\":<>[]{}`\';()&$#%";

   for (var i = 0; i < string.length; i++) {
      if (iChars.indexOf(string.charAt(i)) != -1)
         return false;
   }
   return true;
}                      
// JavaScript1.2 Version
function isEmail(string) {
    if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
        return true;
    else
        return false;
}
                   
function isReady(form) {
    if (isEmail(form.sent_from.value) == false) {
		form.sent_from.focus();
        alert("Please enter a valid email address.");
        return false;
    }

}

function isReadyCGITO(form) {
    if (isEmail(form.send_to.value) == false) {
		form.send_to.focus();
        alert("Please enter a valid email address.");
        return false;
    }

}