var menu_ids = [
'sidebar_panel-01', 'sidebar_panel-02', 'sidebar_panel-03'
]

var open_menu_ids = [
'open_menu', 'open_menu-02', 'open_menu-03'
]





window.onload = function(){
	

// sidebar open menu

my_class = document.body.className;

//alert(my_class);


// is open_menu is exists then initialize close

for(i=1; i<=menu_ids.length; i++) {
		my_id = 'sidebar_panel-0' + i;
		panel_obj = document.getElementById(my_id);
		if (panel_obj) {
		if(i == 1) {
			var CollapsiblePanel1 = new Spry.Widget.CollapsiblePanel(panel_obj, {contentIsOpen:false});
		} else if( i==2 ){
			var CollapsiblePanel2 = new Spry.Widget.CollapsiblePanel(panel_obj, {contentIsOpen:false});
		} else if(i==3) {
			var CollapsiblePanel3 = new Spry.Widget.CollapsiblePanel(panel_obj, {contentIsOpen:false});
		} // end of if
		//alert(CollapsiblePanel1.contentIsOpen);
	
		} // end of if
	
} // end of for

//CollapsiblePanel3.open() ;

if (my_class.indexOf('open_menu') != -1 ) {
	
	var menu_id = false;
	for (var i = 1; i <= open_menu_ids.length; i++) {
		if (my_class.indexOf('open_menu-' + '0' + i) != -1 ) {
			var menu_id = 'sidebar_panel-0' + i;	
	} // end of if #2
} // end of for #1
//open menu is exist but menu_id is not found then menu_id = sidebar_panel-01
if(menu_id == false) {menu_id = 'sidebar_panel-01'}

obj = document.getElementById(menu_id);

if (obj) {// current page tgt panel menu is exists

	for (var i = 0; i < open_menu_ids.length; i++) {
		
		//tgt = document.getElementById('sidebar_panel-0' + (i + 1));
		tgt_panel = eval('CollapsiblePanel' + (i+1));
		
		if (menu_ids[i] == menu_id) {
			tgt_panel.open() ;
			
		} else {
			
			
			
		} // end of if #3
		
	} //end of for #2
	
	
	
} // endo if #4

} // end of if #1




	// title visual animation
	
	obj = document.getElementById('title_visual');
	if (obj) {
		var fade1 = new Spry.Effect.DoFade(obj, {duration: 1000, from: 10, to: 100, toggle: false, transition: Spry.circleTransition});
		var slide1 = new Spry.Effect.DoSlide(obj, {duration: 1200, horizontal: true, from: '780.0px', to: '800.0px', toggle: false});
	} // end of if
	
	
/*
Standards Compliant Rollover Script
Author : Daniel Nolan
../../../www.bleedingego.co.uk/webdev.php
*/
	
if (!document.getElementById) return;

var aPreLoad = new Array();
var sTempSrc;
var aImages = document.getElementsByTagName('img');

for (var i = 0; i < aImages.length; i++) {	
	if (aImages[i].className == 'hover') {
		var src = aImages[i].getAttribute('src');
		var ftype = src.substring(src.lastIndexOf('.'), src.length);
		var hsrc = src.replace(ftype, '_f2'+ftype);
		// add new attrivute
		aImages[i].setAttribute('hsrc', hsrc);

		aPreLoad[i] = new Image();
		aPreLoad[i].src = hsrc;

		aImages[i].onmouseover = function() {
		sTempSrc = this.getAttribute('src');
		this.setAttribute('src', this.getAttribute('hsrc'));
	} // end of if

	aImages[i].onmouseout = function() {
	if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_f2'+ftype, ftype);
		this.setAttribute('src', sTempSrc);
	} // end of if
} // end of for
} // end of if

	
	
} // end of function


