

/****************************************************************************************************************************
******************                                                                                         ******************
******************               INITIALIZE VARIABLES                                                      ******************
******************                                                                                         ******************
****************************************************************************************************************************/

var songPlaying = 0;
stuck = " " ;
i = 1;
timerID = null;
var hasDivs = 0;


/****************************************************************************************************************************
******************                                                                                         ******************
******************               STANDARD JavaScript FUNCTIONS                                             ******************
******************                                                                                         ******************
****************************************************************************************************************************/


function openWindow(url) {
	joshuaweinbergpopup = window.open( url ,'joshuaweinbergcom','toolbars=0,scrollbars=0,location=0,statusbars=0,menubars=0,resizable=1,width=560,height=450');
}


function openWindow2(url) {
	joshuaweinbergpopup = window.open( url ,'joshuaweinbergcomUpload','toolbars=0,scrollbars=0,location=0,statusbars=0,menubars=0,resizable=0,width=370,height=230');
}


function openWindow3(url) {
	joshuaweinbergpopup = window.open( url ,'joshuaweinbergcom','toolbars=0,scrollbars=0,location=0,statusbars=0,menubars=0,resizable=1,width=320,height=260');
}


function openWindow4(url) {
	joshuaweinbergpopup = window.open( url ,'joshuaweinbergcomEmail','toolbars=0,scrollbars=0,location=0,statusbars=0,menubars=0,resizable=0,width=485,height=320');
}

function openMusicwin(url) {
	musicpopup = window.open( url ,'joshuaWeinbergMuzak','toolbars=0,scrollbars=0,location=0,statusbars=0,menubars=0,resizable=0,width=100,height=90');
	setTimeout('self.focus()', 800);
}


function on(imgName){
	if (document.images) {
 		document[imgName].src = eval(imgName + "_on.src") ;
	}
}

function off(imgName){	
	if (document.images) {
 		document[imgName].src = eval(imgName + ".src") ;
 	}
 }	
 
 
/****************************************************************************************************************************
******************                                                                                         ******************
******************               SPECIAL JavaScript FUNCTIONS                                              ******************
******************                                                                                         ******************
****************************************************************************************************************************/

function on2(imgName1,imgName2){
    if (document.images) {
    	if (imgName1 == stuck){
			document.whiteline.src = line_off.src ;
	    	document.line.src = line_off.src ;
		}
		if (!(imgName1 == stuck)){
			document[imgName1].src = eval(imgName1 + "_on.src");
			document.whiteline.src = eval(imgName2 + "_on.src");
    		document.line.src = whiteline0_on.src ;
		}	
	}
}

function off2(imgName1,imgName2){
    if (document.images) {
	 	document[imgName1].src = eval(imgName1 + "_off.src");
	    document.whiteline.src = line_off.src ;
	    document.line.src = line_off.src ;
	}
}

function alloff(){
	document.dot4.src = dot_off.src ;
	document.dot3.src = dot_off.src ;
	document.dot2.src = dot_off.src ;
	document.dot1.src = dot_off.src ;
	document.dragmules.src = dragmules_off.src ;
	document.daylights.src = daylights_off.src ;
	document.jackass.src = jackass_off.src ;
	document.projects.src = projects_off.src ;
}

function stick(imgName1,imgName2){
	stuck=imgName2;
	alloff();
 	document[imgName1].src = dot_on.src ;
    document[imgName2].src = eval(imgName2 + "_off.src");
    document.whiteline.src = line_off.src ;
    document.line.src = line_off.src ;

}	

 
function fullCycle(){
	clearTimeout(timerID);
	if((i >= 11)||(i == 0)){i = 1;}
	document.pic.src = eval("pic" + i + ".src");
	timerID=setTimeout('fullCycle()',4000) ;
	i++;
}

function slideFF(){
	if((i >= 11)||(i == 0)){i = 1;}
	document.pic.src = eval("pic" + i +".src");
	timerID=setTimeout('slideFF()',100) ;
	i++;
}

function slideRewind(){
	if((i <= 0)||(i == 11)){i = 10};
	document.pic.src = eval("pic" + i +".src");
	timerID=setTimeout('slideRewind()',100) ;
	i--;
}


function nav_on(imgName){
	if (document.images) {
		 document.subnav_head.src = eval("subnav_" + imgName + ".src") ;
	 	 document.description.src = eval("desc_" + imgName + ".src") ;
	}
}


function nav_off(imgName){
	if (document.images) {
		 document.subnav_head.src = subnav_head.src ;
	 	 document.description.src = desc_welcome.src ;
	}
}


function initDivs(){
	
	// this appears to be disabled.
	return;
	
	if(hasDivs){
	
		if( ( (navigator.appVersion.indexOf("Mac") > 0) && (navigator.appName.substring(0,9) == "Microsoft") )  || (document.all) ) {
			//IE on PC or Mac (i hope)
			
			document.getElementById("topNavDiv").style.visibility = "visible";
			document.getElementById("footNavDiv").style.visibility = "visible" ;
			
			document.getElementById("topNavDiv").style.top = (0) ;
			document.getElementById("topNavDiv").style.left = (document.body.clientWidth-190) ;
			
			document.getElementById("footNavDiv").style.left = (0) ;
			document.getElementById("footNavDiv").style.top = (document.body.clientHeight=18) ;
			alert("here i am");
	
		} else if(document.layers){
			// netscape 4
			document.layers['topNavDiv'].visibility = "show" ;
			document.layers['footNavDiv'].visibility = "show" ;
			
			document.layers['topNavDiv'].top = (0);
			document.layers['topNavDiv'].left = (window.innerWidth-190);
			
			document.layers['footNavDiv'].left = (0);
			document.layers['footNavDiv'].top = (window.innerHeight-18);
	
		} else if(document.getElementById) {		
			//netscape 6 (ihope)
			document.getElementById("topNavDiv").style.visibility = "visible" ;
			document.getElementById("footNavDiv").style.visibility = "visible" ;

			document.getElementById("topNavDiv").style.top = (0) ;
			document.getElementById("topNavDiv").style.left = (document.body.clientWidth-190) ;

			document.getElementById("footNavDiv").style.left = (0) ;
			document.getElementById("footNavDiv").style.top = (document.body.clientHeight=18) ;
		} else {
			document.getElementById("topNavDiv").style.visiblity = "visible" ;
			document.getElementById("footNavDiv").style.visiblity = "visible" ;

			document.getElementById("topNavDiv").style.top = (0) ;
			document.getElementById("topNavDiv").style.left = (document.body.clientWidth-190) ;

			document.getElementById("footNavDiv").style.left = (0) ;
			document.getElementById("footNavDiv").style.top = (document.body.clientHeight=18) ;
		}
	}else{
		return;	
	}
}



