window.onload = function() {
   var artistList = document.getElementById("artistList");
   if (artistList) artistList.style.display = "none";
}

function showArtistList() {
var artistList = document.getElementById("artistList");
artistList.style.display = "inline";
}

function hideArtistList() {
var artistList = document.getElementById("artistList");
artistList.style.display = "none";
}

function RoundedTop(selector,bk,color,size){
var i;
var v=getElementsBySelector(selector);
for(i=0;i<v.length;i++)
    AddTop(v[i],bk,color,size);
}

function RoundedBottom(selector,bk,color,size){
var i;
var v=getElementsBySelector(selector);
for(i=0;i<v.length;i++)
    AddBottom(v[i],bk,color,size);
}

function AddTop(el,bk,color,size){
var i;
var d=document.createElement("b");
var cn="r";
var lim=4;
if(size && size=="small"){ cn="rs"; lim=2;}
d.className="rtop";
d.style.backgroundColor=bk;
for(i=1;i<=lim;i++){
    var x=document.createElement("b");
    x.className=cn + i;
    x.style.backgroundColor=color;
    d.appendChild(x);
    }
try { el.insertBefore(d,el.firstChild); } catch(err) {}
}

function AddBottom(el,bk,color,size){
var i;
var d=document.createElement("b");
var cn="r";
var lim=4;
if(size && size=="small"){ cn="rs"; lim=2}
d.className="rbottom";
d.style.backgroundColor=bk;
for(i=lim;i>0;i--){
    var x=document.createElement("b");
    x.className=cn + i;
    x.style.backgroundColor=color;
    d.appendChild(x);
    }
try { el.appendChild(d,el.firstChild); } catch(err) {}
}
function getElementsBySelector(selector){
var i;
var s=[];
var selid="";
var selclass="";
var tag=selector;
var objlist=[];
if(selector.indexOf(" ")>0){  
//  descendant selector like "tag#id tag"
    s=selector.split(" ");
    var fs=s[0].split("#");
    if(fs.length==1) return(objlist);
    return(document.getElementById(fs[1]).getElementsByTagName(s[1]));
    }
if(selector.indexOf("#")>0){ 
//  id selector like "tag#id"
    s=selector.split("#");
    tag=s[0];
    selid=s[1];
    }
if(selid!=""){
    objlist.push(document.getElementById(selid));
    return(objlist);
    }
if(selector.indexOf(".")>0){  
//  class selector like "tag.class"
    s=selector.split(".");
    tag=s[0];
    selclass=s[1];
    }
var v=document.getElementsByTagName(tag);  
// tag selector like "tag"
if(selclass=="")
    return(v);
for(i=0;i<v.length;i++){
    if(v[i].className==selclass){
        objlist.push(v[i]);
        }
    }
return(objlist);
}

function fixPNG(myImage,width,height) { 
// correctly handle PNG transparency in Win IE 5.5 or higher.
         if (!document.all) return;
	 var imgID = (myImage.id) ? "id='" + img.id + "' " : "";
	 var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : "";
	 var imgTitle = (myImage.title) ? "title='" + myImage.title + "' " : "title='" + myImage.alt + "' ";
	 var imgStyle = "display:inline-block;cursor:hand;" + myImage.style.cssText;
	 var strNewHTML = "<span " + imgID + imgClass + imgTitle;
	 strNewHTML += " style=\"" + "width:" + width + "px; height:" + height + "px;" + imgStyle + ";";
	 strNewHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader";
	 strNewHTML += "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"; 
	 myImage.outerHTML = strNewHTML;
}

function doRollover(elem, rollover_color, text_color){
// set background color of TD
if (elem.parentNode){ // IE5, IE6 and Netscape 6
if (rollover_color == 'transparent'){ // Netscape does not like the word "transparent".
elem.parentNode.bgColor = ''; }
else{
elem.parentNode.bgColor=rollover_color;
}
}
else if (elem.parentElement && elem.parentElement.setAttribute){ // IE4.
elem.parentElement.setAttribute("bgColor", rollover_color);
}
else{ // Netscape 4.6x or 4.7x
//alert("Must be Netscape! do nothing");
}
// set color of the link text
if (elem.children){ // IE4, IE5, IE6 and Netscape 6
elem.children(0).style.color=text_color;
}
}
var newwindow;
function popitup(url, title, iwidth, iheight, colour) {
var pwidth, pheight;
var ptop, pleft;
var fullscreen = '';

if ( !newwindow || newwindow.closed ) {
 ptop = 50;
 pleft = 50;
 pwidth=iwidth+50;
 pheight=iheight+50;
 if (pheight > 800) {
   pwidth  = window.screen.availWidth-20;
   pheight = 800;
   ptop    = 10;
   pleft   = 10;
 }
 newwindow=window.open('','htmlname','width=' + pwidth +',height=' +pheight + ',scrollbars=1,resizable=1,top='+ptop+',left='+pleft);
 wheight=iheight;
 wwidth=iwidth;
}
 
if (wheight!=iheight || wwidth!=iwidth ) {
 pwidth=iwidth+30;
 pheight=iheight+80;
 newwindow.resizeTo(pwidth, pheight);
 wheight=iheight;
 wwidth=iwidth;
}
newwindow.document.clear();
newwindow.focus();
newwindow.document.writeln('<html><head><title>Beautiful Cambria</title>');
newwindow.document.writeln('<script>');
newwindow.document.writeln('window.onload=function(){ self.focus(); };');
newwindow.document.writeln('</script>');
newwindow.document.writeln('</head><body bgcolor=' + colour + '><center>');
newwindow.document.writeln('<br>');
newwindow.document.writeln('<img src=' + url + '>');
newwindow.document.writeln('<p>'+title+'</p>');
newwindow.document.writeln('</center></body></html>');
newwindow.document.close();
newwindow.focus();
}

function writeArtistList(pref) {
document.writeln('<div id="artistList" class="dropdownitems" onMouseOver="showArtistList()" onMouseOut="hideArtistList()" onclick="">');
document.writeln('<center>');
document.writeln('<a class="dropdown" style="border-bottom-width:1px; border-bottom-style: solid;border-bottom-color: #990000;" href="'+pref+'artists.html">SHOW ALL</a>');


document.writeln('<a class="dropdown" href="http://www.randersonwatercolor.com" target="_blank">Ruthanne Anderson</a>');
document.writeln('<a class="dropdown" href="http://cjattoe.com" target="_blank">Carol Jean Attoe</a>');

document.writeln('<a class="dropdown" href="http://www.ladytiedi.com" target="_blank">Dianne "Lady Tie Di" Brooke</a>');
document.writeln('<a class="dropdown" href="http://www.wix.com/jackieevans/artistjackieevans" target="_blank">Jackie Chen-Evans</a>');
document.writeln('<a class="dropdown" href="'+pref+'doreen_deppler.html">Doreen Deppler</a>');
/* document.writeln('<a class="dropdown" href="'+pref+'jgilbert.html">Jode Gilbert</a>'); 
*/
document.writeln('<a class="dropdown" href="http://www.lindadunnartist.com" target="_blank">Linda Dunn</a>');
document.writeln('<a class="dropdown" href="http://www.PatriciaGriffinStudio.com" target="_blank">Patricia Griffin</a>');


document.writeln('<a class="dropdown" href="http://www.adjoyartshop.com" target="_blank">Joyburton Heisig</a>');
document.writeln('<a class="dropdown" href="http://www.sandihellerart.com" target="_blank">Sandi Heller</a>');
document.writeln('<a class="dropdown" href="http://www.SueJohnsonArtist.com" target="_blank">Sue Johnson</a>');

/* document.writeln('<a class="dropdown" href="'+pref+'skellogg.html">Stephen Kellogg</a>');
*/
document.writeln('<a class="dropdown" href="'+pref+'skellogg.php">Stephen Kellogg</a>');
document.writeln('<a class="dropdown" href="http://www.shirleykirkesmar.com" target="_blank">Shirley Kirkes Mar</a>');
document.writeln('<a class="dropdown" href="http://www.cambriaimpressions.com" target="_blank">Nancy McKarney</a>');


document.writeln('<a class="dropdown" href="http://www.seamcnamara.com" target="_blank">Shannon E.A. McNamara</a>');
document.writeln('<a class="dropdown" href="artists.html" target="_blank">Betty Mittleman</a>');

/* var str = '<a class="dropdown" ' + 
'href="http://www.chgs.umn.edu/Visual___Artistic_Resources/Betty_Mittleman/betty_mittleman.html"' +' target="_blank">Betty Mittleman</a>';
document.writeln(str);
document.writeln('<a class="dropdown" href="'+pref+'lory_mogensen.html">Lory Mogensen</a>'); 
*/

document.writeln('<a class="dropdown" href="http://www.AllAmericanImages.com" target="_blank">Brian Morrow</a>');
document.writeln('<a class="dropdown" href="http://www.Suzet.com" target="_blank">Suzette Morrow</a>');
document.writeln('<a class="dropdown" href="http://COASTALZEN.NET" target="_blank">Sam Peck</a>');
document.writeln('<a class="dropdown" href="http://www.alteredbythesea.com" target="_blank">Erin Perry</a>');

document.writeln('<a class="dropdown" href="http://Whistlings.com/Shirleys%20pages/shirleys%20Art%20Index.htm" " target="_blank">Shirley Pittman</a>');
document.writeln('<a class="dropdown" href="http://www.LynnRathbun.com" target="_blank">Lynn Rathbun</a>');
document.writeln('<a class="dropdown" href="kathi_rippe.htm" target="_blank">Kathi Rippe</a>');



document.writeln('<a class="dropdown" href="'+pref+'nevenka_schumaker.html">Nevenka Schumaker</a>');  
/*document.writeln('<a class="dropdown" href="'+pref+'jennifer_star.html">Jennifer Star</a>'); 
*/

document.writeln('<a class="dropdown" href="'+pref+'jan_walker.html">Jan Walker</a>');
document.writeln('<a class="dropdown" href="http://www.clarenceweiss.com" target="_blank">Clarence Weiss</a>');
document.writeln('<a class="dropdown" href="'+pref+'bobbyeT.html">Bobbye West-Thompson</a>');  
document.writeln('<a class="dropdown" href="http://www.jeanettewolff.com" target="_blank">Jeanette Wolff</a>');
document.writeln('<a class="dropdown" href="http://homepage.mac.com/boby1/PhotoAlbum1.html" target="_blank">Bob Young</a>');
document.writeln('. . . .');
document.writeln('</center>');
document.writeln('</div>');
}
function writecambriaphotos(pref) {
document.writeln('<table class="pictures" border="0" cellpadding="0" cellspacing="0" width="970"><tbody><tr>');
writephoto(pref, "sunset-2.jpeg","sunset-2.jpeg", "Cambria Sunset","60");
writephoto(pref, "sunset-3.jpeg","sunset-3.jpeg", "Cambria Pines","60");
writephoto(pref, "shore-2.jpeg","shore-2.jpeg", "Cambria Shore","60");
writephoto(pref, "Cove.jpg","Cove.jpg", "Cambria Seacliff","60");
writephoto(pref, "main.jpeg","main.jpeg", "Cambria Main Street","60");
writephoto(pref, "chambers.jpg","chambers.jpg", "Chamber of Commerce","60");
writephoto(pref, "countryroad.jpg","countryroad.jpg", "Cambria Country Road","60");
writephoto(pref, "Boardwalk.jpg","Boardwalk.jpg", "Cambria Moonstone Boardwalk","60");
writephoto(pref, "Red.jpg","Red.jpg", "Cambria Shore","60");      writephoto(pref, "garden.jpg","garden.jpg", "Garden of a Cambria restaurant","60");         writephoto(pref, "seal.jpeg","seal.jpeg", "Elephant Seals","60");         document.writeln('</tr></tbody></table>');
}

var bigName = "";
var bigTitle = "";

function writephoto(pref, img, thumb, title, height) {
document.writeln('<td align="center" valign="middle"><a href="javascript:void(0)"');document.writeln('onclick="bigTitle = &quot;'+title+'&quot;&#59;bigName = &quot;'+pref+'images-home/' + img + '&quot;&#59;showbigimage(event)"');
document.writeln('onmouseout="hidebigimage()">');
document.writeln('<img src="'+pref+'images-home/'+ thumb +'" border="0" height="'+height+'"></a></td>');

}

function showbigimage(e) {
im = new Image();
im.src = bigName;
var ht = im.height;
var wd = im.width;
//alert("height="+ht+"width="+wd);
document.getElementById("bigimage").src=bigName;
if (ht < wd) {document.getElementById("bigimage").width = 400; } else { document.getElementById("bigimage").width = 300; }
document.getElementById("bigdiv").style.display="inline";
//getMouseXY(e);
//document.getElementById("bigdiv").style.top=tempY+15;
getScrollXY();
document.getElementById("bigdiv").style.top=scrollY + 185;
setTimeout( function() { document.getElementById("bigdivtop").innerHTML=bigTitle; RoundedTop("div#bigdivtop","#FAF4e8","silver"); }, 50 );
}

function hidebigimage() {
document.getElementById("bigdiv").style.display="none";
}

// ****** Function to retrieve mouse x-y pos.s

var tempX = 0
var tempY = 0

function getMouseXY(e) {
  var IE = document.all?true:false
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
    return true
}

// ****** Function to get scrolling offset

var scrollX = 0, scrollY = 0;

function getScrollXY() {
  scrollX = 0, 
  scrollY = 0;
  
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrollY = window.pageYOffset;
    scrollX = window.pageXOffset;
    } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrollY = document.documentElement.scrollTop;
    scrollX = document.documentElement.scrollLeft;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrollY = document.body.scrollTop;
    scrollX = document.body.scrollLeft;

  }
  if (!scrollX || scrollX < 0) scrollX = 0;
  if (!scrollY || scrollY < 0) scrollY = 0;
  return true;
}