﻿jQuery(document).ready(function($) {

	$('#header a.hTitle').hover(
        function() {
			
            $('span#logobar').stop(false, true).css({ 'opacity': '0', 'width': '0px' });
            //$(this).find("span").stop(false, true).css({ 'background-color': 'blue' });
    
            $(this).find("span").animate({
                opacity: 1,
                width: '100%'
            }, 500, function() {
                // Animation complete.
            });
            
        },
        function() {
            //$(this).find("span").stop(false, true).css({ 'background-color': 'red' });
            $(this).find("span").stop(false, true).css({ 'opacity': '0', 'width': '0%' });
            $('span#logobar').animate({
                opacity: 1,
                width: '42px'
            }, 500, function() {
                // Animation complete.
            });
        });
		

    $('#header a.hTitle').hover(
        function() {
			
            $('span#logobar').stop(false, true).css({ 'opacity': '0', 'width': '0px' });
            //$(this).find("span").stop(false, true).css({ 'background-color': 'blue' });
    
            $(this).find("span").animate({
                opacity: 1,
                width: '100%'
            }, 500, function() {
                // Animation complete.
            });
            
        },
        function() {
            //$(this).find("span").stop(false, true).css({ 'background-color': 'red' });
            $(this).find("span").stop(false, true).css({ 'opacity': '0', 'width': '0%' });
            $('span#logobar').animate({
                opacity: 1,
                width: '42px'
            }, 500, function() {
                // Animation complete.
            });
        });


    // Header UL lists
    $('#header ul.hWrap li.top-list').mouseover(function() {
		$(this).addClass('hover');
    }).mouseout(function() {
		$(this).removeClass('hover');    
	});	
	
	// Header DropDown UL lists
	$('#header ul.hSubwrap li').mouseover(function() {
		$(this).addClass('hover');
    }).mouseout(function() {
		$(this).removeClass('hover');    
	});	
	

    $('input.btn_submit').hover(
        function() {
            var img = $(this).attr('src');
            img = img.replace(/submit_1.jpg/i, "submit_2.jpg");
            $(this).attr('src', img);
        }, function() {
            var img = $(this).attr('src');
            img = img.replace(/submit_2.jpg/i, "submit_1.jpg");
            $(this).attr('src', img);
        }
    );

    $('div#dd_allvehicles ul li a').hover(
        function() {
            var img = $(this).children('img').attr('src');
            img = img.replace(/_1.jpg/i, "_2.jpg");
            $(this).children('img').attr('src', img);
        }, function() {
            var img = $(this).children('img').attr('src');
            img = img.replace(/_2.jpg/i, "_1.jpg");
            $(this).children('img').attr('src', img);
        }
    );

    $('input.btn_input').hover(
        function() {
            var img = $(this).attr('src');
            img = img.replace(/_1/i, "_2");
            $(this).attr('src', img);
        }, function() {
            var img = $(this).attr('src');
            img = img.replace(/_2/i, "_1");
            $(this).attr('src', img);
        }
    );

    // forOwner, corporateInfo, financingInsurance
    $('a.btn_pagination').click(function() {
        $('a.current').removeClass('current');
        $(this).addClass('current');
        var panelID = $(this).attr('id');
        $('.subPanel').hide();
        $('#' + panelID).show();
    });

});

    function showFeature(cate, listIndex, panel, url, index) {

        //show correct top list index
        $('ul.VUC-node-list li').each(function(i) {
            $(this).children('a').removeClass('current');
        });
        $('ul.VUC-node-list li').eq(listIndex).children('a').addClass('current');

        //show and trigger correct hashpage
        parent.location.hash = cate;

        showPanel(panel, url, index);
    }

    function swapImg(img_name, img_src) {
        document[img_name].src = img_src;
    }
    

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-19823195-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();




  

