
function initcat(cat_text){
showdetails(0);
show_cat(cat_text);
}

function showtitle(desc_text){ 
var str=desc_text;
var len=str.length;

with( window.parent.desc_text.document) {
writeln('<html><head>');
writeln('<\/head>');
writeln('<body bgcolor="#000000" topmargin="0">');
writeln('<div align="center">');
writeln('<td><font face="Arial" size="2" color="#EBEBEB">'+desc_text+'</font></td>');
writeln('<\/div>');
writeln('<\/body><\/html>');
close()}
}

function show_cat(cat_text){ 
with( window.parent.cat_text.document) {
writeln('<html><head>');
writeln('<\/head>');
writeln('<body bgcolor="#000000" topmargin="0">');
writeln('<div align="center" valign="top">');
writeln('<td><font face="Arial" size="4" color="#CCCCCC">'+cat_text+'</font></td>');
writeln('<\/div>');
writeln('<\/body><\/html>');
close()}
}


function showdetails(num){
showtitle(art[num][4]);
showimage(art[num][0],art[num][2],art[num][3]);
}

function replace(str, original, replacement) {
var result= "";
 
while(str.indexOf(original) != -1) {
if (str.indexOf(original) > 0)
result = result + str.substring(0, str.indexOf(original)) + replacement;
else
result = result + replacement;
str = str.substring(str.indexOf(original) + original.length, str.length);
}
return result + str;
}

function showimage(imgName,imgWidth,imgHeight) {
imgName = replace(imgName," ","%20");
imgName='art400/' +imgName;

var Ratio;
var maxWidth=screen.width;
var maxHeight=screen.height;
var availWidth=((maxWidth/100)*60);
var availHeight=((maxHeight/100)*50);

var dispHeight;
var dispWidth ;

if (imgWidth > imgHeight) {
     Ratio=(imgWidth / imgHeight); 
     dispWidth=availWidth; 
     dispHeight=(dispWidth / Ratio) ;
     
     if (dispHeight > (availHeight)) {
     	Ratio=(imgHeight / imgWidth);
	    dispHeight=availHeight; 
    	dispWidth=(dispHeight / Ratio) ;
     } 

} else {
    Ratio=(imgHeight / imgWidth); 
    dispHeight=availHeight; 
    dispWidth=(dispHeight / Ratio) ;
     
   if (dispWidth > (availWidth)) {
     	Ratio=(imgWidth / imgHeight); 
     	dispWidth=availWidth; 
     	dispHeight=(dispWidth / Ratio) ;
    }
}

with( window.parent.artpic.document) {
writeln('<html><head>');
writeln('<title>Janet Brennan  Artist<\/title>');
writeln('<link rel="stylesheet" media="screen" href="artmisc/misc.css" type=text/css>');
writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
writeln('<\/head>');
writeln('<body oncontextmenu="return false" onselectstart="return false" ondragstart="return false" >');
writeln('<body topmargin="0" bgcolor="#000000" scroll="auto">');
writeln('<div align="left">');
writeln('<table width="100%" border="0">');
writeln('	<tr><td align="center" width="100%" bordercolor="#C0C0C0">');
writeln('		<table border="1" cellpadding="1" bordercolor="#515151" cellspacing="1">');
writeln('		<tr><td>');
writeln('			<table border="10" cellpadding="25" bgcolor="#FFFFFF" bordercolor="#515151">');
writeln('			<tr><td>');
write('             <A href="');
write("             javascript:window.parent.thumbnails.LargeImage('"+imgName+"',"+dispHeight+","+dispWidth+")");
writeln('           ">');
writeln('           <img border="0" name="bigpic" src='+imgName+' width="'+dispWidth+'" height="'+dispHeight+'" style="border: 4px groove #FFFFFF" onmouseover="window.status=title; return true;" >');
writeln('			<\/a>');
writeln('			<\/td><\/tr>');
writeln('			<\/table><\/td><\/tr>');
writeln('		<\/table><\/td><\/tr>');
writeln('	<tr><td align="center">	<font face="Arial" size="1" color="#FFFFFF">Click artwork for larger image<\/font><\/td><\/tr>');
writeln('	<\/table>');
writeln('<\/div>');
writeln('<\/body><\/html>');
close()}
}

function LargeImage(imgName,imgHeight,imgWidth){
imgName = replace(imgName," ","%20");

var Ratio;
var maxWidth=screen.width;
var maxHeight=screen.height;
var availWidth=((maxWidth/100)*90);
var availHeight=((maxHeight/100)*70);

var dispHeight;
var dispWidth ;

if (imgHeight > imgWidth) {
     Ratio=(availHeight / imgHeight); 
     dispHeight=availHeight; 
     dispWidth=(imgWidth * Ratio) ;
} else {
     Ratio=(availWidth / imgWidth);  
     dispHeight=(imgHeight * Ratio) ;
     dispWidth=availWidth;      

     if(dispHeight > availHeight){
          dispHeight=availHeight;
          Ratio=(availHeight / imgHeight);
         dispWidth=(imgWidth * Ratio);
    }
}
imgWin = window.open("","Janet","width="+screen.width+",height="+screen.height+",left=0,top=0");

with (imgWin.document){
writeln('<html><head><title>Janet Brennan  Artist<\/title>');
writeln('<link rel="stylesheet" media="screen" href="artmisc/misc.css" type=text/css>');
writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
writeln('<\/head>');
writeln('<body oncontextmenu="return false" onselectstart="return false" ondragstart="return false" >');
writeln('<body bgColor=#000000 topmargin=0 leftmargin=0 scroll="auto" onload="self.focus()" onblur="self.close()">');
writeln('	<div align="center">');
writeln('	<table border="0">');
writeln('	<tr><td align="center" valign="top" bordercolor="#C0C0C0">');
writeln('		<table border="1"  bordercolor="#515151">');
writeln('		<tr><td bordercolor="#515151" >');
writeln('			<table border="10" cellpadding="25" bgcolor="#FFFFFF" bordercolor="#515151">');
writeln('			<tr><td width="100%"><p align="center">');
writeln('			<a href="javascript:top.window.close()">');
writeln('			<img border="0" name="bigpic" src='+imgName+' width="'+dispWidth+'" height="'+dispHeight+'" style="border: 4px groove #FFFFFF" onmouseover="window.status=title; return true;" >');
writeln('			</a>');
writeln('		<\/td><\/tr><\/table><\/td><\/tr><\/table><\/td><\/tr>');
writeln('		<tr><td align="center" height="13" bordercolor="#000000">');
writeln('		<font face="Arial" size="1" color="#FFFFFF">Click image to close window<\/font>');
writeln('	<\/td><\/tr><\/table><\/div>');
writeln('<\/body><\/html>');  
close();
}
}


