// JavaScript Document

//alert("Entering the javascript");


var backgroundImages = ["intro1","intro2","intro3","intro4"];

var totalnumber = backgroundImages.length;
var bnumber = Math.round(Math.random()*totalnumber);
	

var message="Please contact me if you would like to use these images.";



function click(e)
   {
   if (document.all) {
      if (event.button == 2) {
         alert(message);
         return false;
      }
   }
   if (document.layers) {
      if (e.which == 3) {
         alert(message);
         return false;
      }
   }
   
   if (document.layers) {
      document.captureEvents(Event.MOUSEDOWN);
   }
   document.onmousedown=click;
   
   
}
   
   
if(document.images){
	
		backImage = new Image;
		backImage.src = "images/intro" + bnumber + ".jpg";	
		
		//var testme = document.getElementById("homie").innerHTML;
	//	alert(testme);
		//alert(document.getElementById("fred").background);
		

		nextButton = new Image;
		nextButton.src = "images/rightarrow.jpg";
		nextButton_hi = new Image;
		nextButton_hi.src = "images/rightarrow_hi.jpg";	
		nextButton_down = new Image;
		nextButton_down.src = "images/rightarrow_down.jpg";		
		
		leftArrow = new Image;
		leftArrow.src = "images/leftarrow.jpg";
		leftArrow_hi = new Image;
		leftArrow_hi.src = "images/leftarrow_hi.jpg";	
		leftArrow_down = new Image;
		leftArrow_down.src = "images/leftarrow_down.jpg";		
		
		logocv = new Image;
		logocv.src = "images/logocv.gif";
		logocv_hi = new Image;
		logocv_hi.src = "images/logocv_hi.gif";
		
		logo_contact = new Image;
		logo_contact.src = "images/logo_contact.gif";
		logo_contact_hi = new Image;
		logo_contact_hi.src = "images/logo_contact_hi.gif";
		
		plink = new Image;
		plink.src = "bartdority/images/plink.png";
		plink_hi = new Image;
		plink_hi.src = "bartdority/images/plink_hi.png";	
		
		plink_open = new Image;
		plink_open.src = "images/plink_open.png";
		plink_open_hi = new Image;
		plink_open_hi.src = "images/plink_open_hi.png";	
				
		cvlink = new Image;
		cvlink.src = "bartdority/images/cvlink.png";
		cvlink_hi = new Image;
		cvlink_hi.src = "bartdority/images/cvlink_hi.png";	
				
		clink = new Image;
		clink.src = "bartdority/images/clink.png";
		clink_hi = new Image;
		clink_hi.src = "bartdority/images/clink_hi.png";	
		
		homebutton = new Image;
		homebutton.src = "images/homebutton.jpg";
		homebutton_hi = new Image;
		homebutton_hi.src = "images/homebutton_hi.jpg";
		
		thumb_jean = new Image;
		thumb_jean.src = "images/thumb_jean.jpg";
		thumb_jean_hi = new Image;
		thumb_jean_hi.src = "images/thumb_jean_hi.jpg";
		
		thumb_push = new Image;
		thumb_push.src = "images/thumb_push.jpg";
		thumb_push_hi = new Image;
		thumb_push_hi.src = "images/thumb_push_hi.jpg";
	
		thumb_jacques = new Image;
		thumb_jacques.src = "images/thumb_jacques.jpg";
		thumb_jacques_hi = new Image;
		thumb_jacques_hi.src = "images/thumb_jacques_hi.jpg";
		
				thumb_dave = new Image;
		thumb_dave.src = "images/thumb_dave.jpg";
		thumb_dave_hi = new Image;
		thumb_dave_hi.src = "images/thumb_dave_hi.jpg";

		
		thumb_frost = new Image;
		thumb_frost.src = "images/thumb_frost.jpg";
		thumb_frost_hi = new Image;
		thumb_frost_hi.src = "images/thumb_frost_hi.jpg";
		
		thumb_sharks = new Image;
		thumb_sharks.src = "images/thumb_sharks.jpg";
		thumb_sharks_hi = new Image;
		thumb_sharks_hi.src = "images/thumb_sharks_hi.jpg";

			thumb_rolf = new Image;
		thumb_rolf.src = "images/thumb_rolf.jpg";
		thumb_rolf_hi = new Image;
		thumb_rolf_hi.src = "images/thumb_rolf_hi.jpg";
		
		
	    thumb_animal = new Image;
		thumb_animal.src = "images/thumb_animal.jpg";
		thumb_animal_hi = new Image;
		thumb_animal_hi.src = "images/thumb_animal_hi.jpg";
		
		
	    thumb_green = new Image;
		thumb_green.src = "images/thumb_green.jpg";
		thumb_green_hi = new Image;
		thumb_green_hi.src = "images/thumb_green_hi.jpg";
		
		
	    thumb_technesis = new Image;
		thumb_technesis.src = "images/thumb_technesis.jpg";
		thumb_technesis_hi = new Image;
		thumb_technesis_hi.src = "images/thumb_technesis_hi.jpg";
		
		
	    thumb_mcq = new Image;
		thumb_mcq.src = "images/thumb_mcq.jpg";
		thumb_mcq_hi = new Image;
		thumb_mcq_hi.src = "images/thumb_mcq_hi.jpg";
		
				
	    thumb_jeep = new Image;
		thumb_jeep.src = "images/thumb_jeep.jpg";
		thumb_jeep_hi = new Image;
		thumb_jeep_hi.src = "images/thumb_jeep_hi.jpg";
					
	    thumb_akamai = new Image;
		thumb_akamai.src = "images/thumb_akamai.jpg";
		thumb_akamai_hi = new Image;
		thumb_akamai_hi.src = "images/thumb_akamai_hi.jpg";
	
			play = new Image;
		play.src = "images/play.png";
		play_hi = new Image;
		play_hi.src = "images/play_hi.png";
		play_down = new Image;
		play_down.src = "images/play_down.png";
		
			play2 = new Image;
		play2.src = "images/play.png";
		play2_hi = new Image;
		play2_hi.src = "images/play_hi.png";
		play2_down = new Image;
		play2_down.src = "images/play_down.png";
	
		view = new Image;
		view.src = "images/view.png";
		view_hi = new Image;
		view_hi.src = "images/view_hi.png";
		view_down = new Image;
		view_down.src = "images/view_down.png";
		
		view2 = new Image;
		view2.src = "images/view.png";
		view2_hi = new Image;
		view2_hi.src = "images/view_hi.png";
		view2_down = new Image;
		view2_down.src = "images/view_down.png";
		
		view3 = new Image;
		view3.src = "images/view.png";
		view3_hi = new Image;
		view3_hi.src = "images/view_hi.png";
		view3_down = new Image;
		view3_down.src = "images/view_down.png";
		
		view4 = new Image;
		view4.src = "images/view.png";
		view4_hi = new Image;
		view4_hi.src = "images/view_hi.png";
		view4_down = new Image;
		view4_down.src = "images/view_down.png";
		
		view5 = new Image;
		view5.src = "images/view.png";
		view5_hi = new Image;
		view5_hi.src = "images/view_hi.png";
		view5_down = new Image;
		view5_down.src = "images/view_down.png";
		
		viewpiece = new Image;
		viewpiece.src = "images/viewpiece.png";
		viewpiece_hi = new Image;
		viewpiece_hi.src = "images/viewpiece_hi.png";
		viewpiece_down = new Image;
		viewpiece_down.src = "images/viewpiece_down.png";
		
		viewpiece2 = new Image;
		viewpiece2.src = "images/viewpiece.png";
		viewpiece2_hi = new Image;
		viewpiece2_hi.src = "images/viewpiece_hi.png";
		viewpiece2_down = new Image;
		viewpiece2_down.src = "images/viewpiece_down.png";
		
		viewpiece3 = new Image;
		viewpiece3.src = "images/viewpiece.png";
		viewpiece3_hi = new Image;
		viewpiece3_hi.src = "images/viewpiece_hi.png";
		viewpiece3_down = new Image;
		viewpiece3_down.src = "images/viewpiece_down.png";
		
		
		viewpiece4 = new Image;
		viewpiece4.src = "images/viewpiece.png";
		viewpiece4_hi = new Image;
		viewpiece4_hi.src = "images/viewpiece_hi.png";
		viewpiece4_down = new Image;
		viewpiece4_down.src = "images/viewpiece_down.png";
		
		viewpiece5 = new Image;
		viewpiece5.src = "images/viewpiece.png";
		viewpiece5_hi = new Image;
		viewpiece5_hi.src = "images/viewpiece_hi.png";
		viewpiece5_down = new Image;
		viewpiece5_down.src = "images/viewpiece_down.png";
}



function swapImage(oldButton,newButton){
        if (document.images){
                document.images[oldButton].src=eval(newButton + ".src");
        }
}

function flip() {
	if (document.images) {
		var num_arg = arguments.length;
		if (num_arg == 0 || (num_arg % 2) != 0) return;
		for (var i=0; i<num_arg; i) {
			var j = i+1;
			var imgname = arguments[i];
			var imgsrc = arguments[j];
			document.images[imgname].src = eval(imgsrc+'.src');
			i+=2;
		}
	}
}

var clients = ["Artist:  Jerry Frost", "KQED Public Television - Sharks at Risk","KQED Public Television - Ocean Adventures", "Manuel Aragon", "KQED Public Television - Jacque Pepin's:  'Fast Food My Way'", "Big Muscle Trainer.com","Website Animal",
					   "PushMX",
					   "Green + Root",
					   "Technesis",
					   "McQuerter Group",
					   "Jeep",
					   "Akamai" ];
var projects = ["Website with smart catalog, business card, and promotional CD","Oline interactive educational game","Banner ads and teasers announcing Jean Michel Cousteau's new PBS Telvision series","Logo, business cards, website, and brochure","Flash based studio tour", "Promotional materials for a personal trainer, Dave Kendrick", "Flash driven website with embedded video",
						"Website with dynamic flash intro",
						"Logo Design, CD album cover design, and various promotional materials",
						"Logo design, website design, Interface design, and icon design", 
						"Website with 3D interactive flash driven online game",
						"Award winning Flash Interactive piece", 
						"Logo, Website and Flash-based splash screen"];

var noteableClients = ["Website Animal",
					   "PushMX",
					   "Green + Root",
					   "Technesis",
					   "McQuerter Group",
					   "Jeep",
					   "Akamai"];
var noteableProjects = ["Flash driven website with embedded video",
						"Website with dynamic flash intro",
						"Logo Design, CD album cover design, and various promotional materials",
						"Logo design, website design, Interface design, and icon design", 
						"Website with 3D interactive flash driven online game",
						"Award winning Flash Interactive piece", 
						"Logo, Website and Flash-based splash screen"];

function displayNames(projectNumber) {
document.getElementById("clientName").innerHTML = clients[projectNumber];
document.getElementById("projectName").innerHTML = projects[projectNumber];
}

function clearNames() {
	document.getElementById("clientName").innerHTML = "These projects include multiple components";
document.getElementById("projectName").innerHTML = "&nbsp;\n";
}

function displayNoteableNames(projectNumber) {
document.getElementById("noteableClientName").innerHTML = noteableClients[projectNumber];
document.getElementById("noteableProjectName").innerHTML = noteableProjects[projectNumber];
}

function clearNoteableNames() {
	document.getElementById("noteableClientName").innerHTML = "These projects include multiple components";
document.getElementById("noteableProjectName").innerHTML = "&nbsp;\n";
}


// popupwin
function popIt(url,w,h,r){
var mydate = new Date();
wname=''+mydate.getMonth()+mydate.getDate()+mydate.getHours()+mydate.getMinutes()+mydate.getSeconds();
	if (w && h && r) {
		popwin =  window.open(url,"popwin"+wname,"height="+h+",width="+w+",status=no,scrollbars=1,location=0,menubar=no,toolbar=no,directories=no,resizable=yes,left=200,top=200"); 
	}
	else {
	popwin = window.open(url,"popwin"+wname,"height="+h+",width="+w+",status=0,scrollbars=0,location=0,left=200,top=200");
	}
}


