function openPopup(url) {
	myPopup = window.open(url,'Popup','width=390,height=300,top=10,left=10,resizable=yes,scrollbars=yes,toolbars=no,statusbar=yes,titlebar=no');
	//if (!myPopup.opener)
	//myPopup.opener = self;
	myPopup.focus();
}

function searchMe(){
if (document.searchform.searchfor.value=="")
	{
	alert("Please enter word or phrase to search for.")			
	document.searchform.searchfor.focus();	
	 return false;
	}
		
else if (document.searchform.searchfor.value.length<3)
	{
	alert("Search word should be at least 3 characters.")
	document.searchform.searchfor.focus();
	 return false;
	}
		
for (var i=0; i < document.searchform.searchsite.length; i++)
   {
   if (document.searchform.searchsite[i].checked)
      {
      var rad_val = document.searchform.searchsite[i].value;
      
      if (rad_val=="web")
		{
		window.open("http://www.google.com/search?sourceid=navclient&q="+document.searchform.searchfor.value);
		}		
      else if (rad_val=="site")
		{
			top.location.href="searchresults.asp?query="+document.searchform.searchfor.value;
		}            
		return false;     
      }
   }
}

function searchMeOpt(){
if (document.searchform.searchfor.value=="")
	{
	alert("Please enter word or phrase to search for.")
	document.searchform.searchfor.focus();
	}
	
else if (document.searchform.searchfor.value.length<3)
	{
	alert("Search word should be at least 3 characters.")
	document.searchform.searchfor.focus();
	}	
	
else if (document.searchform.searchsite.options[document.searchform.searchsite.selectedIndex].value=="web")
	{
	window.open("http://www.google.com/search?sourceid=navclient&q="+document.searchform.searchfor.value);
	}	
		
else if (document.searchform.searchsite.options[document.searchform.searchsite.selectedIndex].value=="site")
	{
	top.location.href="searchresults.asp?query="+document.searchform.searchfor.value;
	}	
}

function ButtonOver(item) {
	item.className = "Button_sel";
	if (item.alt !=null) {
		window.status=item.alt;
	}
}

function ButtonOff(item) {
	item.className = "Button_unsel";
	window.status='C.F. Sharp Group - http://www.cfsharp.com';
}
function SendPageForm(){
	if (document.myform.sendtoaddress.value=="") {
		alert("Please enter the e-mail address to send this link to")
		document.myform.sendtoaddress.focus()
		return false
	}
	if (document.myform.sendtoaddress.value.length >0){
		i=document.myform.sendtoaddress.value.indexOf("@")
		j=document.myform.sendtoaddress.value.indexOf(".",i)
		k=document.myform.sendtoaddress.value.indexOf(",")
		kk=document.myform.sendtoaddress.value.indexOf(" ")
		jj=document.myform.sendtoaddress.value.lastIndexOf(".")+1
		len=document.myform.sendtoaddress.value.length
   
		if ((i>0) && (j>(i+1)) && (k==-1) && (kk==-1) && (len-jj >=2) && (len-jj<=3)) {
		} else {
			alert("Please enter a valid Email address.\n" + 
			document.myform.sendtoaddress.value + " is invalid.")
			document.myform.sendtoaddress.focus()	 
		return false}
	}
	if (document.myform.email.value=="") {
		alert("Please enter your e-mail address.")
		document.myform.email.focus()
		return false
	}
	if (document.myform.email.value.length >0){
		i=document.myform.email.value.indexOf("@")
		j=document.myform.email.value.indexOf(".",i)
		k=document.myform.email.value.indexOf(",")
		kk=document.myform.email.value.indexOf(" ")
		jj=document.myform.email.value.lastIndexOf(".")+1
		len=document.myform.email.value.length
   
		if ((i>0) && (j>(i+1)) && (k==-1) && (kk==-1) && (len-jj >=2) && (len-jj<=3)) {
		} else {
			alert("Please enter a valid Email address.\n" + 
			document.myform.email.value + " is invalid.")
			document.myform.email.focus()	 
		return false}
	}		
return true
}

function FeedbackForm(){
	if (document.myform.email.value=="") {
		alert("Please enter your e-mail address.")
		document.myform.email.focus()
		return false
	}
	if (document.myform.email.value.length >0){
		i=document.myform.email.value.indexOf("@")
		j=document.myform.email.value.indexOf(".",i)
		k=document.myform.email.value.indexOf(",")
		kk=document.myform.email.value.indexOf(" ")
		jj=document.myform.email.value.lastIndexOf(".")+1
		len=document.myform.email.value.length
   
		if ((i>0) && (j>(i+1)) && (k==-1) && (kk==-1) && (len-jj >=2) && (len-jj<=3)) {
		} else {
			alert("Please enter a valid Email address.\n" + 
			document.myform.email.value + " is invalid.")
			document.myform.email.focus()	 
		return false}
	}
	if (document.myform.subject.value=="") {
		alert("Please enter subject")
		document.myform.subject.focus()
		return false
	}
	if (document.myform.body.value=="") {
		alert("Please enter your message")
		document.myform.body.focus()
		return false
	}		
return true
}

function submitform(action){
	document.myform.action=action;
	document.myform.submit();
}
