var tabs=0;
var tabmenu=Array();
$(document).ready(function(){
//Accordian menu
$( '#main_menu' ).msAccordion({defaultid:openaccord});//defaultid,autodelay,vertical,event
//Image Slideshow
$('#slideshow').mbMaskGallery({
	type:"normal",
        galleryMask:base+"css/images/RSI_BlueOverlay.png",
        galleryUrl:"",
        galleryColor:"white",
        galleryLoader:base+"images/loader/ajax-loader_white.gif",
        galleryWidth:735,
	galleryHeight:155,
        imagePosition:"center center",
        loaderOpacity:1,
        showDescription:false,
        loader:true,
        fadeTime: 5000,
        slideTimer: 30000
})
//fancybox
$('.fancy').live("click",function() {return fancy(this);});
//sitemap
$('#ctrl_sitemap').bind('click',function(){toggle_hide('.sitemap_ctrl');});

	$('.set > .title').each(function(index){
$(this).attr("onclick","document.location.href=$(this).find('a').attr('href')");
});	
});
function fancy(source){
	var options=({	'width'             : 1024,
	        	'height'            : 700,
	        	'autoScale'         : false,
	        	'transitionIn'      : 'none',
	        	'transitionOut'     : 'none',
	        	'type'              : 'iframe',
	       		'href'		    : source.getAttribute('href')
 		});
	if(source.getAttribute('js_fancy'))
	{
		$.extend(options,eval(source.getAttribute('js_fancy')));
	}
	$.fancybox(options);
	return false;
}
function q_search(source){
	document.location=$(source).attr('action') + '#t=Match&v='+ $('#quick_search').val();
	return false;
}
function toggle_hide(target){
	$(target).each(function(index){

	if ($(this).is('.hide'))
		$(this).removeClass('hide')
	else
		$(this).addClass('hide');
				
	});
}
function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}
function setDefault(el) {
  if (el.value== '') el.value = el.defaultValue
}
