function radioME(){
uncheckALL("j",2)
arguments[0].checked=true
return true
}

function uncheckALL(){
var currentId=0;
for(currentId=0;currentId<arguments[1];currentId++){
document.getElementById(arguments[0]+currentId).checked=false
}
}

// switch alt image view
function changeImage(img) {
 var imageName;
 for (i = 1; i <= 9; i++) {
  imageName = "image" + i; 
  if (document.getElementById(imageName)) {
   document.getElementById(imageName).style.display='none';
  }
 }
 document.getElementById(img).style.display='block';
}

// mss-image-box
$(document).ready(function() {

	$(".mss-image-view .desc").show();
	$(".mss-image-view .block").animate({ opacity: 0.85 }, 1 );

	$(".mss-sidebar ul li:first").addClass('active');
	$(".mss-sidebar ul li").click(function(){

		var imgAlt = $(this).find('img').attr("alt");
		var imgTitle = $(this).find('a').attr("href");
		var imgDesc = $(this).find('.block').html();
		var imgDescHeight = $(".mss-image-view").find('.block').height();

		if ($(this).is(".active")) {
			return false;
		} else {
			$(".mss-image-view .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 0 , function() {
				$(".mss-image-view .block").html(imgDesc).animate({ opacity: 0.85,	marginBottom: "0" }, 0 );
				$(".mss-image-view img").attr({ src: imgTitle , alt: imgAlt});
			});
		}

		$(".mss-sidebar ul li").removeClass('active');
		$(this).addClass('active');
		return false;

	}) .hover(function(){
		$(this).addClass('hover');
		}, function() {
		$(this).removeClass('hover');
	});

	$("a.collapse").click(function(){
		$(".mss-image-view .block").slideToggle();
		$("a.collapse").toggleClass("show");
	});
	
   $('.mss-sidebar ul li').each(function(ind, el){
      var timeInterval = 3000;
      setTimeout(function(){setInterval(function(){$(el).click();},timeInterval * 4)},ind * timeInterval);
      
	});
	
	

});

// Display Tabs
function changeDisplaySetup(){
	if (document.getElementById('t1'))
  {
  changeDisplay('t1', 'u1');
  }
else
  {
  changeDisplay('t2', 'u2');
  }

}

function changeDisplay(onid, ontab) {
	var onID = document.getElementById(onid);
	var onTab = document.getElementById(ontab);
	for (i = 1; i < 8; i++) {
		key = 't' + i;
		if (document.getElementById(key) !== null) {
			document.getElementById(key).style.display = 'none';
		}
		key = 'u' + i;
		if (document.getElementById(key) !== null) {
			document.getElementById(key).className = 'mss-tab';
		}

	}

	if (onID) { onID.style.display = 'block'; }
	if (onTab) { onTab.className= 'mss-tab-on'; }

}
changeDisplaySetup();

function bookmark(url,title){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } else if (window.sidebar && window.sidebar.addPanel) {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}







