
// Higher Sites CRIR
function docheckboxes() {
	var checkboxes = $$('input.hsreplace');		
	checkboxes.each(function(element) {		
		element.addEvent('click', docheckboxes);
		element.setProperty('class','hs_hidden');			
		if(element.checked) {
			$E('label[for='+element.id+']').setProperty('class','hs_checked');			
		} else {
			$E('label[for='+element.id+']').setProperty('class','hs_unchecked');			
		}
	})	
}



window.addEvent('domready', function() {

	docheckboxes();
	
	if($('clothingtab') && $('industrytab')) {
	
		// Initialize the cookie
		var HashCookie = new Hash.Cookie('HashCookie',{path: "/"},{duration: 1});
		
		// Set the active tab variable
		if (HashCookie.get('activetab')) {
			var theactivetab = HashCookie.get('activetab');
		} else {
			var theactivetab = 'clothingtab'
		}	
		
		// Hide all tabs
		$('clothingtab').setStyle('display', 'none');	
		$('industrytab').setStyle('display', 'none');
		
		//  Set the activetab
		$(theactivetab).setStyle('display','block');	
		
		// Add onclicks to the tab headers
		$('clothinglink').addEvent('click', function() {
			$('industrytab').setStyle('display','none');	
			$('clothingtab').setStyle('display','block');	
			HashCookie.set('activetab', 'clothingtab');
		})
		
		// Add onclicks to the tab headers
		$('industrylink').addEvent('click', function() {
			$('clothingtab').setStyle('display','none');	
			$('industrytab').setStyle('display','block');			
			HashCookie.set('activetab', 'industrytab');
		})
	
	}


})

function jumpMail(user,domain){
		locationstring = "mailto:" + user + "@" + domain;
		window.location = locationstring;
		
}
