/*	=====================================================
	To toggle a hidden div tag
===================================================== */
function toggleHidden(obj) {
	var object = document.getElementById(obj);
	if (object.style.display != "block") {
		object.style.display = "block";
	}
	else if (object.style.display != "none") {
		object.style.display = "none";
	}
}


var myrules = {
	'#clientLoginMenu' : function(el){
		el.onclick = function(){
			new Effect.toggle('clientLoginBg', 'appear', {duration: 0.3, afterFinish: function() {$('clientLogin').focus()}});
		}
	},
	'#clientLogin' : function(el) {
		if(el) {
			el.onfocus = function () {
				this.style.backgroundColor = '#FBFFD1';
			},
			el.onblur = function () {
				this.style.backgroundColor = '#fff';
				new Effect.Fade('clientLoginBg', {duration: 0.3});
			}
		}
	}
};

Behaviour.register(myrules);



// load effects on pageload
Event.observe(window, 'load', loadScripts, false);

function loadScripts() {
	// load the accordion stuff
	if ($('sessionAccordion')) {
		var verticalAccordion1 = new accordion('sessionAccordion', {
			classNames : {
				toggle : 'toggleTitle',
				toggleActive : 'toggleTitle_active',
				content : 'contentContainer'
			}
		});
		
		//*
		var verticalAccordion2 = new accordion('packageAccordion', {
			classNames : {
				toggle : 'toggleTitle',
				toggleActive : 'toggleTitle_active',
				content : 'contentContainer'
			}
		});
		/**/
		
		verticalAccordion1.activate($$('#sessionAccordion .toggleTitle')[0]);
		verticalAccordion2.activate($$('#packageAccordion .toggleTitle')[0]);
	}

	
	
	// load the prototip stuff
	if ($('digitalNegatives')) {
		new Tip('digitalNegatives', 
			'<div class="bubbleContent">Professionally processed digital files ensure maximum viewing and print quality.</div>', 
			{
				fixed: true,
				className: 'bubble', 
				delay: 0, 
				effect: 'appear', 
				offset: {x:145, y:-17}
			}
		);
		new Tip('storyboard', 
			'<div class="bubbleContent">Professionally designed & printed storyboard narrates the emotions of images.</div>', 
			{
				fixed: true,
				className: 'bubble', 
				delay: 0, 
				effect: 'appear', 
				offset: {x:145, y:-10}
			}
		);
		new Tip('album', 
			'<div class="bubbleContent">Custom designed & printed coffee table album for your permanent collection.</div>', 
			{
				fixed: true,
				className: 'bubble', 
				delay: 0, 
				effect: 'appear', 
				offset: {x:145, y:-17}
			}
		);
		new Tip('slideshowWeb', 
			'<div class="bubbleContent">Show off your latest images in one slick slideshow over the web!</div>', 
			{
				fixed: true,
				className: 'bubble', 
				delay: 0, 
				effect: 'appear', 
				offset: {x:145, y:-17}
			}
		);
		new Tip('slideshowiPod', 
			'<div class="bubbleContent">Take your slideshow with you wherever you go on your video iPod or iPhone.</div>', 
			{
				fixed: true,
				className: 'bubble', 
				delay: 0, 
				effect: 'appear', 
				offset: {x:145, y:-10}
			}
		);
		new Tip('slideshowDVD', 
			'<div class="bubbleContent">Pop in a slideshow DVD, sit back and enjoy the slideshow on TV! (Popcorns not included)</div>', 
			{
				fixed: true,
				className: 'bubble', 
				delay: 0, 
				effect: 'appear', 
				offset: {x:145, y:-17}
			}
		);
		new Tip('printingService', 
			'<div class="bubbleContent">Don\'t want to deal with the labs? Let me handle of the logistics for you.</div>', 
			{
				fixed: true,
				className: 'bubble', 
				delay: 0, 
				effect: 'appear', 
				offset: {x:145, y:-10}
			}
		);
	}
}