/*
 * Triflow Concepts jQuery 
 *
 * Copyright (c) 2010
 *
 * http://www.triflowconcepts.com
 */
 function theRotator() {
	//Set the opacity of all images to 0
	$('div#rotator ul li').css({opacity: 0.0});
	$('div#rotator2 ul li').css({opacity: 0.0});
	//Get the first image and display it (gets set to full opacity)
	$('div#rotator ul li:first').css({opacity: 1.0});
	$('div#rotator2 ul li:first').css({opacity: 1.0});
		
	//Call the rotator function to run the slideshow, 6000 = change to next image after 6 seconds
	setInterval('rotate()',3000);
	
};

function rotate() {	
	//Get the first image
	var current = ($('div#rotator ul li.show')?  $('div#rotator ul li.show') : $('div#rotator ul li:first'));
	var current = ($('div#rotator2 ul li.show')?  $('div#rotator2 ul li.show') : $('div#rotator2 ul li:first'));

	//Get next image, when it reaches the end, rotate it back to the first image
	var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div#rotator ul li:first') :current.next()) : $('div#rotator ul li:first'));	
	var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div#rotator2 ul li:first') :current.next()) : $('div#rotator2 ul li:first'));	
	
	//Set the fade in effect for the next image, the show class has higher z-index
	next.css({opacity: 0.0})
	.addClass('show')
	.animate({opacity: 1.0}, 1000);

	//Hide the current image
	current.animate({opacity: 0.0}, 1000)
	.removeClass('show');
	
};

 
function theCSRotator() {
	//Set the opacity of all images to 0
	$('div#csrotator ul li').css({opacity: 0.0});
	
	//Get the first image and display it (gets set to full opacity)
	$('div#csrotator ul li:first').css({opacity: 1.0});
		
	//Call the rotator function to run the slideshow, 6000 = change to next image after 6 seconds
	setInterval('csrotate()',4000);
	
};

function csrotate() {	
	//Get the first image
	var current = ($('div#csrotator ul li.show')?  $('div#csrotator ul li.show') : $('div#csrotator ul li:first'));

	//Get next image, when it reaches the end, rotate it back to the first image
	var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div#csrotator ul li:first') :current.next()) : $('div#csrotator ul li:first'));	
	
	//Set the fade in effect for the next image, the show class has higher z-index
	next.css({opacity: 0.0})
	.addClass('show')
	.animate({opacity: 1.0}, 1000);

	//Hide the current image
	current.animate({opacity: 0.0}, 1000)
	.removeClass('show');
	
};

 function theHomeRotator() {
	//Set the opacity of all images to 0
	$('div#homerotator ul li').css({opacity: 0.0});
	
	//Get the first image and display it (gets set to full opacity)
	$('div#homerotator ul li:first').css({opacity: 1.0});
		
	//Call the rotator function to run the slideshow, 6000 = change to next image after 6 seconds
	setInterval('homerotate()',4000);
	
};

function homerotate() {	
	//Get the first image
	var current = ($('div#homerotator ul li.show')?  $('div#homerotator ul li.show') : $('div#homerotator ul li:first'));

	//Get next image, when it reaches the end, rotate it back to the first image
	var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div#homerotator ul li:first') :current.next()) : $('div#homerotator ul li:first'));	
	
	//Set the fade in effect for the next image, the show class has higher z-index
	next.css({opacity: 0.0})
	.addClass('show')
	.animate({opacity: 1.0}, 1000);

	//Hide the current image
	current.animate({opacity: 0.0}, 1000)
	.removeClass('show');
	
};

function fadecutting() {
	//Set the opacity of all images to 0
	$('div.cutting img').css({opacity: 0.4});
	
	$('div.cutting img').hover(function() {
		 $(this).fadeTo('medium', 1);
	},
	function() {
		 $(this).fadeTo('medium', 0.4);
	});
	
};


 
$(window).ready(function() {
										 
            
			theRotator();
			theCSRotator();
			theHomeRotator();
			fadecutting();
			var content = $('body');
			var anchors = $('a', content);
			var pinfo = $('div#prod_title');
			var toggle = $('a', pinfo);
			var gallery = $('div.sliderGallery');
            var ul = $('ul', gallery);
			var sl = $('div.slider');
			var h = $('div', sl);
			
			/*var itemsWidth = 0;
            
			var sliderWidth = sl.innerWidth();
			var sliderWidth = 837;
			//alert('slider width:' + sliderWidth);
			var itemsWidth = ul.outerWidth() - gallery.innerWidth();
			alert('items width:' + itemsWidth);
			var ratio = itemsWidth / sliderWidth;
			
			//alert('ratio:' + ratio);*/
			var option = $('ul#options');
			var alt = $('ul#altop');
			var alta = $('a.alt_link');
			
			$('div#product_submenu').hide();
			$('div#technology_submenu').hide();
			$('div#media_submenu').hide();
			$('div#about_submenu').hide();
			$('div#support_submenu').hide();
			$('div#where_submenu').hide();
			$('div#pinfo').hide();
			$('a#hide').hide();
			$('ul#altop').hide();				
			$('li#triflow').hide();
			$('li#perrin').hide();
			$('li#tq').hide();
			$('a#alt_hide').hide();
			
			$('img#left_arrow').fadeTo('medium', 0.5);
			$('img#right_arrow').fadeTo('medium', 0.5);
			
			anchors.blur();
			
			//var itemsWidth = ul.outerWidth() - gallery.innerWidth();
			//alert('items width:' + itemsWidth);
			
               /*$('.slider').slider({
                min: 0,
                max:(sliderWidth),
				
                stop: function (event, ui) {
                    ul.animate({'left' : ui.value * -ratio}, 100);
					h.animate({'left' : ui.value * 1}, 100);
					
                },
                slide: function (event, ui) {
                    ul.css('left', ui.value * -ratio);
					h.css('left', ui.value * 1);
                }
            	});
				
				$('li#bath_tag').click(function() {
					ul.css('left', -200);
					h.css('left', 200);
				});
				
				$('img#left_arrow').hover(function() {
					$(this).fadeTo('medium', 1);
					ul.css('left', ratio);
					h.css('left', -1);
			    },
				function() {
					$(this).fadeTo('medium', 0.5);
					
				});
				
				$('img#right_arrow').hover(function() {
					$(this).fadeTo('medium', 1);
					ul.css('left', -ratio);
					h.css('left', 1);
				},
				function() {
					$(this).fadeTo('medium', 0.5);
					
				});*/
				
			/*-----------------------------------------------------------------------------*/
				
			var tfcgallery = $('div.tfcgallery');
            var tfcul = $('ul', tfcgallery);
			var tfcsl = $('div.slider');
			var tfch = $('div', tfcsl);
			var tfcitemsWidth = 600;
            
			var tfcsliderWidth = 837;
			//alert('slider width:' + tfcsliderWidth);
			
			//alert('items width:' + tfcitemsWidth);
			var tfcratio = tfcitemsWidth / tfcsliderWidth;
			//alert('ratio:' + tfcratio);
 			$('.slider').slider({
                min: 0,
                max:837,
				
                stop: function (event, ui) {
                    tfcul.animate({'left' : ui.value * -tfcratio}, 100);
					tfch.animate({'left' : ui.value * 1}, 100);
					
                },
                slide: function (event, ui) {
                    tfcul.css('left', ui.value * -tfcratio);
					tfch.css('left', ui.value * 1);
                }
             });
				
				$('#tfck').click(function() {
					tfcul.css('left', 0);
					tfch.css('left', 0);
				});
				
				$('#tfcb').click(function() {
			        var tfcbchange = (tfcratio *680);
					tfcul.css('left', -tfcbchange);
					tfch.css('left', 680);
				});
				
				$('#tfcs').click(function() {
			        var tfcschange = (tfcratio *775);
					tfcul.css('left', -tfcschange);
					tfch.css('left', 775);
				});
				
			//-----------------	
				
			var tfclgallery = $('div.tfclgallery');
            var tfclul = $('ul', tfclgallery);
			var tfclsl = $('div.tfclslider');
			var tfclh = $('div', tfclsl);
			var tfclitemsWidth = 141;
            
			var tfclsliderWidth = 837;
			//alert('slider width:' + tfclsliderWidth);
			
			//alert('items width:' + tfclitemsWidth);
			var tfclratio = tfclitemsWidth / tfclsliderWidth;
			//alert('ratio:' + tfcratio);
 			$('.tfclslider').slider({
                min: 0,
                max:837,
				
                stop: function (event, ui) {
                    tfclul.animate({'left' : ui.value * -tfclratio}, 100);
					tfclh.animate({'left' : ui.value * 1}, 100);
					
                },
                slide: function (event, ui) {
                    tfclul.css('left', ui.value * -tfclratio);
					tfclh.css('left', ui.value * 1);
                }
             });
				
				/*$('#tfclk').click(function() {
					tfclul.css('left', 0);
					tfclh.css('left', 0);
				});
				
				$('#tfclb').click(function() {
			        var tfclbchange = (tfclratio *720);
					tfclul.css('left', -tfclbchange);
					tfclh.css('left', 720);
				});
				
				$('#tfcls').click(function() {
			        var tfclschange = (tfclratio *820);
					tfclul.css('left', -tfclschange);
					tfclh.css('left', 820);
				});*/
				
			//---------------------------------
			
			var tfcogallery = $('div.tfcogallery');
            var tfcoul = $('ul', tfcogallery);
			var tfcosl = $('div.tfcoslider');
			var tfcoh = $('div', tfcosl);
			var tfcoitemsWidth = 1300;
            
			var tfcosliderWidth = 837;
			//alert('slider width:' + tfcsliderWidth);
			
			//alert('items width:' + tfcitemsWidth);
			var tfcoratio = tfcoitemsWidth / tfcosliderWidth;
			//alert('ratio:' + tfcratio);
 			$('.tfcoslider').slider({
                min: 0,
                max:837,
				
                stop: function (event, ui) {
                    tfcoul.animate({'left' : ui.value * -tfcoratio}, 100);
					tfcoh.animate({'left' : ui.value * 1}, 100);
					
                },
                slide: function (event, ui) {
                    tfcoul.css('left', ui.value * -tfcoratio);
					tfcoh.css('left', ui.value * 1);
                }
             });
				
				$('#tfcok').click(function() {
					tfcoul.css('left', 0);
					tfcoh.css('left', 0);
				});
				
				$('#tfcob').click(function() {
			        var tfcobchange = (tfcoratio *837);
					tfcoul.css('left', -tfcobchange);
					tfcoh.css('left', 837);
				});
				
				
			//---------------------------------------
			
			var tfsgallery = $('div.tfsgallery');
            var tfsul = $('ul', tfsgallery);
			var tfssl = $('div.tfsslider');
			var tfsh = $('div', tfssl);
			var tfsitemsWidth = 300;
            
			var tfssliderWidth = 837;
			//alert('slider width:' + tfcsliderWidth);
			
			//alert('items width:' + tfcitemsWidth);
			var tfsratio = tfsitemsWidth / tfssliderWidth;
			//alert('ratio:' + tfcratio);
 			$('.tfsslider').slider({
                min: 0,
                max:837,
				
                stop: function (event, ui) {
                    tfsul.animate({'left' : ui.value * -tfsratio}, 100);
					tfsh.animate({'left' : ui.value * 1}, 100);
					
                },
                slide: function (event, ui) {
                    tfsul.css('left', ui.value * -tfsratio);
					tfsh.css('left', ui.value * 1);
                }
             });
				
				
			
			//---------------------------------
			
			var prcgallery = $('div.prcgallery');
            var prcul = $('ul', prcgallery);
			var prcsl = $('div.prcslider');
			var prch = $('div', prcsl);
			var prcitemsWidth = 9394;
            
			var prcsliderWidth = 837;
			//alert('slider width:' + tfcsliderWidth);
			
			//alert('items width:' + tfcitemsWidth);
			var prcratio = prcitemsWidth / prcsliderWidth;
			//alert('ratio:' + tfcratio);
 			$('.prcslider').slider({
                min: 0,
                max:837,
				
                stop: function (event, ui) {
                    prcul.animate({'left' : ui.value * -prcratio}, 100);
					prch.animate({'left' : ui.value * 1}, 100);
					
                },
                slide: function (event, ui) {
                    prcul.css('left', ui.value * -prcratio);
					prch.css('left', ui.value * 1);
                }
             });
				
				$('#prck').click(function() {
					prcul.css('left', 0);
					prch.css('left', 0);
				});
				
				$('#prcb').click(function() {
			        var prcbchange = (prcratio *288);
					var prcbhchange = (prcratio *288);
					prcul.css('left', -prcbchange);
					prch.css('left', 288);
				});
				
				$('#prcbb').click(function() {
			        var prcbbchange = (prcratio *186);
					prcul.css('left', -prcbbchange);
					prch.css('left', 186);
				});
				
				$('#prcs').click(function() {
			        var prcschange = (prcratio *539);
					prcul.css('left', -prcschange);
					prch.css('left', 539);
				});
				
				$('#prcsw').click(function() {
			        var prcswchange = (prcratio *836);
					prcul.css('left', -prcswchange);
					prch.css('left', 836);
				});
				
				$('#prca').click(function() {
			        var prcachange = (prcratio *696);
					prcul.css('left', -prcachange);
					prch.css('left', 696);
				});
				
			//---------------------------------
			
			var prcogallery = $('div.prcogallery');
            var prcoul = $('ul', prcogallery);
			var prcosl = $('div.prcoslider');
			var prcoh = $('div', prcosl);
			var prcoitemsWidth = 12008;
            
			var prcosliderWidth = 837;
			//alert('slider width:' + tfcsliderWidth);
			
			//alert('items width:' + tfcitemsWidth);
			var prcoratio = prcoitemsWidth / prcosliderWidth;
			//alert('ratio:' + tfcratio);
 			$('.prcoslider').slider({
                min: 0,
                max:837,
				
                stop: function (event, ui) {
                    prcoul.animate({'left' : ui.value * -prcoratio}, 100);
					prcoh.animate({'left' : ui.value * 1}, 100);
					
                },
                slide: function (event, ui) {
                    prcoul.css('left', ui.value * -prcoratio);
					prcoh.css('left', ui.value * 1);
                }
             });
				
				$('#prcok').click(function() {
					prcoul.css('left', 0);
					prcoh.css('left', 0);
				});
				
				$('#prcob').click(function() {
			        var prcobchange = (prcoratio *208);
					prcoul.css('left', -prcobchange);
					prcoh.css('left', 208);
				});
				
				$('#prcobb').click(function() {
			        var prcobbchange = (prcoratio *80);
					prcoul.css('left', -prcobbchange);
					prcoh.css('left', 80);
				});
				
				$('#prcos').click(function() {
			        var prcoschange = (prcoratio *420);
					prcoul.css('left', -prcoschange);
					prcoh.css('left', 420);
				});
				
				$('#prcosw').click(function() {
			        var prcoswchange = (prcoratio *421);
					prcoul.css('left', -prcoswchange);
					prcoh.css('left', 421);
				});
				
				$('#prcoa').click(function() {
			        var prcoachange = (prcoratio *495);
					prcoul.css('left', -prcoachange);
					prcoh.css('left', 495);
				});
			
			//---------------------------------
			
			var prtgallery = $('div.prtgallery');
            var prtul = $('ul', prtgallery);
			var prtsl = $('div.prtslider');
			var prth = $('div', prtsl);
			var prtitemsWidth = 15259;
            
			var prtsliderWidth = 837;
			//alert('slider width:' + tfcsliderWidth);
			
			//alert('items width:' + tfcitemsWidth);
			var prtratio = prtitemsWidth / prtsliderWidth;
			//alert('ratio:' + tfcratio);
 			$('.prtslider').slider({
                min: 0,
                max:837,
				
                stop: function (event, ui) {
                    prtul.animate({'left' : ui.value * -prtratio}, 100);
					prth.animate({'left' : ui.value * 1}, 100);
					
                },
                slide: function (event, ui) {
                    prtul.css('left', ui.value * -prtratio);
					prth.css('left', ui.value * 1);
                }
             });
				
				$('#prtk').click(function() {
					prtul.css('left', 0);
					prth.css('left', 0);
				});
				
				$('#prtb').click(function() {
			        var prtbchange = (prtratio *212);
					prtul.css('left', -prtbchange);
					prth.css('left', 212);
				});
				
				$('#prtbb').click(function() {
			        var prtbbchange = (prtratio *111);
					prtul.css('left', -prtbbchange);
					prth.css('left', 111);
				});
				
				$('#prts').click(function() {
			        var prtschange = (prtratio *381);
					prtul.css('left', -prtschange);
					prth.css('left', 381);
				});
				
				$('#prtsw').click(function() {
			        var prtswchange = (prtratio *437);
					prtul.css('left', -prtswchange);
					prth.css('left', 437);
				});
				
				$('#prta').click(function() {
			        var prtachange = (prtratio *569);
					prtul.css('left', -prtachange);
					prth.css('left', 569);
				});
			
			//---------------------------------------------------------
			
			var prsgallery = $('div.prsgallery');
            var prsul = $('ul', prsgallery);
			var prssl = $('div.prsslider');
			var prsh = $('div', prssl);
			var prsitemsWidth = 2658;
            
			var prssliderWidth = 837;
			//alert('slider width:' + tfcsliderWidth);
			
			//alert('items width:' + tfcitemsWidth);
			var prsratio = prsitemsWidth / prssliderWidth;
			//alert('ratio:' + tfcratio);
 			$('.prsslider').slider({
                min: 0,
                max:837,
				
                stop: function (event, ui) {
                    prsul.animate({'left' : ui.value * -prsratio}, 100);
					prsh.animate({'left' : ui.value * 1}, 100);
					
                },
                slide: function (event, ui) {
                    prsul.css('left', ui.value * -prsratio);
					prsh.css('left', ui.value * 1);
                }
             });
				
				$('#prsc').click(function() {
					prsul.css('left', 0);
					prsh.css('left', 0);
				});
				
				$('#prsd').click(function() {
			        var prsdchange = (prsratio *356);
					prsul.css('left', -prsdchange);
					prsh.css('left', 356);
				});
				
				$('#prse').click(function() {
			        var prsechange = (prsratio *600);
					prsul.css('left', -prsechange);
					prsh.css('left', 600);
				});
				
				$('#prsv').click(function() {
			        var prsvchange = (prsratio *834);
					prsul.css('left', -prsvchange);
					prsh.css('left', 834);
				});
				
				
			
				
			/*----------------------------------------------------------------------------*/
			
			
				$('img.triprod').hover(function() {
						$('li#triflow').fadeTo("medium", 1);
						$('img.perrinprod').fadeTo("medium", 0.33);
						$('li#perrin').fadeTo("medium", 0);
						$('li#tq').fadeTo("medium", 0);
						$('img.triprod').fadeTo("medium", 1);
						$('img.tqprod').fadeTo("medium", 0.33);
						$('img.pnrsystem').fadeTo("medium", 0.33);
				});
				
				$('li#triflow').hover(function() {
						$('img.triprod').fadeTo("medium", 1);
						$('img.perrinprod').fadeTo("medium", 0.33);
						$('img.tqprod').fadeTo("medium", 0.33);
						$('li#perrin').fadeTo("medium", 0);
						$('li#tq').fadeTo("medium", 0);
						$('li#triflow').fadeTo("medium", 1);
				});
				$('li#tq').hover(function() {
						$('li#triflow').fadeTo("medium", 0);
						$('li#tq').fadeTo("medium", 1);
						$('img.perrinprod').fadeTo("medium", 0.33);
						$('img.tqprod').fadeTo("medium", 1);
						$('li#perrin').fadeTo("medium", 0);
						$('li#tq').fadeTo("medium", 0);
						$('img.triprod').fadeTo("medium", 0.33);
				});
				
				$('img.perrinprod').hover(function() {
						$('li#perrin').fadeTo("medium", 1);
						$('img.triprod').fadeTo("medium", 0.33);
						$('li#triflow').fadeTo("medium", 0);
						$('li#tq').fadeTo("medium", 0);
						$('img.perrinprod').fadeTo("medium", 1);
						$('img.tqprod').fadeTo("medium", 0.33);
						$('img.pnrsystem').fadeTo("medium", 0.33);
				});
				$('img.tqprod').hover(function() {
						$('li#tq').fadeTo("medium", 1);
						$('li#perrin').fadeTo("medium", 0);
						$('img.triprod').fadeTo("medium", 0.33);
						$('li#triflow').fadeTo("medium", 0);
						$('img.perrinprod').fadeTo("medium", 0.33);
						$('img.pnrsystem').fadeTo("medium", 0.33);
						$('img.tqprod').fadeTo("medium", 0.8);
						$('img.pnrsystem').fadeTo("medium", 0.33);
				});
				$('li#perrin').hover(function() {
						$('li#perrin').fadeTo("medium", 1);
						$('img.triprod').fadeTo("medium", 0.33);
						$('img.tqprod').fadeTo("medium", 0.33);
						$('li#triflow').fadeTo("medium", 0);
						$('li#tq').fadeTo("medium", 0);
						$('img.perrinprod').fadeTo("medium", 1);
				});
				$('img.pnrsystem').hover(function() {
						$('li#perrin').fadeTo("medium", 0);
						$('img.triprod').fadeTo("medium", 0.33);
						$('li#triflow').fadeTo("medium", 0);
						$('img.perrinprod').fadeTo("medium", 0.33);
						$('img.pnrsystem').fadeTo("medium", 1);
				});
				
				$(toggle).click(function() {
						$('div#pinfo').slideToggle('300');
				});
				
				
				$(alta).click(function() {
						$('ul#altop').slideToggle('300');
				});
				
				$('a#view').click(function() {
						$('a#hide').show();
						$('a#view').hide();
				});
				
				$('a#hide').click(function() {
						$('a#view').show();
						$('a#hide').hide();
				});
				
				$('a#alt_view').click(function() {
						$('a#alt_hide').show();
						$('a#alt_view').hide();
				});
				
				$('a#alt_hide').click(function() {
						$('a#alt_view').show();
						$('a#alt_hide').hide();
				});
				
				
				
				$('a#home').hover(function () {
					$('div#product_submenu').slideUp('fast');									  
					$('div#media_submenu').slideUp('fast');
					$('div#about_submenu').slideUp('fast');
					$('div#support_submenu').slideUp('fast');;
					$('div#where_submenu').slideUp('fast');
					$('div#technology_submenu').slideUp('fast');
					$('a#technology-nav').fadeTo("fast", 0.25);
					$('a#about-nav').fadeTo("fast", 0.25);
					$('a#media-nav').fadeTo("fast", 0.25);
					$('a#product-nav').fadeTo("fast", 0.25);
					$('a#support-nav').fadeTo("fast", 0.25);
					$('a#home').fadeTo("fast", 1);
					$('a#business').fadeTo("fast", 0.25);
					$('a#store-nav').fadeTo("fast", 0.25);
					$('a#back-nav').fadeTo("fast", 0.25);
					$('a#where-nav').fadeTo("fast", 0.25);
					$('a#competition-nav').fadeTo("fast", 0.25);
    			},
				function () {
					$('a#technology-nav').fadeTo("fast", 1);
					$('a#about-nav').fadeTo("fast", 1);
					$('a#media-nav').fadeTo("fast", 1);
					$('a#product-nav').fadeTo("fast", 1);
					$('a#support-nav').fadeTo("fast", 1);
					$('a#store-nav').fadeTo("fast", 1);
					$('a#home').fadeTo("fast", 1);
					$('a#business').fadeTo("fast", 1);
					$('a#back-nav').fadeTo("fast", 1);
					$('a#where-nav').fadeTo("fast", 1);
					$('a#competition-nav').fadeTo("fast", 1);
    			});
				$('a#product-nav').hover(
					function () {
						$('div#product_submenu').slideDown('slow');
						$('div#media_submenu').slideUp('fast');
						$('div#about_submenu').slideUp('fast');
						$('div#support_submenu').slideUp('fast');
						$('div#where_submenu').slideUp('fast');
						$('div#technology_submenu').slideUp('fast');
						$('a#product-nav').css('color:#cc092f');
						$('a#technology-nav').fadeTo("fast", 0.25);
						$('a#about-nav').fadeTo("fast", 0.25);
						$('a#media-nav').fadeTo("fast", 0.25);
						$('a#where-nav').fadeTo("fast", 0.25);
						$('a#support-nav').fadeTo("fast", 0.25);
						$('a#store-nav').fadeTo("fast", 0.25);
						$('a#back-nav').fadeTo("fast", 0.25);
						$('a#home').fadeTo("fast", 0.25);
						$('a#business').fadeTo("fast", 0.25);
						$('a#product-nav').fadeTo("fast", 1);
						$('a#competition-nav').fadeTo("fast", 0.25);
    				}
				);
				
				
				$('div#product_submenu').mouseleave(function () {
					$('div#product_submenu').slideUp();
					$('a#product-nav').css('color:#fff');
					$('a#technology-nav').fadeTo("fast", 1);
					$('a#about-nav').fadeTo("fast", 1);
					$('a#media-nav').fadeTo("fast", 1);
					$('a#where-nav').fadeTo("fast", 1);
					$('a#support-nav').fadeTo("fast", 1);
					$('a#store-nav').fadeTo("fast", 1);
					$('a#home').fadeTo("fast", 1);
					$('a#business').fadeTo("fast", 1);
					$('a#back-nav').fadeTo("fast", 1);
					$('a#competition-nav').fadeTo("fast", 1);
    			});
				
				$('div#product_submenu').mouseenter(function () {
					$('a#product-nav').css('color:#cc092f');
    			});
				$('a#technology-nav').hover(
					function () {
						$('div#technology_submenu').slideDown('slow');
						$('a#technology-nav').css('color:#cc092f');
						$('a#product-nav').fadeTo("fast", 0.25);
						$('a#about-nav').fadeTo("fast", 0.25);
						$('a#media-nav').fadeTo("fast", 0.25);
						$('a#where-nav').fadeTo("fast", 0.25);
						$('a#support-nav').fadeTo("fast", 0.25);
						$('a#store-nav').fadeTo("fast", 0.25);
						$('a#back-nav').fadeTo("fast", 0.25);
						$('a#product-nav').fadeTo("fast", 0.25);
						$('a#home').fadeTo("fast", 0.25);
						$('a#business').fadeTo("fast", 0.25);
						$('a#technology-nav').fadeTo("fast", 1);
						$('a#competition-nav').fadeTo("fast", 0.25);
    				}
				);
				$('div#technology_submenu').mouseleave(function () {
					$('div#technology_submenu').slideUp();
					$('a#technology-nav').css('color:#fff');
					$('a#product-nav').fadeTo("fast", 1);
					$('a#about-nav').fadeTo("fast", 1);
					$('a#media-nav').fadeTo("fast", 1);
					$('a#where-nav').fadeTo("fast", 1);
					$('a#support-nav').fadeTo("fast", 1);
					$('a#home').fadeTo("fast", 1);
					$('a#business').fadeTo("fast", 1);
					$('a#store-nav').fadeTo("fast", 1);
					$('a#back-nav').fadeTo("fast", 1);
					$('a#competition-nav').fadeTo("fast", 1);
    			});
				$('div#technology_submenu').mouseenter(function () {
					$('a#technology-nav').css('color:#cc092f');
    			});
				
				$('a#media-nav').hover(function () {
					$('div#media_submenu').slideDown('slow');
					$('div#product_submenu').slideUp('fast');
					$('div#about_submenu').slideUp('fast');
					$('div#support_submenu').slideUp('fast');
					$('div#technology_submenu').slideUp('fast');
					$('div#where_submenu').slideUp('fast');
					$('a#media-nav').css('color:#cc092f');
					$('a#technology-nav').fadeTo("fast", 0.25);
					$('a#about-nav').fadeTo("fast", 0.25);
					$('a#product-nav').fadeTo("fast", 0.25);
					$('a#where-nav').fadeTo("fast", 0.25);
					$('a#support-nav').fadeTo("fast", 0.25);
					$('a#store-nav').fadeTo("fast", 0.25);
					$('a#back-nav').fadeTo("fast", 0.25);
					$('a#home').fadeTo("fast", 0.25);
					$('a#business').fadeTo("fast", 0.25);
					$('a#media-nav').fadeTo("fast", 1);
					$('a#competition-nav').fadeTo("fast", 0.25);
    			}
				);
				
				
				$('div#media_submenu').mouseleave(function () {
					$('div#media_submenu').slideUp();
					$('a#media-nav').css('color:#fff');
					$('a#technology-nav').fadeTo("fast", 1);
					$('a#about-nav').fadeTo("fast", 1);
					$('a#product-nav').fadeTo("fast", 1);
					$('a#where-nav').fadeTo("fast", 1);
					$('a#support-nav').fadeTo("fast", 1);
					$('a#store-nav').fadeTo("fast", 1);
					$('a#home').fadeTo("fast", 1);
					$('a#business').fadeTo("fast", 1);
					$('a#back-nav').fadeTo("fast", 1);
					$('a#competition-nav').fadeTo("fast", 1);
    			});
				
				$('div#media_submenu').mouseenter(function () {
					$('a#media-nav').css('color:#cc092f');
    			});
				
				$('a#about-nav').hover(function () {
					$('div#about_submenu').slideDown('slow');
					$('div#media_submenu').slideUp('fast');
					$('div#product_submenu').slideUp('fast');
					$('div#support_submenu').slideUp('fast');
					$('div#technology_submenu').slideUp('fast');
					$('div#where_submenu').slideUp('fast');
					$('a#about-nav').css('color:#cc092f');
					$('a#technology-nav').fadeTo("fast", 0.25);
					$('a#product-nav').fadeTo("fast", 0.25);
					$('a#media-nav').fadeTo("fast", 0.25);
					$('a#home').fadeTo("fast", 0.25);
					$('a#business').fadeTo("fast", 0.25);
					$('a#where-nav').fadeTo("fast", 0.25);
					$('a#support-nav').fadeTo("fast", 0.25);
					$('a#store-nav').fadeTo("fast", 0.25);
					$('a#back-nav').fadeTo("fast", 0.25);
					$('a#about-nav').fadeTo("fast", 1);
					$('a#competition-nav').fadeTo("fast", 0.25);
    			});
				
				
				$('div#about_submenu').mouseleave(function () {
					$('div#about_submenu').slideUp();
					$('a#about-nav').css('color:#fff');
					$('a#technology-nav').fadeTo("fast", 1);
					$('a#product-nav').fadeTo("fast", 1);
					$('a#media-nav').fadeTo("fast", 1);
					$('a#where-nav').fadeTo("fast", 1);
					$('a#support-nav').fadeTo("fast", 1);
					$('a#store-nav').fadeTo("fast", 1);
					$('a#back-nav').fadeTo("fast", 1);
					$('a#home').fadeTo("fast", 1);
					$('a#business').fadeTo("fast", 1);
					$('a#competition-nav').fadeTo("fast", 1);
    			});
				
				$('div#about_submenu').mouseenter(function () {
					$('a#about-nav').css('color:#cc092f');
    			});
				
				$('a#support-nav').hover(function () {
					$('div#support_submenu').slideDown('slow');
					$('div#media_submenu').slideUp('fast');
					$('div#about_submenu').slideUp('fast');
					$('div#product_submenu').slideUp('fast');
					$('div#where_submenu').slideUp('fast');
					$('div#technology_submenu').slideUp('fast');
					$('a#support-nav').css('color:#cc092f');
					$('a#technology-nav').fadeTo("fast", 0.25);
					$('a#about-nav').fadeTo("fast", 0.25);
					$('a#media-nav').fadeTo("fast", 0.25);
					$('a#home').fadeTo("fast", 0.25);
					$('a#business').fadeTo("fast", 0.25);
					$('a#where-nav').fadeTo("fast", 0.25);
					$('a#product-nav').fadeTo("fast", 0.25);
					$('a#store-nav').fadeTo("fast", 0.25);
					$('a#back-nav').fadeTo("fast", 0.25);
					$('a#support-nav').fadeTo("fast", 1);
					$('a#competition-nav').fadeTo("fast", 0.25);
    			});
				
				
				$('div#support_submenu').mouseleave(function () {
					$('div#support_submenu').slideUp();
					$('a#support-nav').css('color:#fff');
					$('a#technology-nav').fadeTo("fast", 1);
					$('a#about-nav').fadeTo("fast", 1);
					$('a#media-nav').fadeTo("fast", 1);
					$('a#where-nav').fadeTo("fast", 1);
					$('a#product-nav').fadeTo("fast", 1);
					$('a#home').fadeTo("fast", 1);
					$('a#business').fadeTo("fast", 1);
					$('a#store-nav').fadeTo("fast", 1);
					$('a#back-nav').fadeTo("fast", 1);
					$('a#competition-nav').fadeTo("fast", 1);
    			});
				
				$('div#support_submenu').mouseenter(function () {
					$('a#support-nav').css('color:#cc092f');
    			});
				
				$('a#where-nav').hover(function () {
					$('div#where_submenu').slideDown('slow');
					$('div#media_submenu').slideUp('medium');
					$('div#about_submenu').slideUp('medium');
					$('div#support_submenu').slideUp('medium');
					$('div#product_submenu').slideUp('medium');
					$('div#technology_submenu').slideUp('medium');
					$('a#where-nav').css('color:#cc092f');
					$('a#technology-nav').fadeTo("fast", 0.25);
					$('a#about-nav').fadeTo("fast", 0.25);
					$('a#media-nav').fadeTo("fast", 0.25);
					$('a#product-nav').fadeTo("fast", 0.25);
					$('a#support-nav').fadeTo("fast", 0.25);
					$('a#store-nav').fadeTo("fast", 0.25);
					$('a#back-nav').fadeTo("fast", 0.25);
					$('a#where-nav').fadeTo("fast", 1);
					$('a#competition-nav').fadeTo("fast", 0.25);
    			});
				
				
				$('div#where_submenu').mouseleave(function () {
					$('div#where_submenu').slideUp();
					$('a#where-nav').css('color:#fff');
					$('a#technology-nav').fadeTo("fast", 1);
					$('a#about-nav').fadeTo("fast", 1);
					$('a#media-nav').fadeTo("fast", 1);
					$('a#product-nav').fadeTo("fast", 1);
					$('a#support-nav').fadeTo("fast", 1);
					$('a#store-nav').fadeTo("fast", 1);
					$('a#back-nav').fadeTo("fast", 1);
					$('a#competition-nav').fadeTo("fast", 1);
    			});
				
				$('div#where_submenu').mouseenter(function () {
					$('a#where-nav').css('color:#cc092f');
    			});
				
				$('a#technology-nav').hover(function () {
					$('div#technology_submenu').slideDown('slow');
					$('div#product_submenu').slideUp('fast');									  
					$('div#media_submenu').slideUp('fast');
					$('div#about_submenu').slideUp('fast');
					$('div#support_submenu').slideUp('fast');;
					$('div#where_submenu').slideUp('fast');
					$('a#technology-nav').fadeTo("fast", 1);
					$('a#about-nav').fadeTo("fast", 0.25);
					$('a#media-nav').fadeTo("fast", 0.25);
					$('a#product-nav').fadeTo("fast", 0.25);
					$('a#support-nav').fadeTo("fast", 0.25);
					$('a#store-nav').fadeTo("fast", 0.25);
					$('a#back-nav').fadeTo("fast", 0.25);
					$('a#where-nav').fadeTo("fast", 0.25);
    			},
				function () {
					$('a#business').fadeTo("fast", 1);
					$('a#technology-nav').fadeTo("fast", 1);
					$('a#about-nav').fadeTo("fast", 1);
					$('a#media-nav').fadeTo("fast", 1);
					$('a#product-nav').fadeTo("fast", 1);
					$('a#support-nav').fadeTo("fast", 1);
					$('a#store-nav').fadeTo("fast", 1);
					$('a#home').fadeTo("fast", 1);
					$('a#business').fadeTo("fast", 1);
					$('a#back-nav').fadeTo("fast", 1);
					$('a#where-nav').fadeTo("fast", 1);
    			});
				$('a#business').hover(function () {
					$('div#product_submenu').slideUp('fast');									  
					$('div#media_submenu').slideUp('fast');
					$('div#about_submenu').slideUp('fast');
					$('div#support_submenu').slideUp('fast');;
					$('div#where_submenu').slideUp('fast');
					$('div#technology_submenu').slideUp('fast');
					$('a#technology-nav').fadeTo("fast", 0.25);
					$('a#about-nav').fadeTo("fast", 0.25);
					$('a#media-nav').fadeTo("fast", 0.25);
					$('a#product-nav').fadeTo("fast", 0.25);
					$('a#support-nav').fadeTo("fast", 0.25);
					$('a#store-nav').fadeTo("fast", 0.25);
					$('a#home').fadeTo("fast", 0.25);
					$('a#business').fadeTo("fast", 1);
					$('a#back-nav').fadeTo("fast", 0.25);
					$('a#where-nav').fadeTo("fast", 0.25);
					$('a#competition-nav').fadeTo("fast", 0.25);
    			},
				function () {
					$('a#technology-nav').fadeTo("fast", 1);
					$('a#about-nav').fadeTo("fast", 1);
					$('a#media-nav').fadeTo("fast", 1);
					$('a#product-nav').fadeTo("fast", 1);
					$('a#support-nav').fadeTo("fast", 1);
					$('a#store-nav').fadeTo("fast", 1);
					$('a#home').fadeTo("fast", 1);
					$('a#business').fadeTo("fast", 1);
					$('a#back-nav').fadeTo("fast", 1);
					$('a#where-nav').fadeTo("fast", 1);
					$('a#home').fadeTo("fast", 1);
					$('a#competition-nav').fadeTo("fast", 1);
    			});
				
				$('a#competition-nav').hover(function () {
					$('div#product_submenu').slideUp('fast');									  
					$('div#media_submenu').slideUp('fast');
					$('div#about_submenu').slideUp('fast');
					$('div#support_submenu').slideUp('fast');;
					$('div#where_submenu').slideUp('fast');
					$('div#technology_submenu').slideUp('fast');
					$('a#technology-nav').fadeTo("fast", 0.25);
					$('a#about-nav').fadeTo("fast", 0.25);
					$('a#media-nav').fadeTo("fast", 0.25);
					$('a#product-nav').fadeTo("fast", 0.25);
					$('a#support-nav').fadeTo("fast", 0.25);
					$('a#home').fadeTo("fast", 0.25);
					$('a#business').fadeTo("fast", 0.25);
					$('a#store-nav').fadeTo("fast", 0.25);
					$('a#back-nav').fadeTo("fast", 0.25);
					$('a#where-nav').fadeTo("fast", 0.25);
					$('a#competition-nav').fadeTo("fast", 1);
    			},
				function () {
					$('a#technology-nav').fadeTo("fast", 1);
					$('a#about-nav').fadeTo("fast", 1);
					$('a#media-nav').fadeTo("fast", 1);
					$('a#product-nav').fadeTo("fast", 1);
					$('a#support-nav').fadeTo("fast", 1);
					$('a#store-nav').fadeTo("fast", 1);
					$('a#home').fadeTo("fast", 1);
					$('a#business').fadeTo("fast", 1);
					$('a#back-nav').fadeTo("fast", 1);
					$('a#where-nav').fadeTo("fast", 1);
					$('a#competition-nav').fadeTo("fast", 1);
    			});
				
				$('a#store-nav').hover(function () {
					$('div#product_submenu').slideUp('fast');									  
					$('div#media_submenu').slideUp('fast');
					$('div#about_submenu').slideUp('fast');
					$('div#support_submenu').slideUp('fast');
					$('div#where_submenu').slideUp('fast');
					$('div#technology_submenu').slideUp('fast');
					$('a#technology-nav').fadeTo("fast", 0.25);
					$('a#about-nav').fadeTo("fast", 0.25);
					$('a#media-nav').fadeTo("fast", 0.25);
					$('a#product-nav').fadeTo("fast", 0.25);
					$('a#support-nav').fadeTo("fast", 0.25);
					$('a#store-nav').fadeTo("fast", 1);
					$('a#back-nav').fadeTo("fast", 0.25);
					$('a#where-nav').fadeTo("fast", 0.25);
					$('a#home').fadeTo("fast", 0.25);
					$('a#business').fadeTo("fast", 0.25);
					$('a#competition-nav').fadeTo("fast", 0.25);
    			},
				function () {
					$('a#technology-nav').fadeTo("fast", 1);
					$('a#about-nav').fadeTo("fast", 1);
					$('a#media-nav').fadeTo("fast", 1);
					$('a#product-nav').fadeTo("fast", 1);
					$('a#support-nav').fadeTo("fast", 1);
					$('a#store-nav').fadeTo("fast", 1);
					$('a#back-nav').fadeTo("fast", 1);
					$('a#where-nav').fadeTo("fast", 1);
					$('a#home').fadeTo("fast", 1);
					$('a#business').fadeTo("fast", 1);
					$('a#competition-nav').fadeTo("fast", 1);
    			});
				
				$('a#back-nav').hover(function () {
					$('div#product_submenu').slideUp('fast');									  
					$('div#media_submenu').slideUp('fast');
					$('div#about_submenu').slideUp('fast');
					$('div#support_submenu').slideUp('fast');
					$('div#where_submenu').slideUp('fast');
					$('div#technology_submenu').slideUp('fast');
					$('a#technology-nav').fadeTo("fast", 1);
					$('a#about-nav').fadeTo("fast", 1);
					$('a#media-nav').fadeTo("fast", 1);
					$('a#product-nav').fadeTo("fast", 1);
					$('a#support-nav').fadeTo("fast", 1);
					$('a#store-nav').fadeTo("fast", 1);
					$('a#back-nav').fadeTo("fast", 1);
					$('a#where-nav').fadeTo("fast", 1);
					$('a#competition-nav').fadeTo("fast", 1);
    			},
				function () {
					$('a#technology-nav').fadeTo("fast", 1);
					$('a#about-nav').fadeTo("fast", 1);
					$('a#media-nav').fadeTo("fast", 1);
					$('a#product-nav').fadeTo("fast", 1);
					$('a#support-nav').fadeTo("fast", 1);
					$('a#store-nav').fadeTo("fast", 1);
					$('a#back-nav').fadeTo("fast", 1);
					$('a#home').fadeTo("fast", 1);
					$('a#business').fadeTo("fast", 1);
					$('a#where-nav').fadeTo("fast", 1);
					$('a#competition-nav').fadeTo("fast", 1);
    			});
				
				
				$("#tech_accordion").accordion({
		 			fillSpace:false,
					autoHeight:false
				});
				$("#faq_accordion").accordion({
		 			fillSpace:false,
					autoHeight:false
				});
				
				
				
				$('.ssnavlink').click(function()
				{
					 sss(this.getAttribute("rel"));
					 alert(selected);
					 return false;
				});
				  var c = readCookie('style');
				  if (c) sss(c);
				
				function sss(styleName)
				{
					  $('link[@rel*=style][title]').each(function(i)
					  	{
						 	this.disabled = true;
						 	if (this.getAttribute('title') == styleName) this.disabled = false;
					  	});
					  createCookie('style', styleName, 365);
				};
				
				//tfcGallery();

				
				$('#faqs li p').hide();
				$('#faqs h3').click(function(){
 					 $(this).next().slideToggle('medium');
				});
				
				$('.fix').hide();
				$('.help').click(function(){
 					 $(this).next('.fix').slideToggle('medium');
				});
				
				$('#competition-nav').click3(function(){
					$('a').fadeTo("fast", 0.25);
				});
				
				
				$('.secblock').hide();
				
				$('#tfk').click(function(){
 					 $(this).next('.secblock').slideToggle('medium');
					 
				});
				
				$('#prk').click(function(){
 					 $(this).next('.secblock').slideToggle('medium');
					 
				});
				
				$('#tfb').click(function(){
 					 $(this).next('.secblock').slideToggle('medium');
					 
				});
				
				$('#prb').click(function(){
 					 $(this).next('.secblock').slideToggle('medium');
					 
				});
				
				$('#pra').click(function(){
 					 $(this).next('.secblock').slideToggle('medium');
					 
				});
				
				var form = $('form');
				var contact_form = $('form#contact_us_form');
				var contactfocus = $('#enquiry_type', contact_form);
				var contactaddress2 = $('#address2', contact_form);
				var contacttel = $('#tel', contact_form);
				var contactother = $('#other', contact_form);
				var focused = $('input', form);
				var txtfocused = $('textarea', form);
				var selfocused = $('select', form);
				var register_form = $('form#register');
				var registerfocus = $('#name', register_form);
				var registeraddress2 = $('#address2', register_form);
				var registerpname = $('#pname', register_form);
				
				var inputdefault = 'Optional';
				
				
				contactaddress2.attr("value", inputdefault);
				contacttel.attr("value", inputdefault); 
				contactother.attr("value", inputdefault); 
				registeraddress2.attr("value", inputdefault);
				registerpname.attr("value", inputdefault); 
				
				focused.focus(function(e){  
				$(this).addClass("active"); 
				$(this).prev().css('color:#cc092f');
				});  
				focused.blur(function(e){  
				$(this).removeClass("active"); 
				$(this).prev().css('color:#fff');
				});
				
				txtfocused.focus(function(e){  
				$(this).addClass("active"); 
				$(this).prev().css('color:#cc092f');
				});  
				txtfocused.blur(function(e){  
				$(this).removeClass("active"); 
				$(this).prev().css('color:#fff');
				});
				
				selfocused.focus(function(e){  
				$(this).addClass("active"); 
				$(this).prev().css('color:#cc092f');
				});  
				selfocused.blur(function(e){  
				$(this).removeClass("active"); 
				$(this).prev().css('color:#fff');
				});
				
				contactaddress2.focus(function(){  
				if($(this).attr("value") == inputdefault) $(this).attr("value", "");   
				});  
				contactaddress2.blur(function(){  
				if($(this).attr("value") == "") $(this).attr("value", inputdefault);  
				}); 
				
				contacttel.focus(function(){  
				if($(this).attr("value") == inputdefault) $(this).attr("value", "");   
				});  
				contacttel.blur(function(){  
				if($(this).attr("value") == "") $(this).attr("value", inputdefault);  
				});
				
				contactother.focus(function(){  
				if($(this).attr("value") == inputdefault) $(this).attr("value", "");   
				});  
				contactother.blur(function(){  
				if($(this).attr("value") == "") $(this).attr("value", inputdefault);  
				});
				
				registeraddress2.focus(function(){  
				if($(this).attr("value") == inputdefault) $(this).attr("value", "");   
				});  
				registeraddress2.blur(function(){  
				if($(this).attr("value") == "") $(this).attr("value", inputdefault);  
				}); 
				
				registerpname.focus(function(){  
				if($(this).attr("value") == inputdefault) $(this).attr("value", "");   
				});  
				registerpname.blur(function(){  
				if($(this).attr("value") == "") $(this).attr("value", inputdefault);  
				});
				
				$('.labels li span').hover(function(){
						$(this).css('color:#cc092f;');	
				});
				
        	 });





		
