// JavaScript Document

$(document).ready(function(){						   
   	$("#nav1").hover(
	 function(){$(this).attr("src", "images/home_over.gif");},
	 function(){$(this).attr("src", "images/home.gif");}
	 );  

   	$("#nav2").hover(
	 function(){$(this).attr("src", "images/portfolio_over.gif");},
	 function(){$(this).attr("src", "images/portfolio.gif");}
	 );  

   	$("#nav3").hover(
	 function(){$(this).attr("src", "images/about_over.gif");},
	 function(){$(this).attr("src", "images/about.gif");}
	 );  

   	$("#nav4").hover(
	 function(){$(this).attr("src", "images/news_over.gif");},
	 function(){$(this).attr("src", "images/news.gif");}
	 );  

   	$("#nav5").hover(
	 function(){$(this).attr("src", "images/contact_over.gif");},
	 function(){$(this).attr("src", "images/contact.gif");}
	 ); 
	
	 $("#nnav1").hover(
	 function(){$(this).attr("src", "../images/home_over.gif");},
	 function(){$(this).attr("src", "../images/home.gif");}
	 );  

   	$("#nnav2").hover(
	 function(){$(this).attr("src", "../images/portfolio_over.gif");},
	 function(){$(this).attr("src", "../images/portfolio.gif");}
	 );  

   	$("#nnav3").hover(
	 function(){$(this).attr("src", "../images/about_over.gif");},
	 function(){$(this).attr("src", "../images/about.gif");}
	 );  

   	$("#nnav4").hover(
	 function(){$(this).attr("src", "../images/news_over.gif");},
	 function(){$(this).attr("src", "../images/news.gif");}
	 );  

   	$("#nnav5").hover(
	 function(){$(this).attr("src", "../images/contact_over.gif");},
	 function(){$(this).attr("src", "../images/contact.gif");}
	 ); 

	
   	$("#ad_img").hover(
	 function(){$(this).attr("src", "images/about/ad_over.jpg");},
	 function(){$(this).attr("src", "images/about/ad.jpg");}
	 ); 
	
   	$("#cy_img").hover(
	 function(){$(this).attr("src", "images/about/cy_over.jpg");},
	 function(){$(this).attr("src", "images/about/cy.jpg");}
	 ); 
	
   	$("#brs_img").hover(
	 function(){$(this).attr("src", "images/about/brs_over.jpg");},
	 function(){$(this).attr("src", "images/about/brs.jpg");}
	 ); 
	
   	$("#dr_img").hover(
	 function(){$(this).attr("src", "images/about/dr_over.jpg");},
	 function(){$(this).attr("src", "images/about/dr.jpg");}
	 ); 
	
   	$("#tk_img").hover(
	 function(){$(this).attr("src", "images/about/tk_over.jpg");},
	 function(){$(this).attr("src", "images/about/tk.jpg");}
	 ); 
	
   	$("#tt_img").hover(
	 function(){$(this).attr("src", "images/about/tt_over.jpg");},
	 function(){$(this).attr("src", "images/about/tt.jpg");}
	 ); 
	
   $("#history").mouseover(function () {
	$(this).attr("src", "images/about/history_select.gif");
	});

   $("#philosophy").mouseover(function () {
	$(this).attr("src", "images/about/philosophy_select.gif");
	});

   $("#approach").mouseover(function () {
	$(this).attr("src", "images/about/approach_select.gif");
	});

   $("#services").mouseover(function () {
	$(this).attr("src", "images/about/services_select.gif");
	});

   $("#experience").mouseover(function () {
	$(this).attr("src", "images/about/experience_select.gif");
	});
	
	$("#history").click(function(event){
	$("#philosophy_copy").hide();
	$("#approach_copy").hide();
	$("#services_copy").hide();
	$("#experience_copy").hide();
	$("#history_copy").fadeIn(600);
	 });

	$("#philosophy").click(function(event){
	$("#history_copy").hide();
	$("#approach_copy").hide();
	$("#services_copy").hide();
	$("#experience_copy").hide();
	$("#philosophy_copy").fadeIn(600);
	 });
	
	$("#approach").click(function(event){
	$("#history_copy").hide();
	$("#philosophy_copy").hide();
	$("#services_copy").hide();
	$("#experience_copy").hide();
	$("#approach_copy").fadeIn(600);
	 });
	
	$("#services").click(function(event){
	$("#history_copy").hide();
	$("#approach_copy").hide();
	$("#philosophy_copy").hide();
	$("#experience_copy").hide();
	$("#services_copy").fadeIn(600);
	 });
	
	$("#experience").click(function(event){
	$("#history_copy").hide();
	$("#approach_copy").hide();
	$("#services_copy").hide();
	$("#philosophy_copy").hide();
	$("#experience_copy").fadeIn(600);
	 });
	
	
	
$('.slide').hover(function() { //mouse in  
	   $(this).children('.slide_img').stop().animate({ marginRight: '10px'}, 300);  
   }, function() { //mouse out  
		$(this).children('.slide_img').stop().animate({ marginRight: '0px'}, 300);  
	}); 

 $("#login").click(function(){
      $("#form_container").animate({"top": "+=140px"}, "slow");
    });
 
 $("#hide_form").click(function(){
      $("#form_container").animate({"top": "-=140px"}, "slow");
    });
	
});

var about_select='history';
function click_about(aboutid) {
	document.getElementById('history').src='images/about/history.gif';
	document.getElementById('philosophy').src='images/about/philosophy.gif';
	document.getElementById('approach').src='images/about/approach.gif';
	document.getElementById('services').src='images/about/services.gif';
	document.getElementById('experience').src='images/about/experience.gif';
	about_select=aboutid;
	if (aboutid == 'history'){
	document.getElementById('history').src='images/about/history_select.gif';
	}
	if (aboutid == 'philosophy'){
	document.getElementById('philosophy').src='images/about/philosophy_select.gif';	
	}
	if (aboutid == 'approach'){
	document.getElementById('approach').src='images/about/approach_select.gif';	
	}
	if (aboutid == 'services'){
	document.getElementById('services').src='images/about/services_select.gif';	
	}
	if (aboutid == 'experience'){
	document.getElementById('experience').src='images/about/experience_select.gif';	
	}
}

function about_restore(aboutover) {
	if (aboutover == about_select) {
	document.getElementById(aboutover).src='images/about/' + aboutover + '_select.gif';
	}else{
	document.getElementById(aboutover).src='images/about/' + aboutover + '.gif';
	}
}


var acc_select='';
//var acc_old='';

function setImage(job, accrID) {
	acc_old = accrID;
	if(accrID.length == 6){
		var dir = accrID.substring(0, 3);
		var dirID = accrID.substring(3, 6);
	}
	if(accrID.length == 7){
		var dir = accrID.substring(0, 4);
		var dirID = accrID.substring(4, 7);
	}
	if(acc_old != dir + '-01'){
		document.getElementById('01').src='images/portfolio/' + job + '/' +  dir + '/' + dir + '-01-BW.jpg';
	}
	if(acc_old != dir + '-02'){
		document.getElementById('02').src='images/portfolio/' + job + '/' +  dir + '/' + dir + '-02-BW.jpg';
	}
	if(acc_old != dir + '-03'){
		document.getElementById('03').src='images/portfolio/' + job + '/' +  dir + '/' + dir + '-03-BW.jpg';
	}
	if(acc_old != dir + '-04'){
		document.getElementById('04').src='images/portfolio/' + job + '/' +  dir + '/' + dir + '-04-BW.jpg';
	}
}

function setImageTwo(job, acceID) {
	acc_select = acceID;
}

function roll_tab(job, accID) {
	acc_select = accID;
	if(accID.length == 6){
		var dir = accID.substring(0, 3);
		var dirID = accID.substring(3, 6);
	}
	if(accID.length == 7){
		var dir = accID.substring(0, 4);
		var dirID = accID.substring(4, 7);
	}
	
	if(acc_old != dir + '-01'){
		document.getElementById('01').src='images/portfolio/' + job + '/' +  dir + '/' + dir + '-01-BW.jpg';
	}
	if(acc_old != dir + '-02'){
		document.getElementById('02').src='images/portfolio/' + job + '/' +  dir + '/' + dir + '-02-BW.jpg';
	}
	if(acc_old != dir + '-03'){
		document.getElementById('03').src='images/portfolio/' + job + '/' +  dir + '/' + dir + '-03-BW.jpg';
	}
	if(acc_old != dir + '-04'){
		document.getElementById('04').src='images/portfolio/' + job + '/' +  dir + '/' + dir + '-04-BW.jpg';
	}
	
	if (accID == dir + '-01'){
	document.getElementById('01').src='images/portfolio/' + job + '/' +  dir + '/' + accID + '-C.jpg';
	}
	if (accID == dir + '-02'){
	document.getElementById('02').src='images/portfolio/' + job + '/' +  dir + '/' + accID + '-C.jpg';
	}
	if (accID == dir + '-03'){
	document.getElementById('03').src='images/portfolio/' + job + '/' +  dir + '/' + accID + '-C.jpg';
	}
	if (accID == dir + '-04'){
	document.getElementById('04').src='images/portfolio/' + job + '/' +  dir + '/' + accID + '-C.jpg';
	}
}


function tab_restore(job, accrID) {	
	if(accrID.length == 6){
		var dir = accrID.substring(0, 3);
		var dirID = accrID.substring(3, 6);
	}
	if(accrID.length == 7){
		var dir = accrID.substring(0, 4);
		var dirID = accrID.substring(4, 7);
	}
	if(acc_old != dir + '-01'){
		document.getElementById('01').src='images/portfolio/' + job + '/' +  dir + '/' + dir + '-01-BW.jpg';
	}
	if(acc_old != dir + '-02'){
		document.getElementById('02').src='images/portfolio/' + job + '/' +  dir + '/' + dir + '-02-BW.jpg';
	}
	if(acc_old != dir + '-03'){
		document.getElementById('03').src='images/portfolio/' + job + '/' +  dir + '/' + dir + '-03-BW.jpg';
	}
	if(acc_old != dir + '-04'){
		document.getElementById('04').src='images/portfolio/' + job + '/' +  dir + '/' + dir + '-04-BW.jpg';
	}
}

var thumb_select='';
function roll_thumb(thumbID, cat, catF) {
	//alert(thumbID);
	if (thumbID == 't1' && document.getElementById('t1') != null){
	document.getElementById('t1').src='images/portfolio/' + cat + '/' + catF + '01-T-BW.jpg';
	}
	if (thumbID == 't2' && document.getElementById('t2') != null){
	document.getElementById('t2').src='images/portfolio/' + cat + '/' + catF + '02-T-BW.jpg';
	}
	if (thumbID == 't3' && document.getElementById('t3') != null){
	document.getElementById('t3').src='images/portfolio/' + cat + '/' + catF + '03-T-BW.jpg';
	}
	if (thumbID == 't4' && document.getElementById('t4') != null){
	document.getElementById('t4').src='images/portfolio/' + cat + '/' + catF + '04-T-BWjpg';
	}
	if (thumbID == 't5' && document.getElementById('t5') != null){
	document.getElementById('t5').src='images/portfolio/' + cat + '/' + catF + '05-T-BW.jpg';
	}
	if (thumbID == 't6' && document.getElementById('t6') != null){
	document.getElementById('t6').src='images/portfolio/' + cat + '/' + catF + '06-T-BW.jpg';
	}
	if (thumbID == 't7' && document.getElementById('t7') != null){
	document.getElementById('t7').src='images/portfolio/' + cat + '/' + catF + '07-T-BW.jpg';
	}
	if (thumbID == 't8' && document.getElementById('t8') != null){
	document.getElementById('t8').src='images/portfolio/' + cat + '/' + catF + '08-T-BW.jpg';
	}
	if (thumbID == 't9' && document.getElementById('t9') != null){
	document.getElementById('t9').src='images/portfolio/' + cat + '/' + catF + '09-T-BW.jpg';
	}
	if (thumbID == 't10' && document.getElementById('t10') != null){
	document.getElementById('t10').src='images/portfolio/' + cat + '/' + catF + '10-T-BW.jpg';
	}
	if (thumbID == 't11' && document.getElementById('t11') != null){
	document.getElementById('t11').src='images/portfolio/' + cat + '/' + catF + '11-T-BW.jpg';
	}
	if (thumbID == 't12' && document.getElementById('t12') != null){
	document.getElementById('t12').src='images/portfolio/' + cat + '/' + catF + '12-T-BW.jpg';
	}
	if (thumbID == 't13' && document.getElementById('t13') != null){
	document.getElementById('t13').src='images/portfolio/' + cat + '/' + catF + '13-T-BW.jpg';
	}
	if (thumbID == 't14' && document.getElementById('t14') != null){
	document.getElementById('t14').src='images/portfolio/' + cat + '/' + catF + '14-T-BW.jpg';
	}
	if (thumbID == 't15' && document.getElementById('t15') != null){
	document.getElementById('t15').src='images/portfolio/' + cat + '/' + catF + '15-T-BW.jpg';
	}
	if (thumbID == 't16' && document.getElementById('t16') != null){
	document.getElementById('t16').src='images/portfolio/' + cat + '/' + catF + '16-T-BW.jpg';
	}
	thumb_select = thumbID;
	//alert(thumbID);
	if (thumbID == 't1' && document.getElementById('t1') != null){
	document.getElementById('t1').src='images/portfolio/' + cat + '/' + catF + '01-T-C.jpg';
	}
	if (thumbID == 't2' && document.getElementById('t2') != null){
	document.getElementById('t2').src='images/portfolio/' + cat + '/' + catF + '02-T-C.jpg';
	}
	if (thumbID == 't3' && document.getElementById('t3') != null){
	document.getElementById('t3').src='images/portfolio/' + cat + '/' + catF + '03-T-C.jpg';
	}
	if (thumbID == 't4' && document.getElementById('t4') != null){
	document.getElementById('t4').src='images/portfolio/' + cat + '/' + catF + '04-T-C.jpg';
	}
	if (thumbID == 't5' && document.getElementById('t5') != null){
	document.getElementById('t5').src='images/portfolio/' + cat + '/' + catF + '05-T-C.jpg';
	}
	if (thumbID == 't6' && document.getElementById('t6') != null){
	document.getElementById('t6').src='images/portfolio/' + cat + '/' + catF + '06-T-C.jpg';
	}
	if (thumbID == 't7' && document.getElementById('t7') != null){
	document.getElementById('t7').src='images/portfolio/' + cat + '/' + catF + '07-T-C.jpg';
	}
	if (thumbID == 't8' && document.getElementById('t8') != null){
	document.getElementById('t8').src='images/portfolio/' + cat + '/' + catF + '08-T-C.jpg';
	}
	if (thumbID == 't9' && document.getElementById('t9') != null){
	document.getElementById('t9').src='images/portfolio/' + cat + '/' + catF + '09-T-C.jpg';
	}
	if (thumbID == 't10' && document.getElementById('t10') != null){
	document.getElementById('t10').src='images/portfolio/' + cat + '/' + catF + '10-T-C.jpg';
	}
	if (thumbID == 't11' && document.getElementById('t11') != null){
	document.getElementById('t11').src='images/portfolio/' + cat + '/' + catF + '11-T-C.jpg';
	}
	if (thumbID == 't12' && document.getElementById('t12') != null){
	document.getElementById('t12').src='images/portfolio/' + cat + '/' + catF + '12-T-C.jpg';
	}
	if (thumbID == 't13' && document.getElementById('t13') != null){
	document.getElementById('t13').src='images/portfolio/' + cat + '/' + catF + '13-T-C.jpg';
	}
	if (thumbID == 't14' && document.getElementById('t14') != null){
	document.getElementById('t14').src='images/portfolio/' + cat + '/' + catF + '14-T-C.jpg';
	}
	if (thumbID == 't15' && document.getElementById('t15') != null){
	document.getElementById('t15').src='images/portfolio/' + cat + '/' + catF + '15-T-C.jpg';
	}
	if (thumbID == 't16' && document.getElementById('t16') != null){
	document.getElementById('t16').src='images/portfolio/' + cat + '/' + catF + '16-T-C.jpg';
	}
	
	
}

function restore_thumb(thumb_over, f, thumbF) {
	if (thumb_over == thumb_select) {
	document.getElementById(thumb_over).src='images/portfolio/' + f + '/' + thumbF + '-T-BW.jpg';
	//$(li).css('thumb1');
	}else{
	document.getElementById(thumb_over).src='images/portfolio/' + f + '/' + thumbF + '-T-C.jpg';
	}
}
 
