function doNothing() {
// This function does nothing!
}

function showStatus(msg) {
	window.status = msg
	return true
}

//--------------------------------
// Set global date variables for copyright notice.
//--------------------------------

var today = new Date()
var year = today.getYear()
if(year < 1000){
	year += 1900
}

var monthArray = new Array("January", "February", "March", 
                   "April", "May", "June", "July", "August",
                   "September", "October", "November", "December")


// Set global variables. 
 
var emailProtocol = "mail" + "to:"
var Domain = "@everydaymiraclesphotography.com"

function eMail (masked,visible) {
    this.masked = masked
    this.visible = visible
}

// Associate each masked email address with its visible link text.
// Edit only the items in quotes. 

var emailAddrs = new Array ()
    emailAddrs[0] = new eMail(emailProtocol + "webmaster" + Domain,"Site Feedback")
    emailAddrs[1] = new eMail(emailProtocol + "jch" + Domain,"General Inquiries")
    emailAddrs[2] = new eMail(emailProtocol + "specialorders" + Domain,"Special Order Inquiries")
    emailAddrs[3] = new eMail(emailProtocol + "support" + Domain,"Customer Service")
    emailAddrs[4] = new eMail(emailProtocol + "dealerinquiries" + Domain,"Dealer Inquiries")

function writeMaskedAddr (addrID,subject,style) {
// Write an email link onto the page. 
// Arguments: addrID  = array index of one of the address in the emailAddrs array defined above. 
//                     This identifies which address you want to send the email to.
//                     Example: writeMaskedAddr(0) sends email to the "webmaster" address.
//            subject = Optional quoted string variable for email Subject line. If omitted, no Subject
//                     is supplied for the email message. Users, of course, may add a subject manually.
//                     Example: writeMaskedAddr(2,'Sales inquiry from the web site')
//            style   = Optional CSS style for the link

	document.write("<a href=\"javascript:doNothing()\;\"");
	if (style != '') {
		document.write(" class='" + style + "' ");
	}
	document.write(" onMouseOver=\"return showStatus('Send email.')\" onMouseOut=\"return showStatus('')\"");
	document.write(" onClick=\"parent.location='");
	document.write(emailAddrs[addrID].masked);
	if (subject == '') {
		document.write("'\">");
	} else {
		document.write("?subject=" + subject + "'\">");
	}
	document.write(emailAddrs[addrID].visible);
	document.write("</a>");
}



//--------------------------------
// Image Detail window creator.
// syntax: imageDetail(imagePath)
//--------------------------------

var newImageWindow

function imageDetail(imagePath) {

if (!newImageWindow || newImageWindow.closed) {
    // create the sitemap window
    newImageWindow = window.open("","Images","width=550,height=550")

    // Create .opener property if necessary for old browsers.
    if (!newImageWindow.opener) {
        newImageWindow.opener = window
    }
    
    // Assemble content for window.
    var newContent = "<HTML><HEAD><TITLE>Everyday Miracles Photography Image Detail</TITLE>"
    newContent += "<link href='/Styles/main.css' rel='stylesheet' type='text/css'></HEAD>"
	newContent += "<BODY BGCOLOR='#000000'><CENTER><P><img border='0' src="
    newContent += imagePath
    newContent += "></P>"
    newContent += "<P class='footer'>Copyright &copy; " 
	newContent += year 
	newContent += " <span class='logofont'>Everyday Miracles Photography.</span> All rights reserved.</P>"
    newContent += "<FORM><INPUT TYPE='button' onClick='javascript:window.close()' VALUE='Close'></FORM>"
    newContent += "</CENTER></BODY></HTML>"
    
    // Write HTML into new window document.
    newImageWindow.document.write(newContent)
    newImageWindow.document.close()
    
} else {
    // window's already open; bring to front
    newImageWindow.focus()
    }
}


//--------------------------------
// Mat Detail window creator.
// syntax: imageDetail(imagePath)
//--------------------------------

var newMatWindow

function matDetails() {

if (!newMatWindow || newMatWindow.closed) {
    // create the sitemap window
    newMatWindow = window.open("/details.html","Mat","width=450,height=450")

    // Create .opener property if necessary for old browsers.
    if (!newMatWindow.opener) {
        newMatWindow.opener = window
    }
        
} else {
    // window's already open; bring to front
    newMatWindow.focus()
    }
}
