// All Rights Reserved C 2001-2004 hurriKane Solutions, LLC 


// project script
function checkProject(theForm)
{
 if (theForm.catId.value == "")
  {
    alert("Please enter a value for the \"Category\" field.");
    theForm.catId.focus();
    return (false);
  }
 if (theForm.client.value == "")
  {
    alert("Please enter a value for the \"Client\" field.");
    theForm.client.focus();
    return (false);
  }
 if (theForm.active.value == "")
  {
    alert("Please enter a value for the \"Active\" field.");
    theForm.active.focus();
    return (false);
  }
 if (theForm.shortDes.value == "")
  {
    alert("Please enter a value for the \"Short Description\" field.");
    theForm.shortDes.focus();
    return (false);
  }
  return (true);
}



var hK;
function hkOpen(winurl,winname,winfeatures)
{
	hK = window.open(winurl,winname,winfeatures);
 	setTimeout('hK.focus();',250);
}

function addPhoto(theForm)
{
 if (theForm.image.value == "")
  {
    alert("Please enter a value for the \"Image\" field.\nUse the Choose Image link to select an image.");
    theForm.image.focus();
    return (false);
  }
  return (true);
}

function deleteCheck(theForm)
{
if (theForm.deleteLock.checked == false)
  {
    alert("If you are sure you want to delete this item and all items associated with it.\nCheck the \"Delete Lock\" box and hit the delete button again.");
    return (false);
  }
  return (true);
}
// Create by hurriKane Solutions, LLC
function IsValidEmail (strEmail){
		var bIsValid=true;
		var Space1=" ";
		var At1="@";
		var Dot1=".";
		var strTemp=new String(strEmail);
		if (strTemp.length < 5) 
				bIsValid = false;
		
		if (strTemp.indexOf(Space1)>0)
				bIsValid = false;
		
		if (strTemp.indexOf(At1)<2)
				bIsValid = false;
		
		if (strTemp.lastIndexOf(Dot1) < strTemp.indexOf(At1, 1) + 1)
				bIsValid = false;
		return bIsValid; 
}

// contact script
function contactCheck(theForm)
{
 if (theForm.name.value == "")
  {
    alert("Please enter a value for the \"Name\" field.");
    theForm.name.focus();
    return (false);
  }
    
	if (theForm.email.value == "")
  	{
    alert("Please enter a value for the \"Email\" field.");
    theForm.email.focus();
    return (false);
  	}
	var ValidEmail=IsValidEmail (theForm.email.value);
	if ((ValidEmail==false) && (theForm.email.value != "")){
	alert("You have entered in a invalid email address");
	theForm.email.focus();
	return (false);
	}
  
  return (true);
}

function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}

function changeImages() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
}
}
}

var preloadFlag = false;
function preloadImages() {
if (document.images) {
home_logo_over = newImage("images/home_logo_over.gif");
home_print_over = newImage("images/home_print_over.gif");
home_web_over = newImage("images/home_web_over.gif");
home_multimedia_over = newImage("images/home_multimedia_over.gif");
preloadFlag = true;
}
}

