if(!window.Seraphim) {
	alert('You must include Seraphim.js!');
}
var TwoRoads = Class.create(Seraphim,{
	Name : 'TwoRoads',
	Version : '1.0',
	Author : 'Matt Balogh <matt.balogh@seraphimllc.com>',
	Creation : 'Weds Dec 30 20:24:00 2008',
	initialize: function($super){
		this.portfolios = new Hash();
		this.portfoliLinks = '';
		this.homeSetId = '';
		this.gallerySetId = '';
		this.portraitsSetId = '';
		this.contactLinks = '';
		this.portraitsLinks = '';
		$super();
	},
	init: function($super){
		this.initPortfolioLinks();
		this.initContactLinks();
		this.initPortraitsLinks();
		$super();
	},
	setPortfolios: function(portfolios){
		this.portfolios = portfolios;
	},
	getPortfolios: function(){
		return this.portfolios;
	},
	setPortfolioLinks: function(portfolioLinks){
		this.portfolioLinks = portfolioLinks;
	},
	getPortfolioLinks: function(){
		return this.portfolioLinks;
	},
	setHomeSetId: function(homeSetId){
		this.homeSetId = homeSetId;
	},
	getHomeSetId: function(){
		return this.homeSetId;
	},
	setGallerySetId: function(gallerySetId){
		this.gallerySetId = gallerySetId;
	},
	getGallerySetId: function(){
		return this.gallerySetId;
	},
	setPortraitsSetId: function(portraitsSetId){
		this.portraitsSetId = portraitsSetId;
	},
	getPortraitsSetId: function(){
		return this.portraitsSetId;
	},
	setContactLinks: function(contactLinks){
		this.contactLinks = contactLinks;
	},
	getContactLinks: function(){
		return this.contactLinks;
	},
	setPortraitsLinks: function(portraitsLinks){
		this.portraitsLinks = portraitsLinks;
	},
	getPortraitsLinks: function(){
		return this.portraitsLinks;
	},
	initPortfolioLinks: function(){
		var linksHTML = '';
		$H(this.getPortfolios()).each(function(pair) {
			linksHTML = linksHTML + '<a href="#" onClick="objTwoRoads.showGallery(\''+pair.key+'\');return false;">'+pair.value+'</a>';
		});
		this.setPortfolioLinks(linksHTML);
	},
	initContactLinks: function(){
		var linksHTML = '';
		linksHTML = linksHTML + '<a href="#" onClick="objTwoRoads.showPurchase();return false;">Purchase</a>';
		linksHTML = linksHTML + '<a href="#" onClick="objTwoRoads.showInquiry();return false;">Inquiry</a>';
		this.setContactLinks(linksHTML);
	},
	initPortraitsLinks: function(){
		var linksHTML = '';
		linksHTML = linksHTML + '<a href="#" onClick="objTwoRoads.showPortraitsProcess();return false;">The Process</a>';
		linksHTML = linksHTML + '<a href="#" onClick="objTwoRoads.showPortraitsGallery();return false;">Portrait Gallery</a>';
		this.setPortraitsLinks(linksHTML);
	},
	showPortfolioLinks: function(){
		$('subNav').hide();
		$('subNav').innerHTML = this.getPortfolioLinks();
		Effect.Appear('subNav', { duration: 0.5 });
	},
	showContactLinks: function(){
		$('subNav').hide();
		$('subNav').innerHTML = this.getContactLinks();
		Effect.Appear('subNav', { duration: 0.5 });
	},
	showPortraitsLinks: function(){
		$('subNav').hide();
		$('subNav').innerHTML = this.getPortraitsLinks();
		Effect.Appear('subNav', { duration: 0.5 });
	},
	clearSubNav: function(){
		Effect.Fade('subNav', {
			duration: 0.5,
			afterFinish: function(){
				$('subNav').innerHTML = '';
			}
		});
	},
	showGallery: function(gallerySetId){
		if(gallerySetId) {
			this.setGallerySetId(gallerySetId);
		}

		location.href = "/gallery.php?id="+this.getGallerySetId();
	},
	showHome: function(){
		location.href = "/index.php";
	},
	showAbout: function(){
		location.href = "/about.php";
	},
	showBlog: function(){
		location.href = "/blog.php";
	},
	showPurchase: function(){
		location.href = "/purchase.php";
	},
	showInquiry: function(){
		var imageViewer;
		imageViewer = new Seraphim.modalDialog();
		imageViewer.setStausBarVisible(true);
		imageViewer.setReqOptions({
			onClose: function(){
			},
			onCancel: function(){
			}
		});
		imageViewer.setWidth(500);
		imageViewer.setHeight(450);

		var iframeElement = new Element('IFRAME',{
			height: imageViewer.getHeight()-20,
			width: imageViewer.getWidth()-5,
			scrolling: 'auto',
			id: 'iframe',
			frameborder: 0,
			src: '/inquiry.php'
		});
		$(iframeElement).setStyle({
			zIndex : 100001,
			display : 'block'
		});
		imageViewer.setHtmlContent(iframeElement);
		imageViewer.display();
	
		// Customize the display for TwoRoads
		$('Seraphim_statusBarDiv').setStyle({
			padding: '1px',
			backgroundColor: '#DABA6A'
		});
		$('Seraphim_messageAreaDiv').setStyle({
			borderLeftColor: '#DABA6A',
			borderLeftStyle: 'solid',
			borderLeftWidth: '1px',
			borderRightColor: '#DABA6A',
			borderRightStyle: 'solid',
			borderRightWidth: '1px',
			borderBottomColor: '#DABA6A',
			borderBottomStyle: 'solid',
			borderBottomWidth: '1px',
			height: '431px'
		});
		$('Seraphim_modalBox_contentDiv').setStyle({
			borderColor: '#DABA6A',
			borderWidth: '1px'
		});
	},
	showPortraitsProcess: function(){
		location.href = "/portraits_process.php";
	},
	showPortraitsGallery: function(){
		location.href = "/gallery.php?id="+this.getPortraitsSetId();
	}
});