function horizontalTab()
{
       //Begin code for For tabs

	//When page loads...

	$(".tab_content").hide(); //Hide all content

	$("ul.tabs li:first").addClass("active").show(); //Activate first tab

	$(".tab_content:first").show(); //Show first tab content



	//On Click Event

	$("ul.tabs li").click(function() {



		$("ul.tabs li").removeClass("active"); //Remove any "active" class

		$(this).addClass("active"); //Add "active" class to selected tab

		$(".tab_content").hide(); //Hide all tab content



		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
 
		$(activeTab).fadeIn(); //Fade in the active ID content

		return false;

	}); // end of tabs


}
//end function horizontal tab

function verticalTab()
{
     //When page loads...
	$(".tab_content").hide(); //Hide all content

$("ul.vtabs li:first").after('<li class="arrow" style="width:20px !important;height:auto;border:none;"><img src="http://site.apparelny.com/images/common/arrow_right.gif"></li>');

	$("ul.vtabs li:first").addClass("active").show(); //Activate first tab
        $('.arrow').show(); // Show arrow for first tab
	$(".tab_content:first").show(); //Show first tab content

	//On Hover Event
	$("ul.vtabs li").hover(function() {

		$("ul.vtabs li").removeClass("active"); //Remove "active" class
                $('.arrow').remove(); // Remove the arrow

		$(this).addClass("active"); //Add "active" class to selected tab

         //Add right arrow image to active class
 
              $(this).after('<li class="arrow" style="width:20px !important;height:auto;border:none;"><img src="http://site.apparelny.com/images/common/arrow_right.gif"></li>');

		$(".tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});


}
//end function for vertical tabs


//function for modal windows
function modalWindow()

{
//Begin code for modal window/ppopup

$('a.poplight[href^=#]').click(function() {
    var popID = $(this).attr('rel'); //Get Popup Name
    var popURL = $(this).attr('href'); //Get Popup href to define size

    //Pull Query & Variables from href URL
    var query= popURL.split('?');
    var dim= query[1].split('&');
    var popWidth = dim[0].split('=')[1]; //Gets the first query string value

    //Fade in the Popup and add close button
    $('#' + popID).fadeIn().css({ 'width': Number( popWidth )}).prepend('<li class="close "><a href="#" class="close itlink">Close Window</a>');

    //Define margin for center alignment (vertical   horizontal) - we add 80px to the height/width to accomodate for the padding  and border width defined in the css
    var popMargTop = ($('#' + popID).height() + 80) / 2;
    var popMargLeft = ($('#' + popID).width() + 80) / 2;

    //Apply Margin to Popup
    $('#' + popID).css({
        'margin-top' : -popMargTop,
        'margin-left' : -popMargLeft
    });

    //Fade in Background
    $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
    $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'}) is used to fix the IE Bug on fading transparencies 

    return false;
});

//Close Popups and Fade Layer
$('a.close, #fade').live('click', function() { //When clicking on the close or fade layer...
    $('#fade , .popup_block').fadeOut(function() {
        $('#fade, a.close').remove();  //fade them both out
    });
    return false;
});

}
//end function modalwindow

//code for google analytics 
function googleAnalytics()
{
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-1121945-2']);
  _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);
  })();
}
//end code google analytics
