$(document).ready(function() {
    $("a.fancy").fancybox({
        'padding'               : 0,
        'overlayOpacity'        : 0.4,
        'overlayColor'          : '#eae4dd',
        'titleShow'             : true,
        'titlePosition'         : 'inside',
        'autoScale'             : false,
        'autoDimensions'        : false
    });

/*
	//slideshow
    $(".links").tabs(".boxes > div", {
		rotate: false
	});
    //END slideshow
*/
});

function popup(url,name,width,height,wplus,hplus,focus,left,top,menubar,status,toolbar,scrollbar,resizable,scrx,scry,directories,loc) {
	if ( !url ) return false;
	if ( !name ) name = 'popupWin';
	if ( !width ) width = '';
	if ( !height ) height = '';
	if ( !directories ) directories = 'no';
	if ( !loc ) loc = 'no';
	if ( !menubar ) menubar = 'no';
	if ( !status ) status = 'no';
	if ( !toolbar ) toolbar = 'no';
	if ( !scrollbar ) scrollbar = 'no';
	if ( !resizable ) resizable = 'no';
	if ( !scrx ) scrx = '100';
	if ( !scry ) scry = '100';
	if ( !left ) left = '100';
	if ( !top ) top = '100';
	if ( wplus ) width  += wplus;
	if ( hplus ) height += hplus;

    var popupWin = window.open(url,name,'width='+width+'px,height='+height+'px,left='+left+',top='+top+',menubar='+menubar+',status='+status+',toolbar='+toolbar+',scrollbars='+scrollbar+',resizable='+resizable+',screenX='+scrx+',screenY='+scry+'directories='+directories+',location='+loc);

	if ( focus ) popupWin.focus();
}

var container_id = 'body';

$(document).ready(function() {
    SizeReBuild();
//    setTimeout("SizeReBuild()", 500);
})
    
function ShowItem(num) {
	$('.box').hide();
	$('.link').removeClass('current');
	$('#box_'+num).show();
	$('#link_'+num).addClass('current');
	SizeReBuild();
}

function SizeReBuild() {

    var leftHeight = $("#left-data").height();
    var dataHeight = $("#data").height();
	var eletmodHeight = $(".links").height() + $(".boxes").height();

    if ( dataHeight < leftHeight ) {
        $("#data").height(leftHeight);
    } else {
        $("#left-data").height(dataHeight);
    }

	if (eletmodHeight == 0)
		return false;

	$("#data").height(eletmodHeight + 150);
	$("#left-data").height(eletmodHeight + 150);

}

// window.onresize = SizeReBuild;

