﻿////////////////////////////////////// MAIN PAGE NEWS FLASH-PRODUCTS TABS
function productDisplay ()
{
 	document.getElementById("news-flash-div").style.display = "none";
	document.getElementById("p-select-hold").style.display = "block"
}

function newsDisplay ()
{
	document.getElementById("p-select-hold").style.display = "none";
	document.getElementById("news-flash").style.display = "block"
}
//////////////////////////////////////


////////////////////////////////////// BG HOLDER RESIZER
function resize()
{  
	var frame = document.getElementById("ctl00_bg_holder");
	var htmlheight = document.body.parentNode.scrollHeight;
	var windowheight = 0;
	if( typeof( window.innerWidth ) == 'number' ) 
	{
		windowheight = window.innerHeight;
	}
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
	{
	//IE 6+ in 'standards compliant mode'
		windowheight = document.documentElement.clientHeight;
	}
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
	{
	//IE 4 compatible
		windowheight = document.body.clientHeight;
	}
	if ( htmlheight < windowheight ) 
	{
		frame.style.height = windowheight + "px"; frame.style.height = windowheight + "px";
	}
	else 
	{
		frame.style.height = htmlheight + "px"; frame.style.height = htmlheight + "px";
	}
}
//////////////////////////////////////


////////////////////////////////////// FORM NUMERIC CHECK
function CheckNumeric(e)
{
	var keynum;
	var keychar;
	var numcheck;

	if(window.event) // IE
	{
		keynum = e.keyCode;
	}
	else if(e.which) // Netscape/Firefox/Opera
	{
		keynum = e.which;
	}
	
	keychar = String.fromCharCode(keynum);
	
	numcheck = /[0-9]/;
	return numcheck.test(keychar) || keynum == 8;
}
//////////////////////////////////////


////////////////////////////////////// DARK GREY ACCORDION
$(function() 
{
	$(".accordion p").hide();
	//$(".accordion h4:first").addClass("active");
 
	$(".accordion h4").click(function(){
		$(this).next("p").slideToggle("fast")
		.siblings("p:visible").slideUp("fast");
		$(this).toggleClass("active");
		$(this).siblings("h4").removeClass("active");
	});	
});
//////////////////////////////////////


//////////////////////////////////////  LIGHT GREY ACCORDION
$(function() 
{
	$(".accordion-lg p:not(:first)").hide();
	$(".accordion-lg h4:first").addClass("active");
 
	$(".accordion-lg h4").click(function(){
		$(this).next("p").slideToggle("fast")
		.siblings("p:visible").slideUp("fast");
		$(this).toggleClass("active");
		$(this).siblings("h4").removeClass("active");
	});
});
//////////////////////////////////////


//////////////////////////////////////  LIGHT GREY ACCORDION 2
$(function() 
{
	$(".accordion-lg2 div").hide();
 
	$(".accordion-lg2 h4").click(function(){
		$(this).next("div").slideToggle("fast")
		.siblings("div:visible").slideUp("fast");
		$(this).toggleClass("active");
		$(this).siblings("h4").removeClass("active");
	});
});
//////////////////////////////////////


//////////////////////////////////////  TAB SYSTEM
$(function () {
	var tabContainers = $('div.Ltabs > div');
	tabContainers.hide().filter(':first').show();
	
	$('div.Ltabs ul.tabNavigation a').click(function () {
		tabContainers.hide();
		tabContainers.filter(this.hash).show();
		$('div.Ltabs ul.tabNavigation a').removeClass('selected');
		$(this).addClass('selected');
		return false;
	}).filter(':first').click();
});
//////////////////////////////////////


////////////////////////////////////// VIDEO TAB SYSTEM
/*$(function () {
	var tabContainers = $('div.Vtabs > div');
	tabContainers.hide().filter(':first').show();

	$('div.Vtabs ul.tabNavigationVid a').click(function () {
		tabContainers.hide();
		tabContainers.filter(this.hash).show();
		$('div.Vtabs ul.tabNavigationVid a').removeClass('selected');
		$(this).addClass('selected');
		$('html, body').animate({ scrollTop: 0 }, "slow");
		return false;
	}).filter(':first').click();
});*/
//////////////////////////////////////


////////////////////////////////////// ZEBRA TABLE SYSTEM
$(function () {
	$(".lassaTable tr").mouseover(function() {
		$(this).addClass("tableOver");
	}).mouseout(function() {
		$(this).removeClass("tableOver");
	});
});
$(function () {
	$(".lassaTable tr:odd").addClass("tableOdd");
});

$(function () {
	$(".lassaTable2 tr").mouseover(function() {
		$(this).addClass("tableOver");
	}).mouseout(function() {
		$(this).removeClass("tableOver");
	});
});
$(function () {
	$(".lassaTable2 tr:odd").addClass("tableOdd");
});

$(function () {
	$(".lassaTableInline tr").mouseover(function() {
		$(this).addClass("tableOver");
	}).mouseout(function() {
		$(this).removeClass("tableOver");
	});
});
$(function () {
	$(".lassaTableInline tr:odd").addClass("tableOdd");
});
//////////////////////////////////////


////////////////////////////////////// WTF!?
$(function() {
    $(".by-car ul li select")
        .mouseover(function(){
            $(this)
                .data("origWidth", $(this).css("width"))
                .css("width", "auto");
        })
        .mouseout(function(){
            $(this).css("width", $(this).data("origWidth"));
        });
});
//////////////////////////////////////


////////////////////////////////////// SIDEBAR SLIDER
var sidebar;
var floatersub;
var LinkerRand = 0;
var old = LinkerRand;


function initslider()
{
	sidebar = new getObj('sidebar');
	movesidebar();
}


function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
	this.obj = getObjNN4(document,name);
	this.style = this.obj;
  }
}


function movesidebar()
{

	if (document.documentElement && document.documentElement.scrollTop)
	{	lassascroller = document.documentElement.scrollTop}
	
	else if (document.body)		// IE
	{	lassascroller = document.body.scrollTop}

	if (lassascroller < LinkerRand) lassascroller = LinkerRand;
	else lassascroller += 0;

	if (lassascroller != old)
	{
		lassascroller = (.1 *(lassascroller-old))+old;
		sidebar.style.top = lassascroller + "px";
	}
	
	old = lassascroller;
	temp = setTimeout('movesidebar()',10);
}
//////////////////////////////////////

