<style>
#fade { 
    display: none;/*--по умолчанию скрыто--*/ 
    background: rgba(7, 87, 207, 0.8);
    position: fixed; left: 0; top: 0;
    width: 100%; height: 100%;
    opacity: .80; 
    z-index: 9999;
}
.popup_block {
    display: none; /*--по умолчанию скрыто--*/
    background: #fff;
    padding: 20px;
    border: 8px solid rgb(134, 134, 134);
    float: left;
    font-size: 85%;
    position: fixed;
    top: 50%; left: 50%;color: #000;
    max-width: 750px;
    min-width: 320px;
    z-index: 99999;
    /*--CSS3 тень блока--*/
    -webkit-box-shadow: 0px 0px 20px #000;
    -moz-box-shadow: 0px 0px 20px #000;
    box-shadow: 0px 0px 20px #000;
    /*--CSS3 скругление углов--*/
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    border-radius: 12px;
}
.popup_block p {	
    font-weight: 400;
    padding: 0;
    margin: 0;
    color: #000;
    line-height: 1.6;}
.popup_block h2 {
    margin: 0px 0 10px;
    color: rgb(43, 43, 43);
    font-weight: 400;
    text-align: center;
    text-shadow: 1px 1px 2px #0D0C0C;
}	
/* формируем кнопку закрытия */
.close {
    background-color: rgba(61, 61, 61, 0.8);
    border: 2px solid #ccc;
    height: 25px;
    line-height: 20px;
    position: absolute;
    right: -17px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;padding: 0;
    top: -17px;
    width: 25px;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    -ms-border-radius: 50%;
    -o-border-radius: 50%;
    border-radius: 50%;
    -moz-box-shadow: 1px 1px 3px #000;
    -webkit-box-shadow: 1px 1px 3px #000;
    box-shadow: 1px 1px 3px #000;
}
.close:before {
    color: rgba(255, 255, 255, 0.9);
    content: "X";
    font-size: 12px;
    text-shadow: 0 -1px rgba(0, 0, 0, 0.9);
}
.close:hover {
    background-color: rgba(252, 20, 0, 0.8);
}
.shadow {
    box-shadow:4px 4px 10px #857373;
   -webkit-box-shadow:4px 4px 10px #857373;
   -moz-box-shadow:4px 4px 10px #857373;
    padding:0;
}
/*--фиксированное позиционирование для IE6--*/
*html #fade {
    position: absolute;
}
*html .popup_block {
    position: absolute;
}

</style>

		<div class="container">
			<div class="row">


			<div class="container">
			<div class="bs-docs-section">
				<div class="row">
					<div class="col-lg-12">
						<div class="page-header" style="margin-left: 112px;">
							<a onclick="action('add',0);" href="#?w=530" rel="new_link" class="btn btn-primary btn-sm poplight"><?=$GLOBALS['lang']['tri12'];?></a><p></p>
						</div>
					</div>
				</div>
			</div>
		</div>

				<div class="col-lg-12">
					<div class="bs-component" id="table">
						<table class="table table-striped table-bordered table-striped table-hover">
							<thead>
								<tr>
									<th width="3%">id</th>
									<th width="83%"><?=$GLOBALS['lang']['tab23'];?></th>
									<th width="14%"><?=$GLOBALS['lang']['tab24'];?></th>
								</tr>
							</thead>

							<tbody>
								<?=$th;?>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>

<div id="new_link" class="popup_block">
<form id="form" enctype="multipart/form-data" class="bs-component" method="POST">
		<div class="container">
			<div class="bs-docs-section">
				<div class="row">
					<div class="col-lg-6">
						<div class="well bs-component">

								<div class="form-group">
									<label class="control-label" for="inputSmall">URL: </label>
									<input name="url" style="width: 450px;" class="form-control input-sm" type="text" />
								</div>

								<div class="form-group" style="margin-top: 1px;">
										<div class="col-lg-10 col-lg-offset-2">
											<p>&nbsp;</p>
											<button type="reset" class="btn btn-default"><?=$GLOBALS['lang']['tri1'];?></button>
											<button type="submit" class="btn btn-primary"><?=$GLOBALS['lang']['tri2'];?></button>
										</div>
								</div>
						</div>
					</div>

                </div>
            </div>
		</div>
	</form>
</div>
</div>

<script language="JavaScript">

var login="<?=$_COOKIE['login'];?>", session="<?=$_COOKIE['SESSION'];?>";
var preload='<img src="./img/preload.gif" />';

function deltr(id){
	$('#actions'+id).html(preload);

	$.post("./inc/ajax/collect/delete.php",{
		login: login,
		SESSION: session,
		id: id
	}).done(function(data){
		$('#id'+id).remove();
	});
}

function check(id){
	$('#actions'+id).html(preload);

	$.post("./inc/ajax/collect/check.php",{
		login: login,
		SESSION: session,
		id: id
	}).done(function(data){
		$('#actions'+id).html(data); // OK
	});
}

$(document).ready(function(){
	//$("#bases").niceScroll({cursorcolor:"#679FD2"});

	$('a.poplight[href^=#]').click(function() {
		var popID = $(this).attr('rel');
		var popURL = $(this).attr('href');
 
		var query= popURL.split('?');
		var dim= query[1].split('&');
		var popWidth = dim[0].split('=')[1];
 
		$('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" title="Close" class="close"></a>');
 
		var popMargTop = ($('#' + popID).height() + 80) / 2;
		var popMargLeft = ($('#' + popID).width() + 80) / 2;
 
		$('#' + popID).css({ 
			'margin-top' : -popMargTop,
			'margin-left' : -popMargLeft
		});
 
		$('body').append('<div id="fade"></div>');
		$('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn();
 
		return false;
	});
 
	$(document).on('click', 'a.close, #fade', function(){
    $('#fade , .popup_block').fadeOut(function() {
        $('#fade, a.close').remove();
    });
    return false;
   });
});

</script>