// JavaScript Document
// clickdown block
function showLinks(n){
    var el=document.getElementById(n);
    var p=el.parentNode;
    for(var i=0;i<p.childNodes.length;i++){//check all of n's siblings (n's parent's childen)
        if(p.childNodes[i].style && p.childNodes[i].style.display=='block'){//find who is displaying
            p.childNodes[i].style.display='none';
            if(p.childNodes[i]==el) return;//remove this line to remove toggling action
            break;
        }
    }
    el.style.display='block'
}
// end clickdown block

// clickdown with pic
function nextNode(e) {
 return ((e && e.nodeType != 1) ? nextNode(e = e.nextSibling) : e);
}
function blockShowHide(nObj) {
 with(nObj) {
  className = (className == 'tooltip2') ? 'tooltip2 opened':'tooltip2';
 }
 tObj=nextNode(nObj.nextSibling);
 //alert(tObj);
 with(tObj) {
  className = (className == 'fullText show') ? 'fullText hide':'fullText show';
 }
 nObj.blur();
}
// clickdown with pic

(function($) {

// carousel
	$(document).ready(function($) {
		$(".default .jCarouselLite").jCarouselLite({
			btnNext: ".default .next",
			btnPrev: ".default .prev",
			speed: 1600,
	        visible: 2,
			start: 0,
			scroll: 2
		});
	});
// end carousel

// lightbox
    $(function() {
        $('ul.hosting-gallery li a').lightBox();
    });
// end lightbox
		  
// menu
	$(document).ready(function(){
		jqueryslidemenu.buildmenu("main-menu-line", arrowimages)
	});
// end menu
// png fix
//	$(document).ready(function(){ 
//		$(document).pngFix(); 
//	}); 
// end png fix

// clickdown
	$(document).ready(function($) {
		$('a.clickdown').each(function() {
			var $this = $(this);
			var index = $this.attr('id').match(/(\d+)$/, '');
			var number = parseInt(index[1]);
			$this.click(function() {
				$('#slickbox' + number).slideToggle(400);
				$this.toggleClass('opened').blur();
				return false;
			});
		});
	});
// end clickdown

// header slideshow
	var $picbox = null;
	$(function(){
		$picbox = $('#picbox').innerfade({
			speed: 'slow',
			timeout: 5000,
			type: 'sequence',
			containerheight: '304px',
			controls: '.pic-button'
		});
	});
// end header slideshow

// tabs
$(document).ready(function(){
	$("#menu > ul, .planstab > ul, .landingtab > ul").tabs();
});
// end tabs

// tooltip
$(document).ready(function(){
  $('a.tooltip-bull').tooltip({
	track: true,
	delay: 100,
	showBody: '::',
	showURL: false,
	opacity: 0.85,
	bodyHandler: function() {
        var data = $.metadata.get(this);
        return '<div class="tooltip-box">' + data.tooltip + '</div>';
    }
  });
});
// end tooltip

})(jQuery);


