
//home page slider
	$(document).ready(function(){
		$('#slider_area').cycle({ 
			fx:	 'fade',
			timeout: 10000,
			speed: 1500, 
			pager: '#numbers', 
			cleartype:  1,
			pauseOnPagerHover: 1,
			autostop: 1,
			autostopCount: 13,
			pagerAnchorBuilder: function(idx) {
				if (idx == 0) return '<a href="#"><span>Intro</span></a>';
				else if (idx == 1) return '<a href="#"><span>Free Quote</span></a>';
				else if (idx == 2) return '<a href="#"><span>Resources</span></a>';
			} 
		});
	});

//footer ticker
	$(document).ready(function(){
		$('#ticker ul').cycle({ 
			fx:     'scrollUp',
			easing: 'easeout',
			timeout: 5000,
			speed: 1000, 
			cleartype:  1,
			containerResize: 1,
			pause: 1
		});
	});
	
//alternative method for ticker, with pager arrows
	$(document).ready(function(){
	// 'scrollVert' functionality for ticker fn
	(function($) {
		$.fn.cycle.transitions.scrollVert = function($cont, $slides, opts) {
		    $cont.css('overflow','hidden');
		    opts.before.push(function(curr, next, opts, fwd) {
		        $(this).show();
		        var currH = curr.offsetHeight, nextH = next.offsetHeight;
		        opts.cssBefore = fwd ? { top: -nextH } : { top: nextH };
		        opts.animIn.top = 0;
		        opts.animOut.top = fwd ? currH : -currH;
		        $slides.not(curr).css(opts.cssBefore);
		    });
		    opts.cssBefore = { top: 0 };
		    opts.cssAfter = { display: 'none' }
		};

	})(jQuery);

	$('#ticker1 ul').cycle({ 
	    fx: 'scrollVert',
		speed: 750,
		rev: true,
		timeout: 11000,
		next:   '#ticker1 ol li.next', 
	    prev:   '#ticker1 ol li.previous',
	    containerResize: 1
		});
	});


//cufon fonts
	$(document).ready(function(){
		Cufon.replace('h1,h2,h3,h4,h5,h6,.top_slogan', {hover: true});
//		Cufon.replace('h1', {textShadow: '#333 1px 1px'});
	});

//navigation
	$(document).ready(function(){
			ddsmoothmenu.init({
				mainmenuid: "dropdown_menu", //menu DIV id
				orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
				classname: 'dropdown', //class added to menu's outer DIV
				//customtheme: ["#1c5a80", "#18374a"],
				contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
			})
 	});

//image effects 
	$(document).ready(function(){
			var image_e= $(".image.portfolio, .image.product_image, .image.event_image");
			image_e.mouseover(function(){$(this).stop().animate({opacity:0.4}, 400);
			}).mouseout(function(){
				image_e.stop().animate({opacity:1}, 400 );
			});
	});

//product tabs
	$(document).ready(function(){
			var tabs= $("#tabs ul li");
			var content = $("#tabs #content");
			var kids = content.children();
			kids.attr("style","display:none;");
			$("#tabs #content #first").attr("style","display:block;");
			tabs.click(
				function(){
						var show=$(this).attr("title");
						//change clicked tab class
						$("#tabs ul li").removeClass("active");
						$(this).addClass("active");
						//view clicked tab content
						kids.attr("style","display:none;");
						content.slideUp(100);
					$(function(){
							content.slideDown(400);
							$("#"+show+"").attr("style","display:block;");
					});
				}
			);
	});

//faq page
	$(document).ready(function(){
		$('.faqItem p').hide();
		$('.readmore').toggle(function(){
			var $this = $(this);
			$this.parents('.faqItem').children('p').slideDown('normal');
			$this.text('[-]');
		}, function(){
			var $this = $(this);
			$this.parents('.faqItem').children('p').slideUp('normal');
			$this.text('[+]');
		});
		
		//show-hide all answers toggle
		$('.show_all').toggle(function(){
			var $this = $(this);
			$('.faqItem p').show();
			$this.text('Hide all answers').css({'cursor' : 'pointer', 'text-decoration' : 'underline', 'display' : 'inline'});
			$('.readmore').toggle();
		}, function(){
			var $this = $(this);
			$('.faqItem p').hide();
			$this.text('Show all answers').css({'cursor' : 'pointer', 'text-decoration' : 'underline', 'display' : 'inline'});
			$('.readmore').toggle();
			return false;
		});
		
	});

//Career page Jobs Table
	$(document).ready(function(){
		$('.jobItem p, .jobItem ul').hide();
		$('.readmore').toggle(function(){
			var $this = $(this);
			$this.parents('.jobItem').children('p, ul').slideDown('normal');
			$this.text('[-]');
		}, function(){
			var $this = $(this);
			$this.parents('.jobItem').children('p, ul').slideUp('normal');
			$this.text('[+]');
		});
		
	//show-hide all job details toggle
		$('.show_jobs').toggle(function(){
			var $this = $(this);
			$('.jobItem p, .jobItem ul').show();
			$this.text('Hide all job details').css({'cursor' : 'pointer', 'text-decoration' : 'underline', 'display' : 'inline'});
			$('.readmore').toggle();
		}, function(){
			var $this = $(this);
			$('.jobItem p, .jobItem ul').hide();
			$this.text('Show all job details').css({'cursor' : 'pointer', 'text-decoration' : 'underline', 'display' : 'inline'});
			$('.readmore').toggle();
			return false;
		});
	
	});

//Topic Expand and Collapse
	$(document).ready(function(){
		
		//hide topic_body to begin with
		$('.topic_list .topic_body').hide();
		
		//toggle topic_body
		$('.topic_head').click(function(){
			$(this).next('.topic_body').slideToggle(500)
			return false;
		});
		
	});

//Topic Expand and Collapse - PR
	$(document).ready(function(){
		
		//hide topic_body to begin with
		$('.topic_list .topic_body').hide();
		
		//toggle topic_body
		$('.topic_headPR').click(function(){
			$(this).next('.topic_body').slideToggle(500)
			return false;
		});
		
	});
		

