// JavaScript Document

var accordion;
var count = 1;
var tickerOver = false;
var myStyle = 'block';


//window.onDomReady(function() {
window.addEvent('domready', function() {
						   
		var myTips = new Tips($$('.toolTipElement'), {
			timeOut: 700,
			maxTitleChars: 30, /*I like my captions a little long*/
			maxOpacity: .8 /*let's leave a little transparancy in there */
		});
		makeAccordions();	
		//added from index-squeeze.htm
		SqueezeBox.initialize({
				size: {x: 350, y: 400},
				ajaxOptions: {
					method: 'get'
				}
			});
		$$('a.boxed').each(function(el) {
				el.addEvent('click', function(e) {
					new Event(e).stop();
					SqueezeBox.fromElement(el);
				});
			});

			$$('.panel-toggler').each(function(el) {
				var target = el.getLast().setStyle('display', 'none');
				el.getFirst().addEvent('click', function() {
					target.style.display = (target.style.display == 'none') ? '' : 'none';
				});
			});
			//added from index-squeeze.htm ends here

});


function makeAccordions(){

//alert('I am Starting');

if(document.body.innerHTML.test('class="Accordion') || document.body.innerHTML.test('class=Accordion')) {
		$$('dl.Accordion').each(function(panel){
			
	accordion = new Fx.Accordion(panel.getElements(' dt.accToggler'), panel.getElements('dd.accContent'), 
																				
				{ 
	//start:'open-first',
    show:showopen,
	alwaysHide:true,
    onActive: function(toggler){
      toggler.setStyle('background-image', 'url(pics/b-main-down.gif)');
    },
    onBackground: function(toggler){
      toggler.setStyle('background-image', 'url(pics/b-main-up.gif)');
    }
				
			}
			);	
		
		});


	ezindex = new Fx.Accordion(document.getElementsByClassName('ezToggler'), document.getElementsByClassName('ezContent'),{
    start:'open-first',
	alwaysHide:true,
    onActive: function(toggler){
      toggler.setStyle('background-image', 'url(pics/hideindex.gif)');
    },
    onBackground: function(toggler){
      toggler.setStyle('background-image', 'url(pics/showindex.gif)');
    }
  });
	}
	
	
}

function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}

		var openSmooth = function() {
			var from = $('myGallery').clone(), smooth, crsl;
			SqueezeBox.fromElement(from, {size: {x: 465, y: 350}}).chain(function() {
				smooth = new gallery(this.content.getFirst(), {
					timed: false
				});
				// dirty hacked ;)
				$(document.body).addClass('jdGallery');
				crsl = smooth.carouselContainer.element;
				crsl.injectAfter(SqueezeBox.window);
				crsl.setStyles({'z-index': SqueezeBox.options.zIndex + 3});
			}).chain(function() {
				$(document.body).removeClass('jdGallery');
				crsl.remove();
			});
		}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
