// Catherine Lagot General API(JavaScript)
// Author : EJFIIIWebDesign.com

//Browser Brand Determination
var isIE=false; var isNN=false; var isOP=false; isFF=false; 
if (navigator.userAgent.indexOf("Opera")!=-1) isOP=true;
if ((navigator.appName.indexOf("Microsoft")!=-1) && (navigator.userAgent.indexOf("Opera")==-1)) isIE=true;
if (navigator.userAgent.indexOf("Firefox")!=-1) isFF=true;
if ((navigator.appName.indexOf("Netscape")!=-1) && (navigator.userAgent.indexOf("Firefox")==-1)) isNN=true;

//IE Exclusive StyleSheet Additions
	if (isIE) {
		document.write("<link rel='stylesheet' href='http://www.catherinelagot.com/clStyle_IE.css' type='text/css' />");
		}

// Center Content on Screen
	function positionPresentation(page) {
	var viewWidth = 0, viewHeight = 0, contentWidth = 750, contentHeight = 550, posX = 0,  posY = 0;

	// Determine Available Window Size
  		if (isIE) {
   			viewWidth = document.documentElement.clientWidth;
   			viewHeight = document.documentElement.clientHeight;
		}else{
   			viewWidth = window.innerWidth;
			viewHeight = window.innerHeight;
  			} 

	// Set Content Window Coordinates

		if (viewWidth < 800) {
			posX = 0;
		}else{
			posX = Math.floor((viewWidth-contentWidth)/2);
			}
		if (viewHeight < 600) {
			posY = 0;
		}else{
			posY = Math.floor((viewHeight-contentHeight)/2);
			}

	// Apply New Window Coordinates
		document.getElementById('content').style.left = posX+"px";
		document.getElementById('content').style.top = posY+"px";
		if (page != "home") document.getElementById('authorLink').style.top = posY+536+"px";
		}

// Menu Model Preview
	function keyImageSwap(pic) {
		document.getElementById("keyImage").src="http://catherinelagot.com/images/"+pic+"_k.jpg";
		}

// Oil Painting Key Image Swap
	function keyPaintingSwap(pic) {
		document.getElementById('paintingImage').style.visibility = "visible";
		document.getElementById('paintingImage').src="images/paintings/"+pic+"_k.jpg";
		}

// Process Slide Show (with fade for Internet Explorer)
	function slideShow() {
		window.setTimeout("showSlide02()", 4000);
		window.setTimeout("showSlide03()", 8000);
		window.setTimeout("showSlide04()", 12000);
		window.setTimeout("showSlide05()", 15000);
		window.setTimeout("showSlide01()", 18000);
		window.setTimeout("slideShow()", 18000);
		}
	function showSlide01() {
		if (isIE) processSlides.filters[0].Apply();
		document.getElementById("process05").style.visibility="hidden";
		document.getElementById("process01").style.visibility="visible";
		if (isIE) processSlides.filters[0].Play();
		}
	function showSlide02() {
		if (isIE) processSlides.filters[0].Apply();
		document.getElementById("process01").style.visibility="hidden";
		document.getElementById("process02").style.visibility="visible";
		if (isIE) processSlides.filters[0].Play();
		}
	function showSlide03() {
		if (isIE) processSlides.filters[0].Apply();
		document.getElementById("process02").style.visibility="hidden";
		document.getElementById("process03").style.visibility="visible";
		if (isIE) processSlides.filters[0].Play();
		}
	function showSlide04() {
		if (isIE) processSlides.filters[0].Apply();
		document.getElementById("process03").style.visibility="hidden";
		document.getElementById("process04").style.visibility="visible";
		if (isIE) processSlides.filters[0].Play();
		}
	function showSlide05() {
		if (isIE) processSlides.filters[0].Apply();
		document.getElementById("process04").style.visibility="hidden";
		document.getElementById("process05").style.visibility="visible";
		if (isIE) processSlides.filters[0].Play();
		}

// Pop Up Window Feature with Dynamically created content
	// Zeros (0) in text are globally (/g) converted to spaces (&nbsp;)
	function createpopUpWin(image,text) {
		popUpWin=window.open("",image, "width=250px,height=245px,toolbar=0,status=0,menubar=0,scrollbars=0,resizable=1,location=0");
		if (window.focus) {popUpWin.focus();}
		popUpCode="<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'\n'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>\n\n<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>\n<head>\n\n<meta http-equiv='content-type' content='text/html; charset=iso-8859-1' />\n<meta http-equiv='content-lauguage' content='en' />\n<meta http-equiv='imagetoolbar' content='no' />\n<meta name='author' content='EJFIII Web Design - JavaScript Created xHTML' />\n<meta name='copyright' content='2008 Catherine Lagot' />\n\n<title>Catherine Lagot - "+popUpTitle.replace(/0/g,'&nbsp;')+": "+text.replace(/0/g,'&nbsp;')+"</title>\n\n";
		popUpCode+="<style type='text/css' />\n\tbody\t{background-color: #E9EBEC;}\n\timg\t{padding: 0px 0px 10px 0px; border: 0px;}\n\t.stone\t{font-family:'Trebuchet MS', Arial, Helvetica, sans-serif; color: #284CA9; font-weight: bold; font-size: 13px; padding: 0px 25px 0px 0px; text-align: right;}\n</style>\n</head>\n\n";
		popUpCode+="<body>\n";
		popUpCode+="<table width='250px' cellspacing='0px' cellpadding='0px'>\n\t<tr>\n\t\t<td colspan='2'><img src='http://www.catherinelagot.com/images/"+popUpPath+image+"_k.jpg' width='230px' height='200px' alt='"+popUpTitle.replace(/0/g,'&nbsp;')+": "+text.replace(/0/g,'&nbsp;')+"' /></td>\n\t";
		popUpCode+="</tr><tr>\n\t\t";
		popUpCode+="<td style='text-align: left;'>&nbsp;<a href='javascript: window.close();'><img src='http://www.catherinelagot.com/images/colors/xButton.jpg' width='16px' height='16px' alt='Close Window' /></a></td>\n\t\t";
		popUpCode+="<td style='text-align: right;' valign='top'><span class='stone'>"+text.replace(/0/g,'&nbsp;')+"</span></td>\n\t";
		popUpCode+="</tr>\n</table>\n\n</body></html>\n";
		popUpWin.document.write(popUpCode);
		popUpWin.document.close();
		}

// Set Default Window.Status Message
	window.defaultStatus="Catherine Lagot - Artisans de France";