rule.js
1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
$(document).ready(function() {
$('#rule').bind('click',function(){
$.get("/ajax/rule.php",
function(data){
alert_msg(data);
});
return false;
});
$('.submit4').bind('click',function(){
if(!$('#is_rule').attr('checked')){
alert('Âû íå ñîãëàñèëèñü ñ ïðàâèëèàìè ðàáîòû Èíòåðíåò-ìàãàçèíà "Ýêñòðåì Ñòàéë" ');
return false;
}
});
var alert_msg = function(msg){
winW = document.body.offsetWidth;
winH = document.body.offsetHeight
$('.cabinet_box').remove();
$('#cabinet_form').remove();
$('body').append('<div class="cabinet_box"></div>');
$('body').append('<div id="cabinet_form"></div>');
$('#cabinet_form').append('<div class="wrp"></div>');
$('#cabinet_form').css( "width", '750px' );
$('#cabinet_form').css( "min-height", '2500px' );
$('#cabinet_form').css( "height", 'auto' );
$('#cabinet_form').css( "left", ((winW-750)/2)+'px' );
var scrollTop = document.documentElement.scrollTop
if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
scrollTop = document.body.scrollTop;
}
$('#cabinet_form').css( "top", (scrollTop+50)+'px' );
$('#cabinet_form .wrp').append('<img src="/img/close2.jpg" id="cabinet_close" border="0" width="32" height="32" align="right" />');
app = '';
app += msg;
app += '<center>';
app += '<hr /><input type="submit" class="submit4" style="text-transform:none;" id="p_close" value="Çàêðûòü" />';
app += '</center>';
$('#cabinet_form .wrp').append(app);
$(".cabinet_box, #cabinet_close, #p_close").click(function() {
$('.cabinet_box').remove();
$('#cabinet_form').remove();
});
}
});