	//IFRAME fx
	function changeSrc(targetElementName, newSrc)
	{
	//sets the main iframe window with the specified src.
	//src can be a graphic or a url
    
		frames[targetElementName].location.href=newSrc;

	}

function turnOn(imageName) {  



	if (document.images) {   

		myimage = new Image();

		myimage = "images/" + imageName + "_on.gif"; 

                document[imageName].src = myimage;



	}

}



function turnOff(imageName) {  



	if (document.images) {    

		myimage = new Image();

		myimage = "images/" + imageName + ".gif"; 

                document[imageName].src = myimage;



	}

}

 //popup window js
 
  function MM_swapImgRestore()
   {
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
   }

   function MM_preloadImages()
   {
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
      var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
      if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
   }

   function MM_findObj(n, d)
   {
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
      d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
   }

   function MM_swapImage()
   {
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
      if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
   }
   
   
   function popUp(url,name,w,h){
	str="height="+h+",width="+w+",scrollbars=no";
	if(parseInt(navigator.appVersion)>3)
		str+=",left="+(screen.width -w)/2+",top="+parseInt((screen.height -h)/3);
	win=window.open(url,name,str);
}


   function InquirepopUp(w,h,photo){
	url= "/inquire.htm";
	name = "inquire";
	str="height="+h+",width="+w+",scrollbars=no";
	
	//set selected photo name to hidden field
	document.frmHidden.selPhotoName.value = photo;

	if(parseInt(navigator.appVersion)>3)
		str+=",left="+(screen.width -w)/2+",top="+parseInt((screen.height -h)/3);
	//win=window.open(url,name,str);
	//call the pop-up window
	win=window.open(url,'_blank',str);
	//set the value of the photo name
	win.focus();

}
function setProjName() {
//called from portfolio pages only
  //get photo name from hidden field in opener page
	//alert (window.opener.document.forms['frmHidden'].selProjName.value);
	window.document.frmInquire.project.value = window.opener.document.forms['frmHidden'].selProjName.value; 
}

function setPhotoName() {
//called from portfolio pages only
  //get photo name from hidden field in opener page
	//alert (window.opener.document.forms['frmHidden'].selPhotoName.value);
	window.document.frmInquire.photo_name.value = window.opener.document.forms['frmHidden'].selPhotoName.value; 
}


function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
  
//Additional Functions Added By B.Arlen 5/10/04

//prevent right clicks
 function right(e) {
	if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2))
	return false;
	else if (navigator.appName == 'Microsoft Internet Explorer' && 
		(event.button == 2 || event.button == 3)) 
	{
		alert("Please Contact Us If You Would Like To Use Any of These Photos.\nThank You.");
		return false;
	}
		return true;
	}

//validate an email address
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;
		
		}
		//make sure u find an '@' and '.' character in there
		if (string.indexOf("@") == -1 || string.indexOf(".") == -1 ){
		      return false; 
		   }        	
		return true;
	}      
	
function trimAll( strValue ) {
		/************************************************
		DESCRIPTION: Removes leading and trailing spaces.

		PARAMETERS: Source string from which spaces will
		  be removed;

		RETURNS: Source string with whitespaces removed.
		*************************************************/ 
		 var objRegExp = /^(\s*)$/;

		    //check for all spaces
		    if(objRegExp.test(strValue)) {
		       strValue = strValue.replace(objRegExp, '');
		       if( strValue.length == 0)
		          return strValue;
		    }
		    
		   //check for leading & trailing spaces
		   objRegExp = /^(\s*)([\W\w]*)(\b\s*$)/;
		   if(objRegExp.test(strValue)) {
		       //remove leading and trailing whitespace characters
		       strValue = strValue.replace(objRegExp, '$2');
		    }
		  return strValue;
		}
///// Cookie Functions Added by B.Arlen 7/21/04 //////////////
//** cookie functions
function getCookieVal (offset) {  
var endstr = document.cookie.indexOf (";", offset);  
if (endstr == -1)    
endstr = document.cookie.length;  
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {  
var arg = name + "=";  
var alen = arg.length;  
var clen = document.cookie.length;  
var i = 0;  
while (i < clen) {    
var j = i + alen;    
if (document.cookie.substring(i, j) == arg)      
return getCookieVal (j);    
i = document.cookie.indexOf(" ", i) + 1;    
if (i == 0) break;   
}  
return null;
}
function SetCookie (name, value) {  
var argv = SetCookie.arguments;  
var argc = SetCookie.arguments.length;  
var expires = (argc > 2) ? argv[2] : null;  
var path = (argc > 3) ? argv[3] : null;  
var domain = (argc > 4) ? argv[4] : null;  
var secure = (argc > 5) ? argv[5] : false;  
document.cookie = name + "=" + escape (value) + 
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
((path == null) ? "" : ("; path=" + path)) +  
((domain == null) ? "" : ("; domain=" + domain)) +    
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {  
var exp = new Date();  
exp.setTime (exp.getTime() - 1);  
var cval = GetCookie (name);  
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

function confirmNoAccept() {
        
        if (confirm("You Have Chosen Not To Accept Our Web Site's Terms of Agreement.\nWould You Like To Review Them Again?")) {
        
        return true;
        }
        else {
        alert ("OK, Thanks Anyway.");
        return false;
           }   
      }

