	$(document).ready(function() { 
							   
		$("a.lightview").fancybox({'overlayShow': true, overlayOpacity:0.9,frameWidth:600,frameHeight:400 });
		
		$("a").focus(function () {
        	$(this).blur();
		});
		$("img.rollover").hover(function () {
			newsrc=$(this).attr('src').replace('.jpg','-over.jpg').replace('.png','-over.png');
        	$(this).attr('src',newsrc);
		},function () {
			newsrc=$(this).attr('src').replace('-over.jpg','.jpg').replace('-over.png','.png');
        	$(this).attr('src',newsrc);
		});
		
		$('.wysiwyg-full').ckeditor();
		var config = {
				toolbar:
					[
						['Format','TextColor','Bold','Italic','Underline','Strike'],
						['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
						['Link','Unlink'],['Maximize'],
						['NumberedList','BulletedList','Outdent','Indent'],
						['Undo','Redo','-','RemoveFormat'],
						['Cut','Copy','Paste','PasteText','PasteFromWord'],
					    ['Table','HorizontalRule','SpecialChar']
					],
				uiColor: '#dddddd'
				};
		$('.wysiwyg').each(function(index) {
			config.width=$(this).css('width');
			config.height=$(this).css('height');
			$(this).ckeditor(config);
		});
		
		
	});
	

	function changeProductList(title){
		$('.products-secondary').each(function(s) {
			$(this).hide();
		});
		$('#cat-'+title).show();
	}	
	function changeProductItems(title){
		$('.products-third').each(function(s) {
			$(this).hide();
		});
		$('#item-'+title).show();
	}
	
	function sendEmail() {
		$('#submitbutton').val('Sending...');
		$('#submitbutton').attr("disabled","true");
		$.post('form-contactus.php?r='+Math.random(),{
			visitor_fullname: $('#visitor_fullname').val(),
			visitor_email: $('#visitor_email').val(),
			visitor_message: $('#visitor_message').val(),
			visitor_telephone: $('#visitor_telephone').val()
		
			},
			function (data) {
				$('#sendStatus').html("<br /><p>Your message has been sent, we will reply as soon as possible.<br /><br />Thank you,<br />JBS Co. Ltd</p>");
				$('#submitbutton').val('Send Message');
				$('#submitbutton').attr("disabled",false);
				$('#contactForm').html("");
			}
		);
		return false;
	}

