document.onmousedown = fnMouser;
document.onmousemove = fnMouserMove;
document.onmouseup = fnRelease;

var images=new Array();
var mouser='false';

var sliderPos=0;

//-- SHOW/HIDE SLIDER
window.onload = function(){

 if(document.getElementById("idContainer").clientHeight<=390){
  document.getElementById("idSlider").style.display="none";
 }else{
  document.getElementById("idSlider").style.display="block"; 
 }
}
//-- SHOW/HIDE SLIDER END

//-- Drag Bar --//

function fnDrag(posy){
 document.getElementById('content_2').blur(); 

 var browser=navigator.appName;
 if(browser=="Netscape"){
  document.getElementById('texttest').focus(); 
 }
 
 tmpOrigin=parseFloat(document.getElementById('idDotMarker').style.top);
 tmpTop=posy-280;
 tmpDif=tmpOrigin-tmpTop;

 tmpHeight=parseFloat(document.getElementById("idContainer").clientHeight);
 tmpProd=tmpHeight*tmpDif;
 tmpQuot=tmpProd/387;
 tmpScrollBy=tmpQuot; 
 
 if((tmpTop>-75)&&(tmpTop<270)){
  document.getElementById('idDotMarker').style.top=tmpTop+"px";
  document.getElementById("content_2").scrollTop=document.getElementById("content_2").scrollTop-tmpScrollBy;
 }

}

function fnDrag2(posy){
 document.getElementById('content_2').blur(); 

 var browser=navigator.appName;
 if(browser=="Netscape"){
  document.getElementById('texttest').focus(); 
 }
 
 tmpOrigin=parseFloat(document.getElementById('idDotMarker').style.top);
 tmpTop=posy-280;
 tmpDif=tmpOrigin-tmpTop;

 tmpHeight=parseFloat(document.getElementById("idContainer").clientHeight);
 tmpProd=tmpHeight*tmpDif;
 tmpQuot=tmpProd/387;
 tmpScrollBy=tmpQuot; 
 
 if((tmpDif>-75)&&(tmpDif<270)){ 
  document.getElementById('idDotMarker').style.top=tmpDif+"px";
  document.getElementById("content_2").scrollTop=document.getElementById("content_2").scrollTop-tmpScrollBy;
 }

}

//-- Drag Bar --//

function fnSlideUp(){
 sliderPos=300;
 
 document.getElementById('content_2').blur(); 

 var browser=navigator.appName;
 if(browser=="Netscape"){
  document.getElementById('texttest').focus(); 
 }
 
 tmpOrigin=parseFloat(document.getElementById('idDotMarker').style.top);
 tmpTop=20;
 tmpDif=tmpOrigin-tmpTop;

 tmpHeight=parseFloat(document.getElementById("idContainer").clientHeight);
 tmpProd=tmpHeight*tmpDif;
 tmpQuot=tmpProd/387;
 tmpScrollBy=tmpQuot; 
 
 if((tmpDif>-75)&&(tmpDif<270)){ 
  document.getElementById('idDotMarker').style.top=tmpDif+"px";
  document.getElementById("content_2").scrollTop=document.getElementById("content_2").scrollTop+tmpScrollBy;
 }  
}

//-- Drag Bar --//
function fnSlideDown(){
 document.getElementById('content_2').blur(); 

 var browser=navigator.appName;
 if(browser=="Netscape"){
  document.getElementById('texttest').focus(); 
 }
 
 tmpOrigin=parseFloat(document.getElementById('idDotMarker').style.top);
 tmpTop=-20;
 tmpDif=tmpOrigin-tmpTop;

 tmpHeight=parseFloat(document.getElementById("idContainer").clientHeight);
 tmpProd=tmpHeight*tmpDif;
 tmpQuot=tmpProd/387;
 tmpScrollBy=tmpQuot; 
 
 if((tmpDif>-75)&&(tmpDif<270)){ 
  document.getElementById('idDotMarker').style.top=tmpDif+"px";
  document.getElementById("content_2").scrollTop=document.getElementById("content_2").scrollTop+tmpScrollBy;
 } 
}

function fnRelease(){
 mouser='false';
}

//-- MOVE SPRITE TO POSITION --//
function fnMouserMove(e){

if(mouser=='true'){

	var posx = 0;
	var posy = 0;
	if (!e) var e = window.event;
	if (e.pageX || e.pageY) 	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}
	
	var targ;
	if (!e) var e = window.event;
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;
	if (targ.nodeType == 3) // defeat Safari bug
		targ = targ.parentNode;	

  fnDrag(posy);

}
 		 
}

//-- MOVE SPRITE TO POSITION --//
function fnMouser(e){

	var posx = 0;
	var posy = 0;
	if (!e) var e = window.event;
	if (e.pageX || e.pageY) 	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}
	
	var targ;
	if (!e) var e = window.event;
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;
	if (targ.nodeType == 3) // defeat Safari bug
		targ = targ.parentNode;	

 if(targ.id=="idUp"){ 
  fnSlideUp();
 } else if(targ.id=="idDown"){
  fnSlideDown(); 
 } else if(targ.id=="idDotMarker"){
  mouser='true';
  fnDrag(posy);
 } else if(targ.id=="idLine"){
  fnDrag(posy);
 }
 
 		 
}


//-- Page Links --//

function fnCallPage(selection){
 document.getElementById('idIframe1').src='bread_crumbs/bc_'+ selection;
 document.getElementById('idIframe2').src='html/'+ selection; 
}