try{
var x=	$('.detail');
x.click(function(){$(this).children('.ddata').slideToggle();});
x.addClass('detailer').removeClass('detail');
}catch(err){}



function setFontSize(n){
    var x= parseInt(document.body.style.fontSize);
    if(isNaN(x)){x=16;}
    x+=n;
    if( x <= 20 && x >= 12 ){
		document.body.style.fontSize= x+'px';
		cookie('FS',x,99);
    }
}


function zoom(x){
	if(x.big){
		$(x).children().first().animate( {height: '200px',width:'200px'}, {easing:'swing',duration: 'fast'} ).css({marginRight:''});
		x.big=0;
	}else{
		$(x).children().first().animate( {height: '480px',width:'480px'}, {easing:'swing',duration: 'fast'} ).css({marginRight:'0px'});
		x.big=1;
	}
	return false;
}

function notEmpty(o){
	o=	$('#'+o)[0];
	//hack in out of stock
	if( o && typeof(o.value) != 'undefined' && o.value == 'outofstock'  ){
		alert('Sorry, this item is out of stock.');
		return false;
	}
	if( o && typeof(o.value) != 'undefined' && o.value != ''){
		return true;
	}
	alert('Empty '+ ((o && o.title)? o.title:'form field') );
	return false;
}

function offsetScroll(){
	var x=	$(this).attr('href');
	if(x){
		x=	Math.floor( $(x).position().top ) - scrollOffset;
		setTimeout('$(window).scrollTop('+x+');', 9);
	}
}
$('a[href^=#]').click(offsetScroll);

scrollOffset=    $('#nav').height();

var nav=	$('#nav').offset().top;
function sb(){
var p= $(window).scrollTop();
if( p > nav ){
$('#nav').css('position','fixed');
$('#nav').css('margin-bottom',nav +'px');
}else if( p < nav){
$('#nav').css('position','relative');
$('#nav').css('margin-bottom','0');
}
}
$('#nav').css('top','0px');
$(window).scroll(sb);
sb();
$('#index .hover').click(function(){$(this).children('ul').slideToggle();}).removeClass('hover');
