function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=700,height=300,left=300,top=200,screenX=300,screenY=200,scrollbars=yes,location=no');
return false;
}

$(document).ready(function()
{
	 $("a[rel=proof]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'overlayColor'		:'#000', 
				'overlayOpacity' 	: '0.6'
				
			});
			
	$("a[rel=selection]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'overlayColor'		:'#000', 
				'overlayOpacity' 	: '0.6'
			});
			
	$('#feature-content')
		  .anythingSlider({
		   autoPlay            	: true, 
		   width               	: 650,
		   height              	: 215,
		   buildArrows         	: false,
		   startStopped        	: false,
		   buildNavigation     	: false,
		   enablePlay          	: false,
		   delay               	: 8000,
		   animationTime       	: 1300,
		   easing				: 'easeInOutExpo',
		   onSlideComplete : function(slider){
			  if(slider.currentPage == 1){
				  	$("#feature-btn-2").removeClass('on-feature');
					$("#feature-btn-2").addClass('promo-btn');
					
					$("#feature-btn-1").addClass('on-feature');
					$("#feature-btn-1").removeClass('promo-btn');
					
					$("#feature-btn-3").removeClass('on-feature');
					$("#feature-btn-3").addClass('promo-btn');
			  }
			  if(slider.currentPage == 2){
				  	$("#feature-btn-1").removeClass('on-feature');
					$("#feature-btn-1").addClass('promo-btn');
					
					$("#feature-btn-2").addClass('on-feature');
					$("#feature-btn-2").removeClass('promo-btn');
					
					$("#feature-btn-3").removeClass('on-feature');
					$("#feature-btn-3").addClass('promo-btn');
			  }
			  if(slider.currentPage == 3){
				  	$("#feature-btn-1").removeClass('on-feature');
					$("#feature-btn-1").addClass('promo-btn');
					
					$("#feature-btn-3").addClass('on-feature');
					$("#feature-btn-3").removeClass('promo-btn');
					
					$("#feature-btn-2").removeClass('on-feature');
					$("#feature-btn-2").addClass('promo-btn');
			  }
			 }
		});
	
	
	$("#feature-btn-2").removeClass('on-feature');
	$("#feature-btn-2").addClass('promo-btn');
					
	$("#feature-btn-1").addClass('on-feature');
	$("#feature-btn-1").removeClass('promo-btn');
					
	$("#feature-btn-3").removeClass('on-feature');
	$("#feature-btn-3").addClass('promo-btn');
		
	$("#feature-btn-1").click(function(){
		$('#feature-content').anythingSlider(1, function(slider){ });
		return false;
	});
	$("#feature-btn-2").click(function(){
		$('#feature-content').anythingSlider(2, function(slider){ });
		return false;
	});
	$("#feature-btn-3").click(function(){
		$('#feature-content').anythingSlider(3, function(slider){ });
		return false;
	});
});

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

var timeout         = 100;
var closetimer		= 0;
var ddmenuitem      = 0;


// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 
