
function menuMouseEffect()
{
   
	$(".menuitem").mouseover(function(){
	    var imgSrc = $(this).attr("src");
	    
	    if (imgSrc.indexOf("_s.gif")<0) {
	       $(this).attr("src",imgSrc.substring(0,imgSrc.length -4)+"_s.gif") ;
        } else {
	       $(this).addClass("selected");
	    }
	   });
	$(".menuitem").mouseout(function(){
	    var imgSrc = $(this).attr("src");
	    if (imgSrc.indexOf("_s.gif")>0 && $(this).hasClass("selected") == false ) {
            $(this).attr("src",imgSrc.substring(0,imgSrc.length -6)+".gif");
	    }
	   });
	var selImage = $("#pImage").attr("src");
/*	$(".pColorItem").mouseover(function(){
	    var imgSrc = $("#pImage").attr("src");
	    
	    if (imgSrc.indexOf("_r.jpg")>0 || imgSrc.indexOf("_b.jpg")>0 || imgSrc.indexOf("_g.jpg")>0 || imgSrc.indexOf("_p.jpg")>0 || imgSrc.indexOf("_s.jpg")) {
	       if ( $(this).attr("id") == "pColorRed" ) {
	            $("#pImage").attr("src",imgSrc.substring(0,imgSrc.length -6)+"_r.jpg") ;
	       } else if ( $(this).attr("id") == "pColorBlue" ) {
	            $("#pImage").attr("src",imgSrc.substring(0,imgSrc.length -6)+"_b.jpg") ;
	       } else if ( $(this).attr("id") == "pColorGreen" ) {
    	        $("#pImage").attr("src",imgSrc.substring(0,imgSrc.length -6)+"_g.jpg") ;
	       } else if ( $(this).attr("id") == "pColorPattern" ) {
	            $("#pImage").attr("src",imgSrc.substring(0,imgSrc.length -6)+"_p.jpg") ;
	       } else if ( $(this).attr("id") == "pColorSilver" ) {
	            $("#pImage").attr("src",imgSrc.substring(0,imgSrc.length -6)+"_s.jpg") ;
	       }
          } 
	 });
	 $(".pColorItem").mouseout(function(){
	    $("#pImage").attr("src",selImage);
	 });
*/
	 $(".pColorItem").click(function(){
	    var imgSrc = $("#pImage").attr("src");
	    
	    if (imgSrc.indexOf("_r.jpg")>0 || imgSrc.indexOf("_b.jpg")>0 || imgSrc.indexOf("_g.jpg")>0 || imgSrc.indexOf("_p.jpg")>0 || imgSrc.indexOf("_s.jpg") > 0 || imgSrc.indexOf("_y.jpg") > 0) {
	       if ( $(this).attr("id") == "pColorRed" ) {
	            selImage =imgSrc.substring(0,imgSrc.length -6)+"_r.jpg";
	       } else if ( $(this).attr("id") == "pColorBlue" ) {
	            selImage =imgSrc.substring(0,imgSrc.length -6)+"_b.jpg" ;
	       } else if ( $(this).attr("id") == "pColorGreen" ) {
	            selImage =imgSrc.substring(0,imgSrc.length -6)+"_g.jpg" ;
	       } else if ( $(this).attr("id") == "pColorPattern" ) {
	            selImage =imgSrc.substring(0,imgSrc.length -6)+"_p.jpg" ;
	       } else if ( $(this).attr("id") == "pColorSilver" ) {
	            selImage =imgSrc.substring(0,imgSrc.length -6)+"_s.jpg" ;
	       }else if ( $(this).attr("id") == "pColorYellow" ) {
	            selImage =imgSrc.substring(0,imgSrc.length -6)+"_y.jpg" ;
	       }
          } 
          $("#pImage").attr("src",selImage) ;
	 });
	 $(".tabIndex").click(function(){
	    var tailer = $(this).attr("id");
	    $("#featuresmenu").removeClass();
	    $(".tabIndex").removeClass("featuressele");
	    $(".tabIndex").addClass("featuresunsel");
	    $(this).removeClass("featuresunsel");
	    $(this).addClass("featuressele");
	    $(".tabContent").removeClass("tabSelected");
	    if ( tailer == "Specification" ) {
            $("#featuresmenu").addClass("featuresmenubg2");
	        $("#tabSpecification").addClass("tabSelected");
	    } else if (tailer == "Gallery") {
	        $("#featuresmenu").addClass("featuresmenubg3");
	        $("#tabGallery").addClass("tabSelected");
	    } else if (tailer == "Accessories") {
	        $("#featuresmenu").addClass("featuresmenubg4");
	        $("#tabAccessories").addClass("tabSelected");
	    } else if (tailer == "Parts") {
	        $("#featuresmenu").addClass("featuresmenubg1");
	        $("#tabParts").addClass("tabSelected");
	    } else if (tailer == "Download") {
	        $("#featuresmenu").addClass("featuresmenubg5");
	        $("#tabDownload").addClass("tabSelected");
	    }
	       
	 });
}

function userLogin()
{
  var frm      = document.forms['loginForm'];
  var username = frm.elements['user'].value;
  var password = frm.elements['password'].value;
  var msg = '';

  if (username.length == 0)
  {
    msg += 'Please enter user.\n';
  }

  if (password.length == 0)
  {
    msg +=  'Please enter password.\n';
  }

  if (msg.length > 0)
  {
    alert(msg);
    return false;
  }
  else
  {
    return true;
  }
}

function editEmail()
{
	 var frm      = document.forms['editForm'];
	 var newemail = frm.elements['newemail'].value;
	 var msg = '';

	  if (newemail.length == 0)
	  {
	    msg += 'Please enter new email address.\n';
	  }

	  if (msg.length > 0)
	  {
	    alert(msg);
	    return false;
	  }
	  else
	  {
	    return true;
	  }
}
