$(document).ready(function() {

	/* This is basic - uses default settings */
	
	$("a[rel^='lightbox']").fancybox();
	$("a[rel^='lightbox-single']").fancybox();
	
	/* Using custom settings 
		'easingIn': 'easeInExpo',
		'zoomSpeedIn':		200,
		'zoomSpeedOut':		200,
		'easingOut': 'easeOutExpo',
		'easingChange': 'easeInOutExpo',
		'overlayOpacity': .8
	*/
	
	$("a[rel^='lightbox'] img").qtip({
		content: 'Click to enlarge +',
		show: 'mouseover',
		hide: 'mouseout',
		api: {
      onRender: function()
      {
         // Assign submit event to hide the tooltip (Optionally change the target also)
         $(this.options.hide.when.target).bind('click', this.hide) ;
      }
   },
		position: {corner: {target: 'topMiddle',tooltip: 'bottomMiddle'}},
		style: {name: 'dark',tip: 'bottomMiddle',border: {width: 4,radius: 0,color: '#888'},background: '#F9E98E',color: 'black'}
	});
	
	$(".sales-map").fancybox({
		'hideOnContentClick': false,
		'frameWidth': 400,
		'frameHeight': 294
	});
	
	$(".pad-cleaning-info").fancybox({
		'hideOnContentClick': false,
		'frameWidth': 680,
		'padding': 10,
		'frameHeight': 600
	});
	
	$(".video-box").fancybox({
		'hideOnContentClick': false,
		'frameWidth': 425,
		'frameHeight': 392
	});

	$('a[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });

isIE6 = /MSIE 6/.test(navigator.userAgent);
if (isIE6 = true) {
$("#navmenu-h li,#navmenu-v li").hover(
    function() { $(this).addClass("iehover"); },
    function() { $(this).removeClass("iehover"); }
  );
}

	/*$("a.group").fancybox({
		'zoomSpeedIn':		300, 
		'zoomSpeedOut':	300, 
		'overlayShow':		false
	});;*/
	
			var current = -1;
			var elems = new Array();
			var elems_i = 0;
			$('.ticker-items').each(function() {
				elems[elems_i++] = $(this);
			});
			var num_elems = elems_i - 1;
			if (elems.length >0) {
			var animate_out = function() {
				elems[current].animate({ top: '-40px' }, 'fast', 'linear', animate_in);
			}
			var animate_out_delay = function() {
				setTimeout(animate_out, 4500); /****************************** Change 1000 to make it longer/shorter/whatever */
			}
			var animate_in = function() {
				current = current < num_elems ? current + 1 : 0;
				elems[current].css('top', '200px').animate({ top: '0px' }, 'fast', 'linear', animate_out_delay);
			}
			animate_in();
			}
});

function pricequote ( selectedtype ) {
var form = document.createElement("form");
form.setAttribute("method", "post");
form.style.display = "none"
form.setAttribute("action", "/contact/price-quote/");
form.setAttribute("target", "formresult");
var hiddenField = document.createElement("input");              
hiddenField.setAttribute("name", "machineType");
hiddenField.style.display = "none"
hiddenField.setAttribute("value", selectedtype);
form.appendChild(hiddenField);
document.body.appendChild(form);
form.submit();
};