// P&P Family Gallery
//    Author: Paul and Patricia Fraker
//            O'Fallon, Illinois  USA
//            www.frakers.com
//
//                       (c)1999-2005 Paul & Patricia Fraker
//                               All Rights Reserved
//
// MouseOverCall.js
//
// JavaScript routine to build up the call to the MouseOverRoutine
//
// Usage:
//    mouseOverCallLoc displays the results in the local window.
//    mouseOverCallAlt displays the results in an alternate pop-up window.
//
// Special Note:
//    The variable "hovertext" can NOT contain an apostrophe or quote characters.  It will cause the
//    action to not function properly and the page will take javascript errors.



	//	<A HREF="index.html"
	//	   ONMOUSEDOWN="if (bIsSupportOK) ReplaceImage('tag_Home', MouseDownState);"
	//	   ONMOUSEUP="if (bIsSupportOK) ReplaceImage('tag_Home', MouseOverState);"
	//	   ONMOUSEOUT="if (bIsSupportOK) ReplaceImage('tag_Home', DefaultState);window.status=window.defaultStatus;return true"
	//	   ONMOUSEOVER="if (bIsSupportOK) ReplaceImage('tag_Home', MouseOverState); window.status='Return to the Home Page';return true;"
	//	   TARGET="">
	//	<IMG NAME="tag_Home" 
	//	     SRC="images/homepage_normal.jpg" 
	//	     ALT="Return to the Home Page" 
	//	     WIDTH="97" 
	//		 HEIGHT="45" 
	//		 BORDER="0" 
	//		 TITLE="Return to the Home Page">
	//	</A>



	// Function: mouseOverCallLoc (displays the results in the local window)
	function mouseOverCallLoc(hrefpath, tagname, imgsource, hovertext, imgwidth, imgheight, imgalign, br) {
		var hrefpath;		// href path (required field)
		var tagname;		// name of the tag in associated ???MouseOver files (required field)
		var imgsource;		// source name of the image (required field)
		var hovertext;		// text displayed when mouse hovers over object (required field)
		var imgwidth;		// image width
		var imgheight;		// image height
		var imgalign;		// horizontal alignment of image
		var br;				// 1 = add a BR tag at the conclusion of the string
		
		var text;

		// let's first check to see if the vital parameters have been defined.
		// if any are missing, we should just abort this script without continuing.
		if (hrefpath == '') {
			return;
			}

		if (tagname == '') {
			return;
			}
			
		if (imgsource == '') {
			return;
			}
			
		if (hovertext == '') {
			return;
			}

		text = '<A HREF="' + hrefpath + '" ';
		text += 'ONMOUSEDOWN="if (bIsSupportOK) ReplaceImage(\'' + tagname + '\', MouseDownState);" ';
		text += 'ONMOUSEUP="if (bIsSupportOK) ReplaceImage(\'' + tagname + '\', MouseOverState);" ';
		text += 'ONMOUSEOUT="if (bIsSupportOK) ReplaceImage(\'' + tagname + '\', DefaultState);window.status=window.defaultStatus;return true" ';
		text += 'ONMOUSEOVER="if (bIsSupportOK) ReplaceImage(\'' + tagname + '\', MouseOverState); window.status=\'' + hovertext + '\';return true;" ';
		text += 'TARGET="">';

		text += '<IMG NAME="' + tagname + '" ';
		text += 'SRC="' + imgsource + '" ';

		if (hovertext) {
			text += 'ALT="' + hovertext + '" ';
			}

		if (imgwidth) { 
			text += 'WIDTH="' + imgwidth + '" ';
			}

		if (imgheight) { 
			text += 'HEIGHT="' + imgheight + '" ';
			}

		if (imgalign) {
			text += 'ALIGN="' + imgalign + '" ';
			}

		text += 'BORDER="0" ';
		text += 'TITLE="' + hovertext + '"></A>';

		if (br == '1') {
			text += '<BR>';
			}

		document.write(text);
		focus();
		document.close();
		};


	// Function: mouseOverCallAlt (displays the results in an alternate pop-up window)	
	function mouseOverCallAlt(hrefpath, tagname, imgsource, hovertext, winname, imgwidth, imgheight, imgalign, winwidth, winheight, toolbar, scrollbar, resizeable, statusbar, menubar, br) {
		var hrefpath;		// href path (required field)
		var tagname;		// name of the tag in associated ???MouseOver files (required field)
		var imgsource;		// source name of the image (required field)
		var hovertext;		// text displayed when mouse hovers over object (required field)
		var winname;		// unique name of the pop-up window
		var imgwidth;		// image width
		var imgheight;		// image height
		var imgalign;		// horizontal alignment of the image
		var winwidth;		// width of the pop-up window
		var winheight;		// height of the pop-up window
		var toolbar;		// yes = toolbar will be displayed in the pop-up window
		var scrollbar;		// yes = scrollbars will be displayed in the pop-up window
		var resizeable;		// yes = window can be resized
		var statusbar;		// yes = window will have a status bar
		var menubar;		// yes = window will have a menu bar
		var br;				// 1 = add a BR at the conclusion of the string
		
		var text;

		// let's first check to see if the vital parameters have been defined.
		// if any are missing, we should just abort this script without continuing.
		if (hrefpath == '') {
			return;
			}

		if (tagname == '') {
			return;
			}
			
		if (imgsource == '') {
			return;
			}
			
		if (hovertext == '') {
			return;
			}

		text = '<A HREF=""';
		text += 'ONMOUSEDOWN="if (bIsSupportOK) ReplaceImage(\'' + tagname + '\', MouseDownState);" ';
		text += 'ONMOUSEUP="if (bIsSupportOK) ReplaceImage(\'' + tagname + '\', MouseOverState);" ';
		text += 'ONMOUSEOUT="if (bIsSupportOK) ReplaceImage(\'' + tagname + '\', DefaultState);window.status=window.defaultStatus;return true" ';
		text += 'ONMOUSEOVER="if (bIsSupportOK) ReplaceImage(\'' + tagname + '\', MouseOverState); window.status=\'' + hovertext + '\';return true;" ';
		text += 'ONCLICK="return alt_window(\'' + hrefpath + '\',\'' + winname + '\',\'' + winwidth + '\',\'' + winheight + '\',\'';
		text += toolbar + '\',\'' + scrollbar + '\',\'' + resizeable + '\',\'' + statusbar + '\',\'' + menubar + '\')" ';
		
		if (hovertext) {
			text += 'TITLE="' + hovertext + '">';
			} 

		text += '<IMG ';
		text += 'NAME="' + tagname + '" ';
		text += 'SRC="' + imgsource + '" ';
		
		if (hovertext) {
			text += 'ALT="' + hovertext + '" ';
			}

		if (imgwidth) { 
			text += 'WIDTH="' + imgwidth + '" ';
			}

		if (imgheight) { 
			text += 'HEIGHT="' + imgheight + '" ';
			}

		if (imgalign) {
			// Important note on the ALIGN parameter.  
			// If anything other than 'left' or 'right' is provided as a parameter, then for some strange
			// reason, the normal 'A' tag shows the background and hover-over colors, which
			// is not what we want happening for this routine.
			text += 'ALIGN="' + imgalign + '" ';
			}
 
		text += 'BORDER="0"></A>';

		if (br == '1') {
			text += '<BR>';
			}

		document.write(text);
		focus();
		document.close();
		};

// End of script

