/*-----------------------------------------------------------

 Navigation

 ---------------------------------------------------------*/

//anylinkcssmenu.init("menu_anchors_class") //Pass in the CSS class of anchor links (that contain a sub menu)

anylinkcssmenu.init("anchorclass")



animatedcollapse.addDiv('about', 'fade=1,height=310px,group=links')

animatedcollapse.addDiv('pricing', 'fade=1,height=310px,group=links,persist=1,hide=1')

animatedcollapse.ontoggle = function($, divobj, state){ //fires each time a DIV is expanded/contracted

    //$: Access to $j

    //divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID

    //state: "block" or "none", depending on state
	
	
	
}

animatedcollapse.init()





/*-----------------------------------------------------------

 Slider

 ---------------------------------------------------------*/

var $j = jQuery.noConflict();



$j(document).ready(function(){

    var currentPosition = 0;

    var slideWidth = 800;
	

  		var slides = $j('.slide');
	

    var numberOfSlides = slides.length;

    

    // Remove scrollbar in JS
	
    	$j('#slidesContainer').css('overflow', 'hidden');
	
    // Wrap all .slides with #slideInner div

    slides.wrapAll('<div id="slideInner"></div>')    // Float left to display horizontally, readjust .slides width

    .css({

        'float': 'left',

        'width': slideWidth

    });

    

    // Set #slideInner width equal to total width of all slides

    $j('#slideInner').css('width', slideWidth * numberOfSlides);

    

    // Insert left and right arrow controls in the DOM
	
    	$j('#slideshow').prepend('<span class="control" id="leftControl">Move left</span>').append('<span class="control" id="rightControl">Move right</span>');
	

    // Hide left arrow control on first load

    manageControls(currentPosition);

    

    // Create event listeners for .controls clicks

    $j('.control').bind('click', function(){

        // Determine new position

        currentPosition = ($j(this).attr('id') == 'rightControl') ? currentPosition + 1 : currentPosition - 1;

        

        // Hide / show controls

        manageControls(currentPosition);

        // Move slideInner using margin-left

        $j('#slideInner').animate({

            'marginLeft': slideWidth * (-currentPosition)

        });

    });

    

    // manageControls: Hides and shows controls depending on currentPosition

    function manageControls(position){

        // Hide left arrow if position is first slide

        if (position == 0) {

            $j('#leftControl').hide()

        }

        else {

            $j('#leftControl').show()

        }

        // Hide right arrow if position is last slide

        if (position == numberOfSlides - 1) {

            $j('#rightControl').hide()

        }

        else {

            $j('#rightControl').show()

        }

    }

});


//////////////////////
var $j = jQuery.noConflict();



$j(document).ready(function(){

    var pcurrentPosition = 0;

    var pslideWidth = 800;
	

  		var pslides = $j('.price');
	

    var pnumberOfSlides = pslides.length;

    

    // Remove scrollbar in JS
	
    	$j('#priceContainer').css('overflow', 'hidden');
	
    // Wrap all .slides with #slideInner div

    pslides.wrapAll('<div id="priceInner"></div>')    // Float left to display horizontally, readjust .slides width

    .css({

        'float': 'left',

        'width': pslideWidth

    });

    

    // Set #slideInner width equal to total width of all slides

    $j('#priceInner').css('width', pslideWidth * pnumberOfSlides);

    

    // Insert left and right arrow controls in the DOM
	
    	$j('#priceshow').prepend('<span class="pcontrol" id="pleftControl">Move left</span>').append('<span class="pcontrol" id="prightControl">Move right</span>');
	

    // Hide left arrow control on first load

    manageControls(pcurrentPosition);

    

    // Create event listeners for .controls clicks

    $j('.pcontrol').bind('click', function(){

        // Determine new position

        pcurrentPosition = ($j(this).attr('id') == 'prightControl') ? pcurrentPosition + 1 : pcurrentPosition - 1;

        

        // Hide / show controls

        manageControls(pcurrentPosition);

        // Move slideInner using margin-left

        $j('#priceInner').animate({

            'marginLeft': pslideWidth * (-pcurrentPosition)

        });

    });

    

    // manageControls: Hides and shows controls depending on currentPosition

    function manageControls(position){

        // Hide left arrow if position is first slide

        if (position == 0) {

            $j('#pleftControl').hide()

        }

        else {

            $j('#pleftControl').show()

        }

        // Hide right arrow if position is last slide

        if (position == pnumberOfSlides - 1) {

            $j('#prightControl').hide()

        }

        else {

            $j('#prightControl').show()

        }

    }

});

/*-----------------------------------------------------------

 Cufon Fonts

 ---------------------------------------------------------*/

/*Cufon.replace('h1', {

    hover: true

});

Cufon.replace('h2');

Cufon.replace('#links a:link', {

    hover: true

});

Cufon.replace('#navigation a:link', {

    hover: true

});*/



/*-----------------------------------------------------------

 Toggle Comments

 ---------------------------------------------------------*/

function viewComments(postID){

    if (document.getElementById("comments-" + postID).style.display == "none") {

        document.getElementById("comments-" + postID).style.display = "inline";

        document.getElementById("showComments-" + postID).style.display = "none";

        document.getElementById("hideComments-" + postID).style.display = "inline";

    }

    else {

        document.getElementById("comments-" + postID).style.display = "none";

        document.getElementById("showComments-" + postID).style.display = "inline";

        document.getElementById("hideComments-" + postID).style.display = "none";

    }

}

