//-----------------------------------------------------------------------------------
//Sub Tabs
//-----------------------------------------------------------------------------------
$(function() {
	// :first selector is optional if you have only one tabs on the page
	$("ul.subtabs").tabs("div.subpanes > div");
});


//-----------------------------------------------------------------------------------
// Right Accordian
//-----------------------------------------------------------------------------------
$(function() {

$("#accordion").tabs("#accordion div.pane", {
	tabs: 'h1', 
	effect: 'slide'
});
});

//-----------------------------------------------------------------------------------
//Home Page Scrollable
//-----------------------------------------------------------------------------------
$(function() {

	// initialize scrollable
	$("div.scrollable").scrollable({

		// items are auto-scrolled in 2 secnod interval
		interval: 7500,

		// when last item is encountered go back to first item
		loop: true,

		// make animation a little slower than the default
		speed: 600,

		size: 1,

		// when seek starts make items little transparent
		onBeforeSeek: function() {
			this.getItems().fadeTo(300, 0.2);
		},

		// when seek ends resume items to full transparency
		onSeek: function() {
			this.getItems().fadeTo(300, 1);
		}
	});

});

//-----------------------------------------------------------------------------------
//Create target='_blank' links
//-----------------------------------------------------------------------------------
var objLinks = document.getElementsByTagName('a');

for (var iCounter=0; iCounter<objLinks.length; iCounter++)
    if (objLinks[iCounter].getAttribute('href') &&
        objLinks[iCounter].getAttribute('rel') == 'external')
            objLinks[iCounter].setAttribute('target', '_blank');
            
