//**********************************************************************************************************************
/**
* COMPANY: Zipline Interactive
* EMAIL: infon@gozipline.com
* PHONE: 509-321-2849
* DESCRIPTION: This document contains programming required for the website templates.  Requires the jQuery library.
*/
//***********************************************************************************************************************

//***********************************************************************************************************************
//ON DOCUMENT READY FUNCTIONS
//***********************************************************************************************************************
$(function() {
	
	
	
	speed = 1200;
	container = $('#carousel');
	next = $('#product_right');
	prev = $('#product_left');
	scrolls = 4;
	
	if ($('#features').length > 0) {
		$('#features').children().hide();
		$('#features').children().eq(0).show();
		container.children().eq(0).addClass('activated');
	}
	
	zCarousel(speed, container, scrolls, prev, next);	//Reversed the arrows
	//zCarousel(speed, container, scrolls, next, prev);
	
	$("#topsquare").hover(function()  {
		$("#top").animate({width: 'toggle'});
	})
	
	$("#midsquare").hover(function()  {
		$("#mid").animate({width: 'toggle'});
	})
	
	$("#botsquare").hover(function()  {
		$("#bot").animate({width: 'toggle'});
	});
	/*$(".vert").each(function() {
		var height_this = $(this).height();
		//alert(height_this);
		var height_parent = $(this).parent().height();
		
		//Math to deetermine where (this) should be placed based on css:top
		var top = (height_parent - height_this) / 2;
		$(this).css('padding-top', top);
	});*/
	
	$('.dropped a').css('font-size', '10px');
	$('.dropped a').css('line-height', '12px');
});

function sliderClick(container, reference) {
	$(container.children()).removeClass('activated');
	var id = reference.attr('title');
	$('#features').children().hide();
	$('#p' + id).show();
	reference.addClass('activated');

	var pdf = $('.datasheetpdf' + id).attr('title');
	var url = 'http://www.purcellsystems.com/core/files/purcellsystems/products/';
	$('#datasheet').attr('href', url + pdf);
	
	var uri = 'http://www.purcellsystems.com/request-a-quote/?referrer=' + id + '&id=product';
	$('#requestquotebutton').attr('href', uri);	
}

