
	var sifr_on = 0;
	
	
	if (sifr_on == 1)
	{
		var cochin = {
		src: '/Branches/Sugarfree/Sugarfree/Files/Flash/SIFR/rockwell.swf'
		,ratios: [7, 1.32, 11, 1.31, 13, 1.24, 14, 1.25, 19, 1.23, 27, 1.2, 34, 1.19, 42, 1.18, 47, 1.17, 48, 1.18, 69, 1.17, 74, 1.16, 75, 1.17, 1.16]
		};
		sIFR.activate(cochin);
	}
	
	function showhidedownload(){
		$("#downloads_middle .downloadsLink").unbind('mouseover');
		$("#downloads_right .project_content").hide('fast');
		$("#downloads_right .project_content_init").hide('fast');
		$("#downloads_right #project_content"+$(this).attr('id')).show('blind','slow', function(){
		$('#downloads_middle .downloadsLink').delay(1000).bind('mouseover', showhidedownload);} );
		
		}
		
	function sifr_doreplace(){

		sIFR.replace(cochin, {
		selector: 'h1',
		css: ['.sIFR-root { text-align: left; font-weight: normal; color:#96172e; z-index:10;  }'],
		wmode: 'opaque'
		});
		sIFR.replace(cochin, {
		selector: 'h5',
		css: ['.sIFR-root { text-align: left; font-weight: normal; color:#96172e; z-index:10;  }'],
		wmode: 'opaque'
		});
	}
	
	function framebreakout(href){
		parent.location.href = href;	}
		
	

	$(function() {
		$(".LoginButton, .eform_button > input").val("");

		reinitialiseScrollPane = function()
		{
			$('.project_content_container').jScrollPane({showArrows:false});
			$('.clientarea_middle_container').jScrollPane({showArrows:false});
			//$('.main_content_container').jScrollPane({showArrows:false});
			//$('#main_middle_contact_bottom .eform').jScrollPane({showArrows:false});
		}
	
		$('#main_middle_contact_bottom').bind('click',
			function()
			{
				reinitialiseScrollPane();
			}
		);
	
		$("a").click(function(){
			if (parent.frames.length > 0) {
			framebreakout($(this).attr('href'));
			}
		});
		
		$('.project_content_container').jScrollPane({showArrows:false});
		$('.clientarea_middle_container').jScrollPane({showArrows:false});
		//$('.main_content_container').jScrollPane({showArrows:false});
		//$('#main_middle_contact_bottom .eform').jScrollPane({showArrows:false});
		//$('.project_content_init').jScrollPane();
		//$('.project_content_init').show().jScrollPane().hide();
	
		$(".links tr").mouseover(function(){$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");});
		
		//set effect from select menu value
		$(".projects_link,.projects_link_init").click(function() {
			var options = {percent: 0};
			$("#project_left .projects_link_init").switchClass('projects_link_init','projects_link', 'fast');
			//$("#project_left #"+$(this).attr('id')).toggleClass('projects_link_init', 'fast');
			$("#project_left #"+$(this).attr('id')).switchClass('projects_link','projects_link_init', 'fast');
			$("#project_right .project_details").hide('fast');
			$("#project_right .project_details_init").hide('fast');
			$("#project_middle .project_content").hide('fast');
			$("#project_middle .project_content_init").hide('fast');
			//$("#project_right #"+$(this).attr('id')).show('blind','slow'); 
			//$("#project_middle #"+$(this).attr('id')).show('blind','slow', reinitialiseScrollPane);
			$("#project_right #project_details"+$(this).attr('id')).show('blind','slow'); 
			$("#project_middle #project_content"+$(this).attr('id')).show('blind','slow', reinitialiseScrollPane);
			$("#topmenusub .subMenuNavEffect").removeClass('selected');
			$("#topmenusub #subnav"+$(this).attr('id')).addClass('selected');
			
			if (sifr_on == 1)
			{
				sifr_doreplace();
			}

			return true;
		});
		
		$(".subMenuNavEffect").click(function() {
			var options = {percent: 0};
			$("#project_left .projects_link_init").switchClass('projects_link_init','projects_link', 'fast');
			$("#project_left #"+$(this).attr('id').substring(6)).switchClass('projects_link','projects_link_init', 'fast');
			$("#project_middle .project_content").hide('fast');
			$("#project_middle .project_content_init").hide('fast');
			$("#project_right #project_details"+$(this).attr('id').substring(6)).show('blind','slow'); 
			$("#project_middle #project_content"+$(this).attr('id').substring(6)).show('blind','slow', reinitialiseScrollPane);
			$("#topmenusub .subMenuNavEffect").removeClass('selected');
			$("#topmenusub #subnav"+$(this).attr('id').substring(6)).addClass('selected');
			
			if (sifr_on == 1)
			{
				sifr_doreplace();
			}

			return true;
		});
		
		$("input[type=radio]").click( function() {
			$("input[type=radio]").attr('checked', false);
			this.checked = true;
			$(".searchoptions").css('display','none');
			$("#"+this.value).css('display','block');
		});
		
	});
	
	
	$(document).ready(function(){
		

		
		$('.searchoptions').css("display","none");
		
		if (sifr_on == 1)
		{
			sifr_doreplace();
			$('.main_content').delay(1000).css("display","none", function(){   
			$('.main_content').css("z-index","1");   
			$('.main_content').show('blind','slow', sifr_doreplace);});
			
		}
		else
		{
			//$('.main_content').delay(1000).css("display","none", function(){   
			//$('.main_content').css("z-index","1");   
			//$('.main_content').show('blind','slow');});
			
			$('.main_content').delay(1000).css("display","none");   
			$('.main_content').css("z-index","100");   
			$('.main_content').show('blind','slow');
		}
		
		$('#downloads_middle .downloadsLink').bind('mouseover', showhidedownload);
		
		$('input:checkbox:not([safari])').checkbox();
		$('input[safari]:checkbox').checkbox({cls:'jquery-safari-checkbox'});
		$('input:radio').checkbox();
		
		$('input:checkbox').checkbox({cls:'jquery-safari-checkbox'});
		$('input:radio').checkbox({cls:'jquery-safari-checkbox'});
			
	});

	


	
	

	

	
	

