// JavaScript Document

$().ready(kalpavasi_fix_menus);

function kalpavasi_fix_menus() {
    /**
     * Setup the slideshow in the header region.
     */
    /*$('#portfolio').innerfade({
        speed: 2000,
        timeout: 5000,
        type: 'sequence',
        containerheight: '275px'
    });
	$('#portfolio1').innerfade({
        speed: 2000,
        timeout: 5000,
        type: 'sequence',
        containerheight: '275px'
    });

    /**
     * Insert bars between secondary links.
     */
    $('#secondary-links td:not(:last)').css('border-right', '1px solid white');

    /**
     * Insert bars between primary links.
     */
    $('#primary-links ul:first > li:not(:last)').after('<li class="primary-link-bars">|</li>');
	
	$('#bottom-primary-links td:not(:last)').after('<td width="1" align="center">|</td>');
    /**
     * Set the background image for the newly created bars in the primary links.
     * These images come from the original primary links.*/
    var bg_img = $('#primary-links td:first').css('background-image');
    $('#primary-links td:odd').css('background-image', bg_img);
     

    /**
     * Among the primary links, one or more TD element(s) holds a.active.  This/These
     * TD element will get a different background image.
     */
	/*var td_bg_img_current = $('#bottom-primary-links td:first').attr('background');
    var td_bg_img_new = td_bg_img_current.replace(/topmenubg1/, "topmenubg2");
    $('#bottom-primary-links td a.active').parent().attr('background', td_bg_img_new);*/
	 
    var li_bg_img_current = $('#primary-links ul:first > li:first').css('background-image');
    var li_bg_img_new = li_bg_img_current.replace(/topmenubg1/, "topmenubg2");
    $('#primary-links ul:first > li > a.active').parent().css('background-image', li_bg_img_new).css('background-repeat', 'repeat-x');
}
