 	var curtype = "";
 	var cursize = "";
 	
//JavaScript Document Developed by Seo-semantic-xhtml
function mainmenu(){
$(" #nav ul ").css({display: "none"}); // Opera Fix
$(" #nav li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(600);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}

 $(document).ready(function(){
	mainmenu();

	$("#left_container ul li a").each(function (idx) {
		if ($(this).attr('id') == 'openthisone') {
			$(this).parent().toggleClass('active');
			$(this).next().slideToggle(400);
		}			
	});
	
var menuwidth = 0;
$("#smoothmenu1 ul li").each(function(x) {
	menuwidth += parseInt($(this).css('width'));
});
var newleftpadding = (1000 - menuwidth)/2;
var newwidth = 1000 - newleftpadding;
	$("#smoothmenu1").css("padding-left", newleftpadding);
	$("#smoothmenu1").css("width", newwidth);
	$("#smoothmenu1 ul li a").first().css("border-left", "1px solid #778");
	
});

/************************************************************************************************/

$(function() {
	
	$('a.main_section').click(function() {
		if ($(this).next().is(':visible')) {
			$(this).parent().removeClass('active');
			$(this).next().slideUp(300);
		}
		else {
			$('ul.inner_section').slideUp(300);
			$('a.main_section').parent().removeClass('active');
			
			$(this).parent().toggleClass('active');
			$(this).next().slideToggle(300);
		}

		return false;
		
	});
	
});

function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function shadowboxSwitch() {
    var $active = $('#shadowbox_slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#shadowbox_slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#shadowbox_slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function ThreeDflatSwitch() {
    var $active = $('#ThreeDflat_slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#ThreeDflat_slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#ThreeDflat_slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function ThreeDminiSwitch() {
    var $active = $('#ThreeDmini_slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#ThreeDmini_slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#ThreeDmini_slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function posterframed_std_Switch() {
    var $active = $('#posterframed_standard_slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#posterframed_standard_slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#posterframed_standard_slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function posterframed_slim_Switch() {
    var $active = $('#posterframed_slim_slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#posterframed_slim_slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#posterframed_slim_slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function posterframed_16x20_Switch() {
    var $active = $('#posterframed_16x20_slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#posterframed_16x20_slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#posterframed_16x20_slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 3000 );
    setInterval( "shadowboxSwitch()", 5000 );
    setInterval( "ThreeDflatSwitch()", 5000 );
    setInterval( "ThreeDminiSwitch()", 5000 );
    setInterval( "posterframed_std_Switch()", 5000 );
    setInterval( "posterframed_slim_Switch()", 5000 );
    setInterval( "posterframed_16x20_Switch()", 5000 );
});

