
if(location.pathname == '/' || location.pathname == '/testing-homepage/' )
setTimeout( "action_expand1()", 1000 );


var action_current     = 0;
var action_content_len = 0;
var action_scroll      = new Array();
var action_content     = new Array();
var action_button      = {url:'', title:''};
action_scroll[0]       = {pos:1053, level:0, time:0, begin:0, change:0.0, duration:0.0, element:null, timer:null, sinechange:1, isrunning:0};

action_scroll[0].pos = ( document.getElementById('sliderMain') ? 1053 : -1169 );

function action_expand_home()
{
	if(action_scroll[0].isrunning==0){

		if(action_scroll[0].level%2 == 0){
			action_start(action_scroll[0].pos, -1169);
			action_scroll[0].pos = -1169;
		}
		else{
			action_start(action_scroll[0].pos, -58);
			action_scroll[0].pos = -58;
		}

			action_scroll[0].level++;
	}

}


function action_expand1()
{

	if(action_scroll[0].isrunning==0){

			action_start(action_scroll[0].pos, -1169);
			action_scroll[0].pos = -1169;
	}
}

function action_expand2()
{

	if(action_scroll[0].isrunning==0){

			action_start(action_scroll[0].pos, -58);
			action_scroll[0].pos = -58;
			action_scroll[0].level= 0;
	}


}





function action_close1()
{
	if(action_scroll[0].isrunning==0){
		action_start(action_scroll[0].pos, 1053);
		action_scroll[0].pos = 1053;
		
	}
}






function action_start( start, end)

{

	deleteExternalLayer('layer_signup_email');

	deleteExternalLayer('layer_signup_cell_phone');

	deleteExternalLayer('layer_friend_email_to');

	deleteExternalLayer('layer_friend_email_from');


	action_scroll[0].isrunning = 1;



	if (action_scroll[0].timer != null) {

		clearInterval(action_scroll[0].timer);

		action_scroll[0].timer = null;

	}

	action_scroll[0].time = 0;

	action_scroll[0].begin = start;

	action_scroll[0].change = end - start;

	action_scroll[0].duration = 30;

	action_scroll[0].element = document.getElementById('slider');


	action_scroll[0].change = ( start > end ? start - end : end - start );

	action_scroll[0].sinechange = ( start > end ? 1 : -1 );

	action_scroll[0].timer = setInterval("action_vert_scroll();", 15);


}



function action_vert_scroll()

{

	if (action_scroll[0].time > action_scroll[0].duration) {

		clearInterval(action_scroll[0].timer);

		action_scroll[0].timer = null;

		action_scroll[0].isrunning = 0;

	}

	else {

		width = sine_func(action_scroll[0].time, action_scroll[0].begin, action_scroll[0].change, action_scroll[0].duration, action_scroll[0].sinechange);

		width = parseInt(width);

		action_scroll[0].element.style.left = width+'px';

		action_scroll[0].time++;

	}



}



function sine_func(t, b, c, d, x)

{

	return x * c/2 * (Math.cos(Math.PI*t/d) - 1) + b;

}


function deleteExternalLayer(id) {
 if (document.getElementById && document.getElementById(id)) {
  var theNode = document.getElementById(id);
  theNode.parentNode.removeChild(theNode);
 }
 else if (document.all && document.all[id]) {
  document.all[id].innerHTML='';
  document.all[id].outerHTML='';
 }
 // OBSOLETE CODE FOR NETSCAPE 4
 else if (document.layers && document.layers[id]) {
  document.layers[id].visibility='hide';
  delete document.layers[id];
 }
}

