// JavaScript Document
 //language switcher start
 $(document).ready(function() { 
 $('#practice .cymraegMenu').click(function(){
  window.location.href = 'ycwmni.php';
  return false;
}); 
$('#practice .englishMenu').click(function(){
  window.location = 'thepractice.php';
   return false;
}); 
 $('#people .cymraegMenu').click(function(){
  window.location.href = 'pobl.php';
  return false;
}); 
$('#people .englishMenu').click(function(){
  window.location = 'people.php';
   return false;
}); 
$('#projects .cymraegMenu').click(function(){
  window.location.href = 'prosiectau.php';
  return false;
}); 
$('#projects .englishMenu').click(function(){
  window.location.href = 'projects.php';
   return false;
}); 
$('#current .cymraegMenu').click(function(){
  window.location.href = 'dogfennau.php';
  return false;
}); 
$('#current .englishMenu').click(function(){
  window.location.href = 'documents.php';
   return false;
}); 
$('#wework .cymraegMenu').click(function(){
  window.location.href = 'sutmaercwmningweithio.php';
  return false;
}); 
$('#wework .englishMenu').click(function(){
  window.location.href = 'howwework.php';
   return false;
}); 

$('#contact .cymraegMenu').click(function(){
  window.location.href = 'cyswllt.php';
  return false;
}); 
$('#contact .englishMenu').click(function(){
  window.location.href = 'contact.php';
   return false;
}); 


});
 // fly out info on homepage footer		


 $(document).ready(function() {
							
							
			$('#grant').mouseover(function() {
		
				$('#wTip').html('This project is part financed by Gwynedd Council and the Welsh Assembly Government through the Local Investment Fund and the European Union – European Regional Development Fund.<br /><br /> <p>Mae’r prosiect hwn wedi ei rhan ariannu gan Gyngor Gwynedd a Llywodraeth Cynulliad Cymru drwy’r Gronfa Ddatblygu Lleol a chan yr Undeb Ewropeaidd – E.R.D.F.</p>');
				$('#wTip').addClass('background');
				});
			
			$('#grant').mouseout(function() {
				$('#wTip').empty();
				$('#wTip').removeClass('background');
					 });
				});
  $(document).ready(function() {
			$('#council').mouseover(function() {
				$('#wTip').html('This project is part financed by Gwynedd Council and the Welsh Assembly Government through the Local Investment Fund and the European Union – European Regional Development Fund. <br /><br /><p>Mae’r prosiect hwn wedi ei rhan ariannu gan Gyngor Gwynedd a Llywodraeth Cynulliad Cymru drwy’r Gronfa Ddatblygu Lleol a chan yr Undeb Ewropeaidd – E.R.D.F.</p>');
				$('#wTip').addClass('background');
				});
			
			$('#council').mouseout(function() {
				$('#wTip').empty();
				$('#wTip').removeClass('background');
					 });
				});
  
//open in new windo

$(document).ready(function() {
    $('a[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
});


// people update
 $(document).ready(function() {
	
	$('#thirdMenu a').click(function () {
		$('#thirdMenu .peopleMenu').removeClass('peopleMenu');
		$(this).addClass('peopleMenu');
		
		$.get('peopleUpdate.php', {'send_person': $(this).attr("id")}, function(data) {
			$('#ajaxPeople').html(data);
			
			});
			return false;
			});
			});
 
//welsh version
  $(document).ready(function() {
	
	$('.pobl #thirdMenu a').click(function () {
		$('#thirdMenu .peopleMenu').removeClass('peopleMenu');
		$(this).addClass('peopleMenu');
		
		$.get('w_peopleUpdate.php', {'send_person': $(this).attr("id")}, function(data) {
			$('#ajaxPeople').html(data);
			
			});
			return false;
			});
			});
	 
 //how we work pull and replace 
 $(document).ready(function() {
						
	$('.ajaxCategory a').click(function () {
		$('.ajaxCategory .grey').removeClass('grey');
		$(this).addClass('grey');
		
		$.get('workinfo.php', {'hww_id': $(this).attr("id")}, function(data) {
			$('#ajaxWork').html(data);
			
			});
			return false;
			});
			});
 
 
  //how we work pull and replace  in welsh
 $(document).ready(function() {
						
	$('.ajaxCategory a').click(function () {
		$('.ajaxCategory .grey').removeClass('grey');
		$(this).addClass('grey');
		
		$.get('w_workinfo.php', {'hww_id': $(this).attr("id")}, function(data) {
			$('#w_ajaxWork').html(data);
			
			});
			return false;
			});
			});


						
			
$(document).ready(function() {
						
	$('.projects .projectList a').click(function () {
		$('.projectList .green').removeClass('green');
		$(this).addClass('green');
	var project = $(this).attr("id");

		$.get('projectGroups.php', {'project_id': project}, function(data) {
			$('#ajaxWork').html(data);
			$('#projects').removeClass('projectsAlone');
			
			
			return false;
										});
			$.get('projectGroups.php', {'project_detail': project}, function(data) {
			$('#headings').html(data);});
																				
			return false;
			
			
										});
																		
				
			});
// repeat for back button

$(document).ready(function() {
						
	$('a.projectBack').livequery('click', function(event) {
		
	var project = $(this).attr("id");

		$.get('projectGroups.php', {'project_id': project}, function(data) {
			$('#ajaxWork').html(data);
			$('#projects').removeClass('projectsAlone');
			
			
			return false;
										});
			$.get('projectGroups.php', {'project_detail': project}, function(data) {
			$('#headings').html(data);});
																				
			return false;
			
			
										});
																		
				
			});
// now in welsh
$(document).ready(function() {
						
	$('a.prosiectauBack').livequery('click', function(event) {
		
	var project = $(this).attr("id");

		$.get('w_projectGroups.php', {'project_id': project}, function(data) {
			$('#ajaxWork').html(data);
			$('#projects').removeClass('projectsAlone');
			
			
			return false;
										});
			$.get('w_projectGroups.php', {'project_detail': project}, function(data) {
			$('#headings').html(data);});
																				
			return false;
			
			
										});
																		
				
			});



// welsh version of project categories
			
$(document).ready(function() {
						
	$('.prosiectau .projectList a').click(function () {
		$('.projectList .green').removeClass('green');
		$(this).addClass('green');
	var project = $(this).attr("id");

		$.get('w_projectGroups.php', {'project_id': project}, function(data) {
			$('#ajaxWork').html(data);
			$('#projects').removeClass('projectsAlone');																		
			
			return false;
										});
			$.get('w_projectGroups.php', {'project_detail': project}, function(data) {
			$('#headings').html(data);});
																				
			return false;
			
										});
																		
				
			});



//starting for project gallery get
$(document).ready(function() {
						
	$('.projects #beforeLinkInfo a').livequery('click', function(event) {
		
	var project2 = $(this).attr("name");
	//$.get('projectImageOnly.php', {'info_id': project2}, function(data) {
																 
			//$('#leftBodyInner').css('background-image', 'url(' + data +')no-repeat');});
																				
		
		
		$.get('projectGroupsInfo.php', {'info_id': project2}, function(data) {
																		 
			$('#ajaxWork').html();
			$('#practiceAjax').html(data);
			
	
						
		addGalleria();
				 			
		});  
			
			return false;
		});
	  
	
			
		function addGalleria() {
			
			$('.clickGallery a').livequery('mouseover', function() {	
				var imageGal = $(this).attr("href");
				
				$('#leftBodyInner').css('background-image', 'url(' + imageGal + ')');
				return false;
				})
	
	}
	
	
		});

// now in welsh
$(document).ready(function() {
						
	$('.prosiectau #beforeLinkInfo a').livequery('click', function(event) {
		
	var project2 = $(this).attr("name");
	//$.get('projectImageOnly.php', {'info_id': project2}, function(data) {
																 
			//$('#leftBodyInner').css('background-image', 'url(' + data +')no-repeat');});
		
		$.get('w_projectGroupsInfo.php', {'info_id': project2}, function(data) {
																		 
			$('#ajaxWork').html();
			$('#practiceAjax').html(data);
			
	
						
		addGalleria();
				 			
		});  
			
			return false;
		});
	  
	
			
		function addGalleria() {
			
			$('.clickGallery a').livequery('mouseover', function() {	
				var imageGal = $(this).attr("href");
				
				$('#leftBodyInner').css('background-image', 'url(' + imageGal + ')');
				return false;
				})
	
	}
	
		});

//vando gallery
$(document).ready(function() {
						
	
			
			$('.VclickGallery a').hover(function() {	
				var imageGal = $(this).attr("href");
				
				$('#leftBodyInner').css('background-image', 'url(' + imageGal + ')');
				return false;
				})
	
	
	
		});
