/* ------ Show and hide function for the menu ------ */
function show(the_obj){
        this.thediv=document.getElementById(the_obj);
        this.thediv.style.visibility="visible";
		if(the_obj!='row_hide')
			this.thediv.style.display="block";
}

function hide(the_obj){
        this.thediv=document.getElementById(the_obj);
        this.thediv.style.visibility="hidden";
}

/* ------ nav function to detect if navigator is Netscape/Firefox or Internet Explorer.
		  The CSS has been made for Internet Explorer. Adjustments are made on nav() if navigator is Netscape/Firefox ------ */
		  
function nav(the_obj){
	NavName=navigator.appName;
		if(NavName=='Netscape'){
			if(the_obj=='safety_tip_under'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="-160px 0px 0px 633px";
			}
			if(the_obj=='safety_tip_under2'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="-160px 0px 0px 633px;"
			}
			if(the_obj=='safety_tip_menu'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="-70px 0px 0px 92px";
				}
			if(the_obj=='safety_tip_menu2'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="-70px 0px 0px 10px";
				}			
			if(the_obj=='text_dog_owners'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="-365px 0px 0px 90px";
				this.thediv.style.visibility="visible";
			}
			if(the_obj=='div_text_but'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="-10px 0px 0px -30px";
				this.thediv.style.visibility="visible";
			}
			if(the_obj=='ressources'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="25px 0px 0px 220px";
				this.thediv.style.visibility="visible";
				this.thediv=document.getElementById('text_online_ressources');
				this.thediv.style.margin="-245px 0px 0px 160px";
				this.thediv.style.visibility="visible";
			}
			if(the_obj=='bubble_index'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="60px 0px 0px 675px";
				this.thediv.style.visibility="visible";
				}
			if(the_obj=='you_read'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="55px 0px 0px 57px";
				this.thediv.style.visibility="visible";
				}
			if(the_obj=='diggity_plays'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="55px 0px 0px 585px";
				this.thediv.style.visibility="visible";
				}
			if(the_obj=='tellStory'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="20px 0px 0px 20px";
				this.thediv.style.visibility="visible";
				}
			if(the_obj=='frame_text'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="237px 0px 0px 200px";
				this.thediv.style.visibility="visible";
				}
			if(the_obj=='if_bitten_title'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="0px 0px 0px 265px";
				this.thediv.style.visibility="visible";
				}
			if(the_obj=='if_bitten'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="0px 0px 0px 0px";
				this.thediv.style.visibility="visible";
				}					
			if(the_obj=='if_bitten1'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="-310px 0px 0px 70px";
				this.thediv.style.visibility="visible";
				}
			if(the_obj=='if_bitten2'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="-450px 0px 0px 300px";
				this.thediv.style.visibility="visible";
				}	
			if(the_obj=='if_bitten3'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="-335px 0px 0px 580px";
				this.thediv.style.visibility="visible";
				}	
			if(the_obj=='if_bitten4'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="-90px 0px 0px 495px";
				this.thediv.style.visibility="visible";
				}
			if(the_obj=='if_bitten5'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="-100px 0px 0px 70px";
				this.thediv.style.visibility="visible";
				}
			if(the_obj=='note'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="-150px 0px 0px 320px";
				this.thediv.style.visibility="visible";
				}				
	}
	else{
			if(the_obj=='text_dog_owners'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.visibility="visible";
			}
			if(the_obj=='div_text_but'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="-2px 0px 0px -30px";
			}
			if(the_obj=='ressources'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.visibility="visible";
				document.getElementById('text_online_ressources').style.visibility="visible";
			}
			if(the_obj=='safety_tip_under'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="-163px 0px 0px 633px;"
			}
			if(the_obj=='safety_tip_under2'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="-0px 0px 0px 0px;"
			}			
			if(the_obj=='safety_tip_menu'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="-72px 0px 0px 95px";
				}
			if(the_obj=='safety_tip_menu2'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="-50px 0px 0px 0px";
				}
			if(the_obj=='bubble_index'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="40px 0px 0px 645px";
				this.thediv.style.visibility="visible";
				}
			if(the_obj=='you_read'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="75px 0px 0px 84px";
				this.thediv.style.visibility="visible";
				}
			if(the_obj=='diggity_plays'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="75px 0px 0px 622px";
				this.thediv.style.visibility="visible";
				}
			if(the_obj=='tellStory'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="20px 0px 0px 50px";
				this.thediv.style.visibility="visible";
				}					
			if(the_obj=='frame_text'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.margin="245px 0px 0px 200px";
				this.thediv.style.visibility="visible";
				}
			if(the_obj=='if_bitten'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.visibility="visible";
			}
			if(the_obj=='if_bitten_title'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.visibility="visible";
			}			
			if(the_obj=='if_bitten1'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.visibility="visible";
				}
			if(the_obj=='if_bitten2'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.visibility="visible";
				}	
			if(the_obj=='if_bitten3'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.visibility="visible";
				}	
			if(the_obj=='if_bitten4'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.visibility="visible";
				}
			if(the_obj=='if_bitten5'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.visibility="visible";
				}
			if(the_obj=='note'){
				this.thediv=document.getElementById(the_obj);
				this.thediv.style.visibility="visible";
				}					
				
	}
}

/* ------ check_form() function for the contact_us form ------ */

function check_form(formname){

	msg = "Please enter :\n";

	if (formname == "comment") {
		if (document.comment.name.value == "")
			msg += "- Your name          \n";
		
		if (document.comment.rate.value == 0)
			msg += "- A rate for the selected product          \n";
			
		if (document.comment.content.value == "")
			msg += "- A review for the selected product          \n";
	}
	
	if (formname == "contact") {
		if (document.contact.name.value == "")
			msg += "- Your name     \n";
		
		if (document.contact.email.value == "" || !document.contact.email.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,4}))$)\b/gi) )
			msg += "- A valid email address     \n";
			
		if (document.contact.content.value == "")
			msg += "- A message to send to us     \n";
	}
	
	if (formname == "friend") {
		if (document.friend.name.value == "")
			msg += "- Your name\n";
		
		if (document.friend.email.value == "" || !document.friend.email.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,4}))$)\b/gi) )
			msg += "- A valid email address for you\n";
		
		if (document.friend.femail.value == "" || !document.friend.email.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,4}))$)\b/gi) )
			msg += "- A valid email address for your friend\n";
			
		if (document.friend.content.value == "")
			msg += "- A message to send to him\n";
			
		if (document.friend.user_code.value == "")
			msg += "- A correct security code\n";
	}
	
	
	if (msg.length == 15)
		return true;
	
	alert(msg.substr(0,(msg.length - 1)));
	return false;
}


