	<!--
	// -----------------------------------------------------------------------------
	// Globals
	// Major version of Flash required
	var requiredMajorVersion = 8;
	// Minor version of Flash required
	var requiredMinorVersion = 0;
	// Minor revision of Flash required
	var requiredRevision = 0;
	
	var noflash = "<img src='../images/fw2display.jpg' alt='Powakaddy Freeway II Display' /><h3>Freeway II Display</h3>";
	var noflashbags = '<img src="images/golfbagsbk.jpg" alt="Powakaddy Cart &amp; Golf Bags" />';
	var noflashbags1 = '<div class="bagdetails"><h4>Please scroll over the bags to view more details.</h4></div>';
	// -----------------------------------------------------------------------------
	// -->
	


$(document).ready(function() {
$('.logoreveal').cycle({ 
    fx:     'fade',
    speed:	'slow',
    timeout: 3500
});
$('.showproduct, .showproductbanner, .showdist, .showspon').cycle({ 
    fx:     'fade',
    speed:	'slow',
    timeout: 3500
});

$('.showfold').cycle({ 
    fx:     'fade',
    speed:	'slow',
    timeout: 1000,
    next:   'div.showfold a'
});

$('.showfoldtouch').cycle({ 
    fx:     'fade',
    speed:	'slow',
    timeout: 1000,
    next:   'div.showfold a'
});

$('.productheader').cycle({ 
    fx:     'fade',
    speed:	'slow',
    timeout: 0,
    next:   'div.productheaderlabel a, div.productheaderlabel1 a, div.productheaderlabel-touch a'
});

$('#homepage-adverts').cycle({
	fx:     'fade',
    speed:	'slow',
    timeout: 5000
});

$('div.productheaderlabel a').click(
function() {
	if($('div.productheaderlabel a img').attr('src') == '/_build/viewblack.jpg' ){
		$('div.productheaderlabel a img').attr('src', '/_build/viewwhite.jpg');
		$('div.productheaderlabel a span').html('View in white');
	} else {
		$('div.productheaderlabel a img').attr('src', '/_build/viewblack.jpg');
		$('div.productheaderlabel a span').html('View in black');
	}
});

$('div.productheaderlabel1 a').click(
function() {
	if($('div.productheaderlabel1 a img').attr('src') == '/_build/viewblack.jpg' ){
		$('div.productheaderlabel1 a img').attr('src', '/_build/viewwhite.jpg');
		$('div.productheaderlabel1 a span').html('View in white');
	} else {
		$('div.productheaderlabel1 a img').attr('src', '/_build/viewblack.jpg');
		$('div.productheaderlabel1 a span').html('View in black / wide wheels');
	}
});



$('div.productheaderlabel-touch a').click(
function() {
	if($('div.productheaderlabel-touch a img').attr('src') == 'images/viewbronze.jpg' ){
		$('div.productheaderlabel-touch a img').attr('src', 'images/viewwhite.jpg');
		$('div.productheaderlabel-touch a span').html('<br />View in white');
	} else {
		$('div.productheaderlabel-touch a img').attr('src', 'images/viewbronze.jpg');
		$('div.productheaderlabel-touch a span').html('<br />View in bronze');
	}
});


$('.touch-movie').css('height', '0px');


$('#show-touch-movie').click( function(){
	$('.touch-movie').animate({ height: "364px" }, 1000 );
	$('#show-touch-movie').fadeOut('slow');
});

$('#close-touch-movie').click( function(){
	$('.touch-movie').animate({ height: "0px" }, 1000, function(){
		$('#touch-movie-wrapper').load('/products/touch/movie.html');
	});
	$('#show-touch-movie').fadeIn('slow');
});



$('a.navproduct1').click(
	function() {
		if($('ul.navproduct1x').css('display') == 'none') {
			$('ul.navproduct1x').slideDown('slow');
		} else {
			$('ul.navproduct1x').hide();
		}
	}
)

$('a.navproduct2').click(
	function() {
		if($('ul.navproduct2x').css('display') == 'none') {
			$('ul.navproduct2x').slideDown();
		} else {
			$('ul.navproduct2x').hide();
		}
	}
)

$('a.navwheretobuy1').click(
	function() {
		if($('ul.navwheretobuy1x').css('display') == 'none') {
			$('ul.navwheretobuy1x').slideDown();
		} else {
			$('ul.navwheretobuy1x').hide();
		}
	}
)

$('a.navsupport1').click(
	function() {
		if($('ul.navsupport1x').css('display') == 'none') {
			$('ul.navsupport1x').slideDown();
		} else {
			$('ul.navsupport1x').hide();
		}
	}
)

$('a.navpress1').click(
	function() {
		if($('ul.navpress1x').css('display') == 'none') {
			$('ul.navpress1x').slideDown();
		} else {
			$('ul.navpress1x').hide();
		}
	}
)

$('a.navpartner1').click(
	function() {
		if($('ul.navpartner1x').css('display') == 'none') {
			$('ul.navpartner1x').slideDown();
		} else {
			$('ul.navpartner1x').hide();
		}
	}
)

$('input, textarea').click(
	function() {
		if (this.value == this.defaultValue) {
			this.value = "";
			$('#btnSubmit').attr('value', 'Submit');
		}
	}
)

$('ul.worldstockists li').hide();
$('#cc37').fadeIn();
$('#c37').css('color', '#FFC425');

$('div.worldlist a').click(
	function() {
		$('div.worldlist ul a').css('color','#000');
		this.style.color = "#FFC425";
		$('ul.worldstockists li').hide();
		$('#c' + this.id).fadeIn();
	}
)

if($('div#panelRegisterError').css('display') == 'block') {
	$('html,body').animate({scrollTop:0}, 1000);
}

$('form.joinpkcontainer').hide();

$('a.joinpk').click(
	function() {
		if($('form.joinpkcontainer').css('display') == 'none') {
			$('form.joinpkcontainer').slideDown('slow');
		} else {
			$('form.joinpkcontainer').slideUp('slow');
		}
	}
)

});

function validateJoin() {
	errorstring = "";
	error = 0;
	if($('#joinemail').val() == "Email" || $('#joinemail').val() == "") {
		error = 1;
	} else if (echeck($('#joinemail').val()) == false){
		error = 1;
	}
	if (error == 1) {
		$('#formerrorjoin').html("Please enter a valid email");
		return false;
	}
}

function validateBrochure() {
	errorstring = "";
	error = 0;
	if($('#email').val() == "Email" || $('#email').val() == "") {
		errorstring = "Email<br />";
		error = 1;
	}  else if ($('#email').val() != $('#email1').val()) {
		errorstring = errorstring + "Both email addresses must match<br />";
		error = 1;
	} else if (echeck($('#email').val()) == false){
		errorstring = errorstring + "Invalid email address<br />";
		error = 1;
	}
	
	if (error == 1) {
		$('#formerrorreport').html("Please complete the following fields:<br />" + errorstring);
		$('html,body').animate({scrollTop:0}, 1000);
		return false;
	}
}

function validateContact() {
	errorstring = "";
	error = 0;
	if($('#email').val() == "Email Address" || $('#email').val() == "") {
		errorstring = "<li>Email</li>";
		error = 1;
	} else if ($('#email').val() != $('#email1').val()) {
		errorstring = errorstring + "<li>Both email addresses must match</li>";
		error = 1;
	} else if (echeck($('#email').val()) == false){
		errorstring = errorstring + "<li>Invalid email address</li>";
		error = 1;
	}
	if($('#firstname').val() == "First Name" || $('#firstname').val() == "") {
		errorstring = errorstring + "<li>First Name</li>";
		error = 1;
	}
	if($('#lastname').val() == "Last Name" || $('#lastname').val() == "") {
		errorstring = errorstring + "<li>Last name</li>";
		error = 1;
	} 
	if($('#address').val() == "Address" || $('#address').val() == "") {
		errorstring = errorstring + "<li>Address</li>";
		error = 1;
	}
	if($('#telephone').val() == "Telephone Number" || $('#telephone').val() == "") {
		errorstring = errorstring + "<li>Telephone Number</li>";
		error = 1;
	} 
	if($('#message').val() == "Message" || $('#message').val() == "") {
		errorstring = errorstring + "<li>Message</li>";
		error = 1;
	} 
	if (error == 1) {
		$('#formerrorreport').html("Please complete the following fields:<ul>" + errorstring + "</ul>");
		$('html').animate({scrollTop:0}, 'slow'); 
		return false;
	}
}

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return false
		 }

 		 return true					
	}
	
function FP_openNewWindow(w,h,nav,loc,sts,menu,scroll,resize,name,url) {//v1.0
var windowProperties=''; if(nav==false) windowProperties+='toolbar=no,'; else
  windowProperties+='toolbar=yes,'; if(loc==false)
windowProperties+='location=no,';
else windowProperties+='location=yes,'; if(sts==false)
windowProperties+='status=no,';
else windowProperties+='status=yes,'; if(menu==false)
windowProperties+='menubar=no,';
else windowProperties+='menubar=yes,'; if(scroll==false)
windowProperties+='scrollbars=no,';
else windowProperties+='scrollbars=yes,'; if(resize==false)
windowProperties+='resizable=no,';
else windowProperties+='resizable=yes,'; if(w!="")
windowProperties+='width='+w+',';
if(h!="") windowProperties+='height='+h; if(windowProperties!="") {
  if( windowProperties.charAt(windowProperties.length-1)==',')
   windowProperties=windowProperties.substring(0,windowProperties.length-1);
}
window.open(url,name,windowProperties);
}
