/**************************************************************** 
#* Author:   Alistair Lattimore 
#* Website:  http://www.lattimore.id.au/ 
#* Contact:  http://www.lattimore.id.au/contact/ 
#*           Errors, suggestions or comments 
#* Date:     30 June 2005 
#* Version:  1.0 
#* Purpose:  Emulate the disabled attributte for the <option>  
#*           element in Internet Explorer. 
#* Use:      You are free to use this script in non-commercial 
#*           applications. You are however required to leave 
#*           this comment at the top of this file. 
#* 
#*           I'd love an email if you find a use for it on your  
#*           site, though not required. 
#****************************************************************/  
   
 window.onload = function() {  
     if (document.getElementsByTagName) {  
         var s = document.getElementsByTagName("select");  
   
         if (s.length > 0) {  
             window.select_current = new Array();  
   
             for (var i=0, select; select = s[i]; i++) {  
                 select.onfocus = function(){ window.select_current[this.id] = this.selectedIndex; }  
                 select.onchange = function(){ restore(this); }  
                 emulate(select);  
             }  
         }  
     }  
 }
 function a(){
 window.alert('asdfasdfasdfasdfa');
 }
   
 function restore(e) {  
     if (e.options[e.selectedIndex].disabled) {  
         e.selectedIndex = window.select_current[e.id];  
     }  
 }  
   
 function emulate(e) {  
     for (var i=0, option; option = e.options[i]; i++) {  
         if (option.disabled) { 
		 	option.style.fontStyle="italic"; 
            option.style.color = "graytext"; 
			 
         }  
         else {  
             option.style.color = "menutext";  
         }  
     } 
 }
 
 function check_input(f){
	var regexp=new RegExp("^[(\\w)-_\.]{1,}@+(\\w){1,}\.+(\\w){2,}");
/*	if(f.industry.value=='--------'){
		alert('Please select an industry for your website.');
		return false;
	}*/
	if(f.url.value.length<10){
		alert('Please input the url of your website!');
		f.url.focus();
		return false;
	}
	if(f.title.value.length<5){
		alert('Please input a valid title no shorter than 5 letters!')
		f.title.focus();
		return false;
	}
	if(f.description.value.length<20){
		window.alert("Please input a short description of your website. No shorter than 20 characters!");
		f.description.focus();
		return false;
	} else if(f.description.value.length>200){
		window.alert("Please keep the description shorter than 200 characters.");
		f.description.focus();
		return false;
	}
	if((f.email.value.length<1)||(!regexp.test(f.email.value))){
		window.alert("Please input a valid email address!")
		f.email.focus();
		return false;
	}
	if(f.linktous.value.length<10){
		alert("Please add a reciprocal link to us and input the url!");
		f.linktous.focus();
		return false;
	}
	return true;
	
}
function show_submit(){
	if(check_input(document.getElementById('form2'))){
		document.getElementById('submit_d').style.display='block';
		return true;
	}
	return false;
}
function display(evn){
	document.getElementById('how').style.display='block';
	document.getElementById('how').style.left=380+'px';
	document.getElementById('how').style.top=565+'px';
}