function toggleTextOut(e,txtval) {
	if(e.value=="") e.value = txtval;

}
function toggleTextIn(e,txtval) {
	if(e.value==txtval) e.value="";
	else e.select();
}

jQuery(document).ready(function($){
		/*$("#nav-main li.current").prev('li').css('background','none');
		$("#nav-main li").hover(function(){
			$(this).addClass('on');
		},function(){
			$(this).removeClass('on');
		});
		$(".detail:even").css('clear','both');*/
//---------------------------sitemap fixer starts here -------------------------------\\
$(".sub-footer > ul > li > a").wrap("<h4>");
$(".sub-footer > ul > li").removeClass();
$(".sub-footer  ul li ul li:last-child").addClass("last");
//-------------------------end of sitemap fix ----------------------------------------\\
//------------------------- global toolbox -------------------------------------------\\
    var $div = $('#test');
    var height = $div.height();
    $div.hide().css({ height : 0 });

    $('.toolbox h3').click(function (event) {
		//if( $(event.target).is('.close') || $(event.target).is('.open') ) {
        if ($div.is(':visible')) {
            $div.stop().animate({ height: 0 }, { duration: 500, complete: function () {
                $div.hide();
				$('.toolbox h3').addClass('close');
            } });
        } else {
            $div.stop().show().animate({ height : height }, { duration: 500 });
			$('.toolbox h3').removeClass('close');
        }
        
        return false;
		//}
    });
//------------------------- subfooter animation-------------------------------------------\\	
	var $div2 = $(".sub-footer");
	var height2 = $div2.height();
	 $div2.hide().css({ height : 0 });
	$(".toggle").click(function () {

	   if ($div2.is(':visible')) {
            $div2.stop().animate({ height:0 }, { duration: 500, complete: function () {
                $div2.hide();
				$('.toggle').addClass('close');
            } });
        } else {
            $div2.stop().show().animate({ height : height2 }, { duration: 500 });
			$('.toggle').removeClass('close');
			$('html, body').animate({
					scrollTop: $("div [class^=sub-footer]").offset().top
				}, 1000);
        }
        
	  return false;
    });
	

	//$(".cbox").colorbox({transition:"fade"});//-- for images only.
	// --for video 
	/* $(".ngg-widget a, .ngg-galleryoverview a").each(function (arr){
			if ($(this).attr("title").substr(0,5)=="Video"){
				$(this).attr("class","cboxVideo");
			  $(this).attr("href",$(this).children("img").attr("title"));
			}
		  })
		  $(".cboxVideo").colorbox({iframe:true, innerWidth:425, innerHeight:344});*/


//$(".cbox").colorbox({transition:"fade"});//-- for images only.
	// --for video 
$(".ngg-widget a , .ngg-gallery-thumbnail a ").each(function (arr){
			if ($(this).attr("title").substr(0,5)=="Video"){
				//$(this).attr("class","cboxVideo");
				$(this).attr("class","shadowbox");
			  $(this).attr("href",$(this).children("img").attr("title"));
			}
		  })
		 // $(".cboxVideo").colorbox({iframe:true, innerWidth:425, innerHeight:344});
		 //$(".shadowbox").shadowbox({iframe:true, innerWidth:425, innerHeight:344});
	
});
