function changetab(number,totaltabs){
	for(i=0;i<totaltabs;i++){
		var adjusti = i + 1;
		var thisname_tab = "tab" + adjusti;
		var thisname_tabdisplay = "tabsdisplay" + adjusti;

		if(number==adjusti){
			document.getElementById(thisname_tab).setAttribute("class", "tab_on");
			document.getElementById(thisname_tab).setAttribute("className", "tab_on");
			document.getElementById(thisname_tabdisplay).setAttribute("class", "tabdisplay_on");
			document.getElementById(thisname_tabdisplay).setAttribute("className", "tabdisplay_on");
		}
		else{
			document.getElementById(thisname_tab).setAttribute("class", "tab_off");
			document.getElementById(thisname_tab).setAttribute("className", "tab_off");
			document.getElementById(thisname_tabdisplay).setAttribute("class", "tabdisplay_off");
			document.getElementById(thisname_tabdisplay).setAttribute("className", "tabdisplay_off");
		}
	}
}

function changesingle_tab(number,totalsingle_tabs){
	for(i=0;i<totalsingle_tabs;i++){
		var adjusti = i + 1;
		var thisname_single_tab = "single_tab" + adjusti;
		var thisname_single_tabdisplay = "single_tabsdisplay" + adjusti;

		if(number==adjusti){
			document.getElementById(thisname_single_tab).setAttribute("class", "single_tab_on");
			document.getElementById(thisname_single_tab).setAttribute("className", "single_tab_on");
			document.getElementById(thisname_single_tabdisplay).setAttribute("class", "single_tabdisplay_on");
			document.getElementById(thisname_single_tabdisplay).setAttribute("className", "single_tabdisplay_on");
		}
		else{
			document.getElementById(thisname_single_tab).setAttribute("class", "single_tab_off");
			document.getElementById(thisname_single_tab).setAttribute("className", "single_tab_off");
			document.getElementById(thisname_single_tabdisplay).setAttribute("class", "single_tabdisplay_off");
			document.getElementById(thisname_single_tabdisplay).setAttribute("className", "single_tabdisplay_off");
		}
	}
}


function goToUrl(value){
    parent.location.href = 'http://' + value;
}

function startGallery() {
		var myGallery = new gallery($('topstorygallery'), {
		timed: true,
		showCarousel: true,
		carouselElement: true,
		delay: 5000
	});
}
window.addEvent('domready',startGallery);
