function copyright() {
	var date = new Date();
	var year = date.getFullYear();
	document.write('Copyright &#169; 1999-' + year + ' <a href="/pub2/company.html">Pictopia Inc</a>. All Rights Reserved.');
}

function array_merge(arr) {
	var merged = arr;
	for (var i = 1; i < arguments.length; i++) {
		merged = merged.concat(arguments[i]);
	}
	return merged;
}

function randQuotes(style, quote) {
	var quote;
	var testimonial = new Array();
	var testimonial2 = new Array();
	
	testimonial[0] = "<em>\"Just had to let you know I just received my enlargements and these are simply incredible! The quality is exceptional, and at this enlarged size I'm overwhelmed at its clarity. I'm completely blown away. I'm truly looking forward to doing much more business with Pictopia. Thank you so very  much for providing such a superb product while making this process so easy!</em><br /><div class=\"testimonial_credit\">Julie Singletary, Art Central<br /> Los Angeles, California</div>";
	
	testimonial[1] = "<em>Our experience with Pictopia in creating and managing The Washington Post's online Photo Store has been rewarding. Pictopia's staff is expert in handling and reproducing high-quality digital imagery and comes up with numerous ideas to assist our marketing efforts. And Pictopia's fulfillment operations have been stellar.</em><div class=\"testimonial_credit\">Alan Shearer<br />Editorial Director/General Manager<br />Washington Post Writers Group</div>";

	testimonial[2] = "<em>We chose Pictopia as our exclusive print-on-demand fulfillment partner for our MediaPrint offering after an extensive RFP process. Pictopia was far and away the best partner, based on the quality of print, technology, business model, pricing, and installed client base.</em><div class=\"testimonial_credit\">Bert Sugayan<br />Vice President, Rights Services<br />Getty Images</div>";
	
	
	testimonial[3] = "<em>...it has been my pleasure to work with Pictopia for close to two years. Pictopia handles virtually all digital printing for the AP NewsPhotos department, and without exception we have been extremely pleased with their service and quality. I would recommend Pictopia's services without reservation.</em><div class=\"testimonial_credit\">Chuck Zoeller<br />Director, AP NewsPhotos Library<br />Associated Press</div>";
	
	
	testimonial[4] = "<em>The San Francisco Chronicle started working with Pictopia in 2002. As a large metro news organization, we're always looking for new revenue generating opportunities. Pictopia provided us with the perfect opportunity to expand in a new direction while offering our readers quality photo reprints through an e-commerce solution. Working with Pictopia on the launch of the photo store on SFGate.com was a great collaborative effort -- and we continue to see notable results.</em><div class=\"testimonial_credit\">Kay Marie Jacobson<br />Production Director<br />SFGate.com (San Francisco Chronicle)</div>";
	
	
	testimonial[5] = "<em>We needed a photo reprints solution that could be built once and then generate revenue almost hands-free for months and even years to come. Pictopia has filled that role well. Plus, customer satisfaction has been extremely high.</em><div class=\"testimonial_credit\">Mike Coleman<br />Director, Online Services<br />The Arizona Republic</div>";
	
	
	testimonial[6] = "<em>We're always looking for revenue generating opportunities, and Pictopia's PTP program has opened that door for us. We've now got an easy to use customer service solution that also generates significant profit from our photographs.</em><div class=\"testimonial_credit\">Bob Jonason<br />Director, Online Services<br />The Indianapolis Star</div>";
	
	
	testimonial[7] = "<em>Pictopia provides a great revenue and customer service solution for The Marin IJ. Pictopia's PTP program is an excellent way to help our readers find and buy photo reprints. When we launched PTP, there was no capital or technology investment required on our part to implement this program, which now provides us with great results. Pictopia continues to work with us to help customize products and solutions to help grow this business.</em><div class=\"testimonial_credit\">Scott Henry<br />Manager, Photo Department<br />Marin Independent Journal</div>";

// Secondary Text Block

	testimonial2[0] = "<em>Just had to let you know I just received my enlargements and these are simply incredible! The quality is exceptional, and at this enlarged size I'm overwhelmed at its clarity. I'm completely blown away.  I'm truly looking forward to doing much more business with you and Pictopia. Thank you so very much for providing such a superb product while making this process so very easy!</em><div class=\"testimonial_credit\">Julie Singletary<br />Art Central<br />Los Angeles, CA</div>";
	
	
	testimonial2[1] = "<em>Thanks for the beautiful prints; yours is a great service that offers to put the fun back in my life. I'm so tired of fighting with Epson / HP / Tektronix printers only to get inferior results.</em><div class=\"testimonial_credit\">David Cortner<br />Original Photography</div>";
	
	
	testimonial2[2] = "<em>We have a large format inkjet plotter in-house but need the superior level of detail provided by the Pictopia prints for our remotely sensed imagery.</em><div class=\"testimonial_credit\">Dr. Nina Maggi Kelly<br />Research Scientist, Sudden Oak Death<br />Department of Environmental Sciences, Policy and Management<br />University of California, Berkeley</div>";
	
	
	testimonial2[3] = "<em>Pictopia is providing us with great photo prints and an excellent level of service. We hope to migrate six terabytes of aerial imagery to Pictopia over the next 12 months and have our customers place orders on the site directly.</em><div class=\"testimonial_credit\">Mark Safran<br />Chief Operating Officer<br />HJW/Pacific Aerial</div>";
	
	
	testimonial2[4] = "<em>I've found Pictopia to be a great service for creating comps to send to our clients. It's less expensive than running a Matchprint, and we don't have to hassle with all the color adjustments to our desktop inkjet!</em><div class=\"testimonial_credit\">Bonnie Phippen<br />Principal, Phippen Design Group</div>";
	
	
	testimonial2[5] = "<em>I was stunned when I saw the print of an Andromeda star field image that I sent to Pictopia. The star field was exquisitely sharp, rich and colorful. I can't begin to describe how valuable this capability is for sharing what we do and what we want to do.</em><div class=\"testimonial_credit\">Geoff Marcy<br />Astronomer, UC Berkeley<br />Discoverer of 25 planets outside our Solar System</div>";
	
	
	testimonial2[6] = "<em>I've been looking for a service like this for over a year. Pictopia has cut our turnaround for reprints from 3 weeks to 2 days, and they include the extra convenience of drop shipping directly to our customers.</em><div class=\"testimonial_credit\">(name withheld by request)<br />Director of Photography of a major metropolitan newspaper</div>";
	
		
//	testimonial2[8] = "<b>Breaking News!</b><br />Pictopia recently ranked favorably in a blind test of custom photo labs. Raw file conversion and custom photo editing shine! We're pleased with results and even more committed to providing the very best prints and services we possibly can. Read the story at <a target=\"_blank\" href=\"http:\/\/photo.net/learn/printing/labs\">photo.net</a></b>";


//	testimonial2[8] = "<b>Breaking News!</b><br />Redesigned Northwestern University Athletics website features prominent link to photo store powered by Pictopia. Read the story at <a target=\"_blank\" href=\"http:\/\/nusports.cstv.com/genrel/071408aaf.html\">nusports.cstv.com</a>";

//	testimonial2[8] = "<b>Breaking News!</b><br />UC Berkeley photo exhibit \"The American President\" organized by photographer Ken Light and printed by Pictopia. Read about it at <a target=\"_blank\" href=\"http:\/\/www.sfgate.com/cgi-bin/article.cgi\?f=/c/a/2008/09/09/BAK712O91Q.DTL\">SFGate.com</a>";


testimonial2[8] = "<b>Photography in the News!</b><br />Remember Yankee Stadium with historic images from then and now. <a target=\"_blank\" href=\"http:\/\/pictopia.com/gallery/syn\?name=Tribute+to+Yankee+Stadium\">Visit Pictopia Collections</a>";

		
	var allQuotes = array_merge(testimonial, testimonial2);
	
	var quoteNo = Math.floor(Math.random()*testimonial.length+1)
	var quoteNo = Math.floor(Math.random()*testimonial2.length+1)
	
	if(style == "ptp") {
		if(quote) {
			document.write(testimonial[quote])
		} else {
			document.write(testimonial[quoteNo-1])
		}
	} else if (style == "2p") {
		if(quote) {
			document.write(testimonial2[quote])
		} else {
			document.write(testimonial2[quoteNo-1])
		}
	} else {
		if(quote) {
			document.write(allQuotes[quote])
		} else {
			document.write(allQuotes[Math.floor(Math.random()*allQuotes.length+1)])
		}
	}
}

function toggleLayer(whichLayer) {
	if (document.getElementById)	{
		var style2 = document.getElementById(whichLayer).style;
		if (style2.display) 
			hideLayer(whichLayer);
		else 
			showLayer(whichLayer);
	}
}

function showLayer(whichLayer) {
	if (document.getElementById)	{
		var style2 = document.getElementById(whichLayer).style;
		style2.display = "block";
	}
}

function hideLayer(whichLayer) {
	if (document.getElementById)	{
		var style2 = document.getElementById(whichLayer).style;
		style2.display = "";
	}
}


function clearLayer(whichLayer) {
	if (document.getElementById)	{
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display = "";
	}
}

function onFocus(formName,textField) {
	if (document.getElementById('tpl_login').style.display == "block" ||
		document.getElementById('tpl_checkOrder').style.display == "block") {
		eval('document.'+formName+'.'+textField+'.focus()');
	}
}

function goPop(tgt, url, w, h) { 
	var params = 'scrollbars=yes,resizable=yes,toolbar=no,status=yes,menubar=no,width=' + w + ',height=' + h;
	var win = window.open(url, tgt, params);
	win.focus();
}

/***********************************************
* Ultimate Fade-In Slideshow (v1.51): © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var fadeimages=new Array()
var imageTitle=new Array()

var path = "/pub2/images/home_photos/"; // End path with trailing slash
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages[0]=[ path + "natgeo.png", "", ""]
imageTitle[0]="National Geographic"
fadeimages[1]=[ path + "washingtonpost.png", "", ""]
imageTitle[1]="Washington Post"
fadeimages[2]=[ path + "ap.png", "", ""]
imageTitle[2]="Associated Press"

//fadeimages[0]=["ap.png", "", ""] //plain image syntax
//fadeimages[1]=["photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax
//fadeimages[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax
 
var fadeimages2=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
//fadeimages2[0]=["photo1.jpg", "", ""] //plain image syntax
//fadeimages2[1]=["photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax
//fadeimages2[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax
 
var fadebgcolor="#FFFFFF"

////NO need to edit beyond here/////////////
 
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML='<div class="provTitle">'+imageTitle[picindex]+'</div>'+slideHTML

}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
else if (crossobj.style.opacity&&!crossobj.filters)
crossobj.style.opacity=this.degree/101
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}

//may autoload order status; 
function checkO() {
	if (!location.href.match(/^.*\?(.*\&)?o=[^\&]+/)) 
		return;
	var o = location.href.replace(/.*\?(.*\&)?o=/,'').replace(/\&.*/, '');
	document.getElementById('orderResponseIframe').src='https://' 
			+  window.location.hostname.replace(/www\./,'') 
			+ '/perl/order_status?process=ostatus&o='+o;showLayer('orderResponse');
}


