/**
 * Heavily modified jCorners - (not anymore Cross-Browser) Corners with JQuery
 *   http://jcorners.culturezoo.com/
 *
 * Copyright (c) 2008 Levi Nunnink, Culturezoo, LLC (http://culturezoo.com)
 * Licensed under the GPL
 *
 * Built on top of the jQuery library
 *   http://jquery.com
 *
 * Inspired by the "Corners Experiment" by Jonathan Snook
 *   http://snook.ca/archives/html_and_css/rounded_corners_experiment_ie/
 */

var defaults={radius:5};jQuery.fn.jcorners=function(o){return this.each(function(){new $jc(this,o)})};jQuery.jcorners=function(e,o){this.options=$.extend({},defaults,o||{});if(this.browser.mozilla){this(e).css("-moz-border-radius",this.options.radius)}else if(this.browser.safari){this(e).css("-webkit-border-radius",this.options.radius)}else{this(e).css("-border-radius",this.options.radius)}return this}
 
 
/**
 * Some homebrewed JQuery functions for the menu and rounded corners.
 */
 
$(document).ready(function(){

	var speed = 500;
	var slideInDelay = 750;
	var slideOutDelay = 250;
	var outTimer = false;
	var inTimer = false;

	var wi = $('#menu').width() - 53;
	$("#menu").css({left: -wi});

	$.jcorners(".post, #comments",{radius: "20px"});
	$.jcorners("#sidebar, #searchform, .geshicode, fieldset, input, textarea",{radius: "10px"});	
	$.jcorners(".entry ul, .entry ol",{radius: "0px 30px 30px 0px"});

	/*
	 * If you want it to use click for slideout/slidein use this instead.
	 *
		$("#right").mousedown(function(){
			toggleInOut();
	    });
	    
	    function toggleInOut() {
			if( $("#sub").width() > 0 ) {
				$("#sub").animate({ width: 0 }, speed );
			} else {
				$("#sub").animate({ width: sub_width }, speed );
			}
		}
 	 *
     */
        
	function _slideOut() {
    	$("#menu").animate({ left: '0px' }, speed );
    }
    function _slideIn() {
    	$("#menu").animate({ left: -wi }, speed );
    }      
    
    $("#menu").bind("mouseenter",function(){
		clearTimeout(outTimer);
		inTimer = setTimeout(_slideOut, slideOutDelay);
	}).bind("mouseleave",function(){
		clearTimeout(inTimer);
		outTimer = setTimeout(_slideIn, slideInDelay);
	});    
});

