Файл: Source/assets/js/functions.js
Строк: 301
<?php
function vn_stopt(input) {
if(input == "user") {
$.post("inc/checkuser.php" , {
user : $("#reg_user").val()
}, function(response) {
$("#userResult").css("display","none");
$("#userResult").html(response);
$("#userResult").fadeIn(800);
});
}
if(input == "pass") {
$.post("inc/checkuser.php" , {
pass : $("#reg_pass").val()
}, function(response) {
$("#passResult").css("display","none");
$("#passResult").html(response);
$("#passResult").fadeIn(800);
});
}
if(input == "repass") {
$.post("inc/checkuser.php" , {
repass : $("#reg_repass").val(), pass2 : $("#reg_pass").val()
}, function(response) {
$("#repassResult").css("display","none");
$("#repassResult").html(response);
$("#repassResult").fadeIn(800);
});
}
if(input == "email") {
$.post("inc/checkuser.php" , {
email : $("#reg_email").val(),
}, function(response) {
$("#emailResult").css("display","none");
$("#emailResult").html(response);
$("#emailResult").fadeIn(800);
});
}
}
function setCookie(c_name,value,exdays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
}
function getCookie(c_name)
{
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++)
{
x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
x=x.replace(/^s+|s+$/g,"");
if (x==c_name)
{
return unescape(y);
}
}
}
function toggle(element,pelement) {
$(element).slideToggle('slow', function() {
var display = $(element).css("display");
if(display == "none") {
$(pelement).css("background","#dae7fa url('img/plus.gif') no-repeat right center");
setCookie(element,"1",365);
} else {
$(pelement).css("background","#dae7fa url('img/minus.gif') no-repeat right center");
setCookie(element,"0",365);
}
});
}
function grankings(titlelm,rankingelm) {
if($(rankingelm).css('display') == "none") {
$(titlelm).fadeToggle(1000, function() {
$.post("inc/grankings.php" , {
game : $(titlelm).html(),
}, function(response) {
$(rankingelm).html(response);
$(rankingelm).fadeToggle();
});
});
} else {
$(rankingelm).fadeToggle(1000, function() {
$(titlelm).fadeToggle();
});
}
}
function openwindow(src,title) {
var docwidth = $(document).width();
var pad = ((docwidth - 880)/2)-10;
var props = "width=880,height=400,left="+pad+",top=150,screenX="+pad+",screenY=150";
window.open(src,title,props);
}
function jump(loc) {
window.location = loc;
}
// When loaded execution
$(document).ready(function() {
// Control panel menus
if(getCookie("#vote") != 1) {
$("#voted").css("background","#dae7fa url('img/minus.gif') no-repeat right center");
$("#vote").css("display","block");
} else {
$("#voted").css("background","#dae7fa url('img/plus.gif') no-repeat right center");
$("#vote").css("display","none");
}
if(getCookie("#lvote") != 1) {
$("#lvoted").css("background","#dae7fa url('img/minus.gif') no-repeat right center");
$("#lvote").css("display","block");
} else {
$("#lvoted").css("background","#dae7fa url('img/plus.gif') no-repeat right center");
$("#lvote").css("display","none");
}
if(getCookie("#invite") != 1) {
$("#invited").css("background","#dae7fa url('img/minus.gif') no-repeat right center");
$("#invite").css("display","block");
} else {
$("#invited").css("background","#dae7fa url('img/plus.gif') no-repeat right center");
$("#invite").css("display","none");
}
if(getCookie("#taward") != 1) {
$("#tawardd").css("background","#dae7fa url('img/minus.gif') no-repeat right center");
$("#taward").css("display","block");
} else {
$("#tawardd").css("background","#dae7fa url('img/plus.gif') no-repeat right center");
$("#taward").css("display","none");
}
if(getCookie("#smspoints") != 1) {
$("#smspointsd").css("background","#dae7fa url('img/minus.gif') no-repeat right center");
$("#smspoints").css("display","block");
} else {
$("#smspointsd").css("background","#dae7fa url('img/plus.gif') no-repeat right center");
$("#smspoints").css("display","none");
}
if(getCookie("#gold") != 1) {
$("#goldd").css("background","#dae7fa url('img/minus.gif') no-repeat right center");
$("#gold").css("display","block");
} else {
$("#goldd").css("background","#dae7fa url('img/plus.gif') no-repeat right center");
$("#gold").css("display","none");
}
if(getCookie("#options") != 1) {
$("#optionsd").css("background","#dae7fa url('img/minus.gif') no-repeat right center");
$("#options").css("display","block");
} else {
$("#optionsd").css("background","#dae7fa url('img/plus.gif') no-repeat right center");
$("#options").css("display","none");
}
// Register inputs
$("#reg_user").val('');
$("#reg_pass").val('');
// Login inputs
$("#user").val('Потребител');
$("#pass").val('Парола');
// Fancybox selector
$("a.prize-img").fancybox();
$("a.inline").fancybox({
'hideOnContentClick': true
});
// Check all
$('#check_all').click(function(){
if (this.checked == false) {
$(".check").attr("checked", true);
} else {
$(".check").attr("checked", false);
}
});
// Checkbox image replace
$('input[type=checkbox]').checkbox({
cls:'jquery-safari-checkbox',
empty: '/img/empty.png'
});
// Click tr
$(".mail").click(function() {
window.location.href = $(this).find("a").attr("href");
});
// Links
$("#votelink").focus(function(){
this.select();
});
$("#votelink").mouseup(function(e){
e.preventDefault();
});
$("#invitelink").focus(function(){
this.select();
});
$("#invitelink").mouseup(function(e){
e.preventDefault();
});
//Avatar hover
$("#avatar").hover(function(){
$("#sendpm").fadeIn(300);
}, function(){
$("#sendpm").fadeOut(300);
});
});
// Onload execution
$(window).load(function() {
// Progress bar
$("#progressbar").progressbar({ value: 40 });
// User register check
var vn_t;
$("#reg_user").keyup(function() {
if(vn_t) {
clearTimeout(vn_t);
vn_t = setTimeout("vn_stopt('user')", 200);
} else {
vn_t = setTimeout("vn_stopt('user')", 200);
}
});
$("#reg_pass").keyup(function() {
if(vn_t) {
clearTimeout(vn_t);
vn_t = setTimeout("vn_stopt('pass')", 200);
} else {
vn_t = setTimeout("vn_stopt('pass')", 200);
}
});
$("#reg_repass").keyup(function() {
if(vn_t) {
clearTimeout(vn_t);
vn_t = setTimeout("vn_stopt('repass')", 200);
} else {
vn_t = setTimeout("vn_stopt('repass')", 200);
}
});
$("#reg_email").keyup(function() {
if(vn_t) {
clearTimeout(vn_t);
vn_t = setTimeout("vn_stopt('email')", 200);
} else {
vn_t = setTimeout("vn_stopt('email')", 200);
}
});
$("#user").focus(function() {
if(this.value=='Потребител') { this.value=''; }
});
$("#user").blur(function() {
if(this.value=='') { this.value='Потребител'; }
});
$("#pass").focus(function() {
if(this.value=='Парола') { this.value=''; }
});
$("#pass").blur(function() {
if(this.value=='') { this.value='Парола'; }
});
// Slideshow options
$('#slider').nivoSlider({ pauseTime:5000 });
$('[title]').qtip({ style: { name: 'blue', tip: true }, position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' } }, hide: { effect: { type: 'slide' } } });
});
?>