
//
// +---------------------------------------------------------------------+
// | WORLDWORDSANDIMAGES.COM                                             |
// +---------------------------------------------------------------------+
// | wwi.js                                                              |
// | js functions                                                        |
// |                                                                     |
// | Dtek Digital Media, dtek.net                                        |
// | 2005.04.30                                                          |
// |                                                                     |
// +---------------------------------------------------------------------+
//

//
// rollovers
//

if (document.images)  {

	// note that beet menu are handled by the beet code, and not here

	photo_contact_o=new Image;  photo_contact_o.src="img/photo_contact_o.gif";

	ms_home_o=new Image;  ms_home_o.src="img/ms_home_o.gif";
	ms_about_o=new Image;  ms_about_o.src="img/ms_about_o.gif";
	ms_contact_o=new Image;  ms_contact_o.src="img/ms_contact_o.gif";

	m_home_o=new Image;  m_home_o.src="img/m_home_o.gif";
	m_about_o=new Image;  m_about_o.src="img/m_about_o.gif";
	m_contact_o=new Image;  m_contact_o.src="img/m_contact_o.gif";

	photo_contact=new Image;  photo_contact.src="img/photo_contact.gif";

	ms_home=new Image;  ms_home.src="img/ms_home.gif";
	ms_about=new Image;  ms_about.src="img/ms_about.gif";
	ms_contact=new Image;  ms_contact.src="img/ms_contact.gif";

	m_home=new Image;  m_home.src="img/m_home.gif";
	m_about=new Image;  m_about.src="img/m_about.gif";
	m_contact=new Image;  m_contact.src="img/m_contact.gif";
	
	function rollover(imageName)  {
		beetSuppressMenus();  // hide all beet menus... (see ../beet/beet.js)
		document[imageName].src=eval(imageName + "_o.src");
	}
	
	function rolloff(imageName)  {
		document[imageName].src=eval(imageName + ".src");
	}
}


//
// copyright notice on right-click (supported by some platforms/browsers)
//

var clickmessage="All images copyright World Words and Images, 2005"

function disableclick(e)  {
	if (document.all)  {
		if (event.button == 2 || event.button == 3)  {
			if (event.srcElement.tagName == "IMG")  {
				alert(clickmessage);
				return false;
			}
		}
	}  else if (document.layers)  {
		if (e.which == 3)  {
			alert(clickmessage);
			return false;
		}
	}
	else if (document.getElementById)  {
		if (e.which == 3 && e.target.tagName == "IMG")  {
			alert(clickmessage);
			return false;
		}
	}
}

function associateimages()  {
	for(i=0; i<document.images.length; i++)  {
		document.images[i].onmousedown=disableclick;
	}
}

if (document.all)  {
	document.onmousedown=disableclick;
}  else if (document.getElementById)  {
	document.onmouseup=disableclick;
}  else if (document.layers)  {
	associateimages();
}


//
// contact form
//

function check_cform( f )  {
	var warning = "Please enter your name,\nemail address, and message.";
	var eWarning = "There is no \"@\" sign in your email address.\nPlease enter the full email address.";

	if (!f.name.value)  {
		alert (warning);
		f.name.focus();
	}  else if (!f.email.value)  {
		alert (warning);
		f.email.focus();
	}  else if (f.email.value.indexOf("@") == -1)  {
		alert (eWarning);
		f.email.focus();
	}  else if (!f.msg.value)  {
		alert (warning);
		f.msg.focus();
	}  else  {
		f.submitted.value = "true";
		f.submit();
	}
}

