//////////// *** mouse responses //////////

function menu_in(val) {
	if (val==8) {window.status='start here';}
	clearTimeout(thetimer);
	var whichclip=eval('clipbank['+val+']');
	var whichlyr=eval('component['+val+']');
	clipLayer(whichlyr,whichclip,1);
}

function menu_out(val) {
	if (val==8) {window.status='';}
	clearTimeout(thetimer);
	var whichclip=eval('clipbank['+val+']');
	var whichlyr=eval('component['+val+']');
	clipLayer(whichlyr,whichclip,0);
}

function menu_click(val) {
	clearTimeout(thetimer);
	var whichclip=eval('clipbank['+val+']');
	var whichlyr=eval('component['+val+']');
	clipLayer(whichlyr,whichclip,2);
	thetimer= setTimeout("menu_out("+val+")", 1450);
}

function imgover() {menu_in(6); verify=true; 		// over an object
}
function imgout() {menu_out(6); verify=false;  		// no longer over an object
}
 
function mouseDown(e) {
	if (document.all) {RemoveDot();}
if (verify) {

	menu_out(6);  // unclip the drag handle  
	drag=true;
	x_pos=parseInt(component[6].left);
	y_pos=parseInt(component[6].top);
	scouse_x = eval(xpos);
	scouse_y = eval(ypos);
	xcoord=scouse_x-x_pos;
	ycoord=scouse_y-y_pos;
		for (var i = 1; i <(parts); i++) { // hide the controller
		component[i].visibility="hidden";}
	return false;
}
if (!verify) {return true;}	
}

function mouseMove(e) {
mouse_x = eval(xpos);
mouse_y = eval(ypos);
if (document.all){
        if (window.event.button == 1 || window.event.button == 2) {
	    if(drag) {jumpdrag();return false;} 
			else 
			{drag = false;}
	}}
else
if ((document.layers)|| (document.getElementById)) {
	drag ? jumpdrag() : drag=false;
	}}

function mouseUp(e) {
	if (drag) {show_controller();}
	drag = false;}

function jumpdrag() {

		onmouseover=0;  // fix for ie?
		component[6].top = (mouse_y-ycoord);
		component[6].left = (mouse_x-xcoord);
		component[1].top = parseInt(component[6].top);
		component[1].left =parseInt(component[6].left)-78;
		move_controller();
}

function move_controller() {

	component[0].top = parseInt(component[1].top);
	component[0].left =parseInt(component[1].left);
	component[2].left=parseInt(component[1].left)+24;
	component[2].top=parseInt(component[1].top)+54;
	component[3].left=parseInt(component[1].left)+55;
	component[3].top=parseInt(component[1].top)+54;
	component[4].left=parseInt(component[1].left)+54;
	component[4].top=parseInt(component[1].top)+24;
	component[5].left=parseInt(component[1].left)+23;
	component[5].top=parseInt(component[1].top)+23;
	component[7].left=parseInt(component[1].left);
	component[7].top=parseInt(component[1].top)+88;


	for (var i = 2; i <7; i++) {

		clipbank[i] = new Array();
		clipbank[i][0] = new clipValues(30,0,parseInt(component[i].left));
		clipbank[i][1] = new clipValues(60,30,(parseInt(component[i].left)-30));
			if (i==2||i==3) {
				clipbank[i][2] = new clipValues(90,60,(parseInt(component[i].left)-60));}
	}
}


////////// *** portfolio control *** //////////////


function move_it() {
	if (!drag) {
		if (yy>=15) {step=0.9;}
		if (yy>=10 && yy<15) {step=0.6;}
		if (yy>=7 && yy<10) {step=0.4;}
		if (yy>=6 && yy<7) {step=0.3;}
		if (yy>=5 && yy<6) {step=0.2;}
		if (yy>=3 && yy<5) {step=0.1;}
		if (yy<3) {step=0.05;}
	
		help=false;
		var the_spot=yy*22; 							// scaling factor for each step
		for (var i = (number-1); i >3; i--) {
			var the_height=yy*(((3000)/(i*i)));				// change this to affect size
			imageArray[i].height=parseInt(the_height);
			imageArray[i].width=parseInt(the_height*0.9);
			the_spot=the_spot+((yy)*(((1500)/((i*i)))));
			imgLyr[i].left=available_width-(the_spot/0.9999)+5;
			imgLyr[i].top=(available_height/1.9)-(the_spot/3.8);

			if (parseInt(imgLyr[i].left)<0-(parseInt(imgLyr[i].width)*0.2)) {imgLyr[i].visibility="hidden";}
			else{
				imgLyr[i].visibility="visible";}
			if (parseInt(imgLyr[i].left)> 0-(parseInt(imgLyr[i].width)*0.2) && parseInt(imgLyr[i].left)<200) {text_gen(i-3);}
			if (parseInt(imgLyr[i].left)>200) {text_gen(number-3);}
		}										// eo loop
	}
}
	
////// *** individual steps /////////////////
 
function go_up() {if (parseInt(imgLyr[number-1].left)>26) {yy=yy+(step); move_it();}}
function go_down() {if (yy>0.05) {yy=yy-(step); move_it();}}

////////// *** scrolling /////////////

function go_up1() {
	if (over) {go_up(); thetimer= setTimeout("go_up1()", 10);}
	else
	{clearTimeout(thetimer);}
}

function go_down1() {
	if (over) {go_down(); thetimer= setTimeout("go_down1()", 10);}
	else
	{clearTimeout(thetimer);}
}


