$(document).ready(function() {

    //Header
    $.featureList(
        $("#tabs li a"),
        $("#output li"), {
            start_item: 0,
            pause_on_hover: true,
            transition_interval: 8000
        }
    );
    
    //Hover bottomItem
    $('.bottomItem').hover(function () {
		$('.bottomHover', this).stop().fadeTo('fast',1);
	}, function () {
		$('.bottomHover', this).stop().fadeTo('fast',0);
	});
    
    //Lightbox img hover
    $('#sidebar img').hover(function () {
		$('.imgHover', this).stop().fadeTo('fast',1);
	}, function () {
		$('.imgHover', this).stop().fadeTo('fast',0);
	});
    
    //Lightbox popup
    $('a.lightbox').lightBox({fixedNavigation:true});

});

//Form target popup
function popupform(myform, windowname){
    if (! window.focus)return true;
    window.open('', windowname, 'height=600,width=820,scrollbars=yes,location=no');
    myform.target=windowname;
    return true;
}

//Popup checker
function IsPopupBlocker() {
	var oWin = window.open("","testpopupblocker","width=100,height=50,top=5000,left=5000");
	if (oWin==null || typeof(oWin)=="undefined") {
		return true;
	} else {
		oWin.close();
		return false;
	}
}

//History back
function goBack(){
    if (IsPopupBlocker()) {
	   return false;
    } else {
    	history.go(-1);
    }
}
