<!--

var baseEmail		= "belinda@belindaleigh.com";
var basePhoneMain	= "<nobr>(808) 661-3537</nobr>";
var basePhoneCell	= "<nobr>(808) 280-4036</nobr>";
var baseName		= "Belinda Leigh Galleries";
var baseLocation	= "Maui Art &amp; Gifts";
var baseAddress		= "3350 Honoapi&#146;ilani Hwy, Suite 205, Lahaina, Maui, Hawaii 96761";

var docLoc 	= ""+document.location;
    docLoc	= (docLoc.indexOf("#") == -1) ? ""+docLoc : docLoc.substring(0,docLoc.indexOf("#"));
    docLoc	= (docLoc.indexOf("?") == -1) ? ""+docLoc : docLoc.substring(0,docLoc.indexOf("?"));

var docPage	= "";

if (docLoc.lastIndexOf(".html") == (docLoc.length-5))
  { docPage = docLoc.substring(docLoc.lastIndexOf("/")+1,docLoc.lastIndexOf(".html"));	} else
if (docLoc.lastIndexOf(".htm") == (docLoc.length-4))
  { docPage = docLoc.substring(docLoc.lastIndexOf("/")+1,docLoc.lastIndexOf(".htm"));	} else
if (docLoc.lastIndexOf(".php") == (docLoc.length-4))
  { docPage = docLoc.substring(docLoc.lastIndexOf("/")+1,docLoc.lastIndexOf(".php"));	} else
  { docPage = "home";									}



// Browser Detection:

var bxua	= navigator.userAgent;
var bxav	= navigator.appVersion;
var bxan	= navigator.appName;
var bxcn	= navigator.appCodeName;
var bxpt	= navigator.platform;
var bxck	= navigator.cookieEnabled;
var bxln	= navigator.language;
var bxsl	= navigator.systemLanguage;
var bxul	= navigator.userLanguage;

var isMac	= (bxua.indexOf("Mac") > -1)						? 1 : 0 ;
var isApple	= (bxua.indexOf("Apple") > -1)						? 1 : 0 ;
var isSafari	= (bxua.indexOf("Safari") > -1)						? 1 : 0 ;

var isOpera	= (bxua.indexOf("Opera") > -1)						? 1 : 0 ; 

var isFirefox	= (bxua.indexOf("Firefox") > -1)					? 1 : 0 ;

var isNS	= (bxan.toLowerCase().indexOf("netscape") >= 0)				? 1 : 0 ;
var isOldNS	= ((isNS) && (!document.getElementById))				? 1 : 0 ;
var isNewNS	= ((isNS) && (document.getElementById) && (!isOpera))			? 1 : 0 ;

var isNS4	= ((isNS) && (parseFloat(bxav) == 4))					? 1 : 0 ;

var isMinNS4	= ((isNS) && (parseFloat(bxav) >= 4))					? 1 : 0 ;

var isMinNS6	= ((isMinNS4) && (document.getElementById))				? 1 : 0 ;

var isFF	= (bxua.toLowerCase().indexOf("firefox") != -1)				? 1 : 0 ;

var isIE	= ((document.all) || (document.getElementById) 
				  || (bxua.toLowerCase().indexOf("msie") >= 0))		? 1 : 0 ;
var isOldIE	= ((isIE) && (!document.getElementById))				? 1 : 0 ;
var isNewIE	= ((isIE) && (document.getElementById))					? 1 : 0 ;

var isMinIE3	= ((document.all) && (parseFloat(bxav) >= 3))				? 1 : 0 ;

var isMinIE4	= ((document.all) && (parseFloat(bxav) >= 4))				? 1 : 0 ;

var isMinIE5	= ((isMinIE4 && bxav.toLowerCase().indexOf("msie 5.") >= 0)	||
		   (isMinIE4 && bxav.toLowerCase().indexOf("msie 6.") >= 0)	||
		   (isMinIE4 && bxav.toLowerCase().indexOf("msie 7.") >= 0))		? 1 : 0 ;

var isMinIE6	= ((isMinIE4 && bxav.toLowerCase().indexOf("msie 6.") >= 0)	||
		   (isMinIE4 && bxav.toLowerCase().indexOf("msie 7.") >= 0))		? 1 : 0 ;

var isCurrent	= (document.getElementById)						? 1 : 0 ;

var isDHTML	= ((isCurrent) || (document.all) || (document.layers))			? 1 : 0 ;

//alert("userAgent = "+bxua+"\nappVersion = "+bxav+"\nappName = "+bxan);



function runPop(s,w,h,t,c,n)  // img src, img width, img height, art category, artist note
  {
	var newCode;
	var newWin;

	var t = ((!t) || (t.length < 1)) ? "" : ""+t ;
	var c = ((!c) || (c.length < 1)) ? "" : ""+c ;
	var n = ((!n) || (n.length < 1)) ? "" : ""+n ;

	var minW = 720;
	var maxH = 540;

	var winW = (w + 50);
	    winW = (winW < minW) ? Math.abs(minW) : Math.abs(winW) ;

	var winH = (h + 50);
	    winH = (t.length > 0) ? (winH + 20) : Math.abs(winH) ;
	    winH = (n.length > 0) ? (winH + (Math.ceil(n.length/100)*15)) : Math.abs(winH) ;
	    winH = (winH > maxH)  ? Math.abs(maxH) : Math.abs(winH) ;

	newCode = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
		+ '<html><head><title>Photo gallery</title>'
		+ '<style type="text/css"><!-- body { text-align: center; font: .7em Verdana, Arial, Helvetica, sans-serif; } --></style>'
		+ '</head>';

	newCode += '<body onBlur="self.close()"';
	newCode += (docPage == "home") ? ' onClick="self.close()">' : '>' ;

	newCode += '<div align=center><table border=0 width='+(minW-100)+' cellspacing=0 cellpadding=0 '
		 + 'style="font-family: tahoma,arial,helvetica; font-size:11pt; font-weight:normal; color:#660000">'
		 + '<tr align=center valign=middle>';

	if (c.length < 1)
	  {	
	    newCode += (t.length < 1) 
		     ? '<td noWrap style="color:#800000"><b>&#147;Untitled&#148;</b><td>' 
		     : '<td noWrap><b>&#147;'+t+'&#148;</b></td>';
	  } else
	  {	
	    newCode += (t.length < 1) 
		     ? '<td align=left noWrap style="color:#800000"><b>&#147;Untitled&#148;</b><td>' 
		     : '<td align=left noWrap><b>&#147;'+t+'&#148;</b></td>';
	    newCode += "<td width=10>&nbsp;</td>";
	    newCode += '<td align=right style="font-size:9pt">Category: <b><i>'+c+'</i></b></td>';
	  }

	newCode += '</tr></table></div>';

	newCode += (n.length < 1) ? "" 
		 : '<div align=center>'
		   + '<div align=justify style="width:'+(minW-100)+'px; border: 1px solid #f8d880; margin: 2px 0px; padding: 3px 5px; '
		   + 'font-family: arial,tahoma; font-size:8.5pt; font-weight:normal; color:#484880; line-height:1.15em">'
		   + '<i>'+n+'</i></div>'
		 + '</div>';

	newCode += '<img src="'+s+'" border=1 width="'+w+'" height="'+h+'" alt="&quot;'+t+'&quot;" style="border: double #cc9933"><br>';

	newCode += '<a href="'+docLoc+'" onclick="self.close();">close window</a></body></html>';

	newWin = window.open('photowindow.html', 'photo', 'width=' + winW + ',height=' + winH + ',resizable,scrollbars');
	newWin.document.open();
	newWin.document.write(newCode);
	newCode = '';
	newWin.document.close();
	newWin.focus();
  }


function runPageIntro()
  {
    var piText = '<div align=center style="clear:both; margin: 5px 0px">'
	+ '<table border=0 width=95% cellspacing=0 cellpadding=0>'
	  + '<tr valign=middle>';

    piText += (docPage == "home") 
	/*
	    ? '<td><a href="javascript:history.back()" title="Go back to previous page">'
	      + '<img src="images/arrowleft_back_50x29.gif" border=0 width=50 height=29 '
		+ 'style="filter:alpha(style=0,opacity=33)" '
		+ 'onMouseOver=\'this.style.filter="alpha(opacity=100)"\' '
		+ 'onMouseOut=\'this.style.filter="alpha(opacity=33)"\'></a></td>' 
	*/
	    ? '<td width=50 style="width:50px">&nbsp;</td>' 

   	    : '<td><a href="home.php" title="Go to '+baseName+' Home Page">'
	      + '<img src="images/arrowleft_home_50x29.gif" border=0 width=50 height=29 '
		+ 'style="filter:alpha(style=0,opacity=33)" '
		+ 'onMouseOver=\'this.style.filter="alpha(opacity=100)"\' '
		+ 'onMouseOut=\'this.style.filter="alpha(opacity=33)"\'></a></td>' ;

    piText += '<td align=center><img src="images/logo3.jpg" alt="'+baseName+'" border=0 width=421 height=43></td>';

    piText += (docPage == "paintingslist")
	    ? '<td width=50 style="width:50px">&nbsp;</td>' 
   	    : '<td align=right><a href="paintingslist.php" '
	      + 'title="List all Belinda Leigh paintings by category\n(with thumbnails &amp; descriptions)">'
	      + '<img src="images/arrowright_list_50x29.gif" border=0 width=50 height=29 '
		+ 'style="filter:alpha(style=0,opacity=33)" '
		+ 'onMouseOver=\'this.style.filter="alpha(opacity=100)"\' '
		+ 'onMouseOut=\'this.style.filter="alpha(opacity=33)"\'></a></td>' ;

    piText += '</tr></table>';

    piText += '<div align=center style="margin-top:5px; '
	    + 'font-family:Comic Sans MS,arial,tahoma; font-size:8pt; font-weight:normal; color:#808080">'
	      + '&#147;Fine Art Prints and Paintings of Hawaii Seascapes, Landscapes &amp; Marine Art '
	      + 'by noted local Hawaiian artist Belinda Leigh&#148;'
	    + '</div>';

    piText += '</div>';

    document.write(piText);
  }


function runPageHeader()
  {
    document.write('<div id="flash">'
	    + '<div id="flashcontent">'
		+ '<h1>Belinda Leigh Galleries</h1>'
		+ '<h2>Hawaii&#146;s Nature Artist</h2>'
	    + '</div>'
	+ '</div>');

    var so = new SWFObject("top.swf", "movie", "730", "215", "6", "#ffffff");
    so.addParam("wmode","transparent");
    so.write("flash");
  }


function collapseString(StringIn)
  {
	var StringOut = ""+StringIn ;
	while (StringOut.indexOf(" ") != -1)
	  {
	    StringOut	= StringOut.substring(0,StringOut.indexOf(" "))
			+ StringOut.substring(StringOut.indexOf(" ")+1,StringOut.length)
	  }
	return StringOut
  }

function compressString(StringIn)
  {
	var StringOut = trimString(""+StringIn) ;
	while (StringOut.indexOf("  ") != -1)
	  {
	    StringOut	= StringOut.substring(0,StringOut.indexOf("  ")+1) 
			+ StringOut.substring(StringOut.indexOf("  ")+2,StringOut.length)
	  }
	return StringOut
  }

function trimString(StringIn)
  {
	var StringOut = ""+StringIn ;
	while (StringOut.charAt(0) == " ")
	  { StringOut = StringOut.substring(1,StringOut.length) };
	while (StringOut.charAt(StringOut.length-1) == " ")
	  { StringOut = StringOut.substring(0,StringOut.length-1) };
	return StringOut
  }



// Imports

if (docPage == "paintingslist")
  {
    document.write(""
	+ "<script language='JavaScript' src='script/previewPopup.js' type='text/javascript'></script> ");
  }


//-->

