/*
 * 
 * Copyright (c) 2011, Pavel Buiko (http://electricjelly.com/)
 * Created: 16.08.2011 | Updated: 16.08.2011
 * 
 * -----
 * 
 */

$(function (){
	naviOpacity();
    maskHover();
    slashLi();
    iconWi();
    clear6();
    //sequential();
    replaceTg();
    bottomNv();
    _300x378();
    displaySR();
    footer2n_5_6();
    iFix();   
});

function naviOpacity(){
	$("li strong", "#navi").hover(
		function(){
			$("li strong", "#navi")
				.not($(this))
				.css({opacity:'0.8'})
		},
		function(){
			$("li strong", "#navi")
				.not($(this))
				.css({opacity:'1'}, 1, function(){
					if($.browser.msie){
						this.style.removeAttribute('filter');
					}
				})
		}
	);
}
function maskHover(){
    $(".mask").hover(
		function(){
            $(this).children().css("display", "block")
		},
		function(){
            $(this).children().css("display", "none")
		}
    
    ); 
}
function slashLi(){
    $("#blog .sidebar li").append(' /');

}
function heightUl(){
    $("#content_gal #page ul").css({height: $("#content_gal #page ul").height()+2});

}
function iconWi(){
    $("#content_gal ul li div.icons").each(function(){
    $(this).css({width: $(this).width($(this).children(".vr").outerWidth(true)+$(this).children(".sr").outerWidth(true)+$(this).children(".pc").outerWidth(true))});
    });
}
function clear6(){
    $("#content_gal ul li.grid_2:nth-child(6n)").after("<li class='grid_12'></li>");
}
function sequential(){
    $("#navi li a").each(function (i) {
    i = i+1;
    $(this).prepend('<span>0'+i+'.</span>');
    });
}
function replaceTg(){
    $(".post div span, .post div b, .post div i, .post div u, .post div em, , .post div strong").replaceWith(function () {
        return $(this).text();
    });
    $(".post div h1, .post div h2, .post div h3, .post div h4, .post div h5, .post div h6, .post div b, .post div strong").replaceWith(function () {
        return "<p>" + $(this).text() + "</p>";
    });
    $('.post p img').parent().remove();
}
function bottomNv(){
    $('#bottomNv .next a').append(' &gt;&gt;');
    $('#bottomNv .prev a').prepend('&lt;&lt; ');
}

function bottomNv(){
    $('#bottomNv .next a').append(' &gt;&gt;');
    $('#bottomNv .prev a').prepend('&lt;&lt; ');
}
function _300x378(){
    $("#top .grid_12 .grid_6 a:first").css("display", "inline");
}
function displaySR(){
    $('.icons a.sr:nth-child(1)').css('display', 'block');
}
function footer2n_5_6(){
    $("#pageFooter .grid_4 ul li:nth-child(2n)").addClass("r-li");
    $("#pageFooter .grid_4 ul li:nth-child(5)").addClass("br");
    $("#pageFooter .grid_4 ul li:nth-child(6)").addClass("br");
}
function iFix(){
    if(navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod')
{
$("#fixedBr_top").css("display", "none");
$("#fixedBr_bottom").css("display", "none");
$("#fixedBr_left").css("display", "none");
$("#fixedBr_right").css("display", "none");
$("#br-top-left").css("display", "none");
$("#br-top-right").css("display", "none");
$("#br-bottom-right").css("display", "none");
$("#br-bottom-left").css("display", "none");
};
}


/// modif, 7112011 navi ///    
    
    $(document).ready(function(){
    
    $("#navi li").hover(function(){
    
        $('ul:first',this).css('visibility', 'visible');
    
    }, function(){
    
        $('ul:first',this).css('visibility', 'hidden');
    
    });
        
    });
    
/// end navi-dd //
