//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////// Version 1.0 //////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//																												//
// Javascript Author: Michael Barbano																			//
// Date Created: October, 01 2006																				//
// Author Contact: me@grouchypants.com  // www.grouchypants.com													//
// Dependant on the Prototype & Scriptaculous libraries. You can download the lattest versions at:				//	
// http://prototype.conio.net/ (prototype) -------- http://script.aculo.us/ (scriptaculous)						//
//																												//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////// BEGIN CODE /////////////////////////////////////////////////

//::::::: Begin functions for displaying submenus :::::://
function showSubMenu(id){
	$(id).style.display = 'block';
}


//:::::::: E/O functions for displaying submenus :::::://

var Popup = {
  open: function(options)
  {
    this.options = {
      url: '#',
      width:690,
      height: 550,
      name:"_blank",
      location:"no",
      menubar:"no",
      toolbar:"no",
      status:"yes",
      scrollbars:"yes",
      resizable:"yes",
      left:"",
      top:"",
      normal:false
    }
    Object.extend(this.options, options || {});

    if (this.options.normal){
        this.options.menubar = "yes";
        this.options.status = "yes";
        this.options.toolbar = "yes";
        this.options.location = "yes";
    }

    this.options.width = this.options.width < screen.availWidth?this.options.width:screen.availWidth;
    this.options.height=this.options.height < screen.availHeight?this.options.height:screen.availHeight;
    var openoptions = 'width='+this.options.width+',height='+this.options.height+',location='+this.options.location+',menubar='+this.options.menubar+',toolbar='+this.options.toolbar+',scrollbars='+this.options.scrollbars+',resizable='+this.options.resizable+',status='+this.options.status
    if (this.options.top!="")openoptions+=",top="+this.options.top;
    if (this.options.left!="")openoptions+=",left="+this.options.left;
    window.open(this.options.url, this.options.name,openoptions );
    return false;
  }
}


//--------------------------------[ nothing below this line is used in the eerosaarinen site]-------------------//
var profile_crumb = false;

function toggleProfile(id){
	if(profile_crumb == id) {
		Effect.BlindUp( id, {scaleY: false, scaleX: true, duration: 0.7});
		profile_crumb = false;	
	}else if(profile_crumb) {
		Effect.BlindUp( profile_crumb, {scaleY: false, scaleX: true, duration: 0.7, queue: 'front', delay: 0.3});
		Effect.BlindDown( id, {scaleY: false, scaleX: true,  duration: 0.7, queue: 'end'});
		profile_crumb = id;
	}else{
		Effect.BlindDown(id, {scaleY: false, scaleX: true, duration: 0.7});
		profile_crumb = id;		
	}
	id = false;	
}


var breadcrumb = false;

function toggleImage(id){
	if(breadcrumb == id) {
		//Effect.toggle( id, 'appear', {duration: 0.7});
		//breadcrumb = false;
	}else if(breadcrumb) {
		Effect.Fade( breadcrumb, {duration: 0.4, queue: 'front'});
		Effect.Appear( id,{duration: 0.7, queue:'end'});
		breadcrumb = id;
	}else{
		Effect.Fade( 'image1', {duration: 0.4, queue: 'front'});
		Effect.Appear( id, {duration: 0.7, queue:'end'});
		breadcrumb = id;
	}
}
////////////////////////////////////////////////////////////////////////////////
function changeNavColors(on,total_links, prefix, current_link_num){
	for(counter=1; counter <= total_links; counter++){
		nav_id = 'nav_option' + counter;
		$('nav_option'+counter).style.color = '';		
	}
	$('nav_option'+current_link_num).style.color = on;
	returntocolor = on;	
}

// initialize variables for rollover states 
var slideshow_breadcrumb = false;
var returntocolor = "";

function slideShow(id, prefix, selected_color, totalnavs, currentnavnum){
	var div_id = prefix+String(id);
	if(slideshow_breadcrumb == id) {
		//this image is currently showing, do nothing 
	}else if(slideshow_breadcrumb) {
		Effect.Fade( slideshow_breadcrumb, {duration: 0.4, queue: 'front'});
		Effect.Appear( div_id,{duration: 0.7, queue:'end'});
		slideshow_breadcrumb = div_id;
		changeNavColors(selected_color, totalnavs, prefix, currentnavnum);
	}else{
		Effect.Fade( 'image1', {duration: 0.4, queue: 'front'});
		Effect.Appear( div_id, {duration: 0.7, queue:'end'});
		slideshow_breadcrumb = div_id;
		changeNavColors(selected_color, totalnavs, prefix, currentnavnum);
	}
}
