var $j = jQuery.noConflict(); function msiAuthSys(system) { $j('input').serialize(); var captbox = $j("input[name='captchaSelection']").val(); var url, data; if ( system == 'reg' ) { url = "https://animeserv.net/msi/remote.php?act=doreg"; data = { username: $j('#username').val(), nickname: $j('#nickname').val(), email: $j('#email').val(), ipbsub: $j('input:radio[name=ipbsub]:checked').val(), password: $j('#password').val(), password2 : $j('#password2').val(), captSelect : captbox }; } else if ( system == 'login' ) { url = "https://animeserv.net/msi/remote.php?act=dologin"; data = { username : $j('#username').val(), email : $j('#email').val(), password : $j('#password').val(), captSelect : captbox }; } else if ( system == 'usercp' ) { url = "https://animeserv.net/msi/remote.php?act=doedit"; data = { id: $j('#id').val(), username: $j('#username').val(), nickname: $j('#nickname').val(), email : $j('#email').val(), oldpassword: $j('#oldpassword').val(), password: $j('#password').val(), newpassword : $j('#newpassword').val(), captSelect : captbox }; } else if ( system == 'activate' ) { url = "https://animeserv.net/msi/remote.php?act=doactivate"; data = { email : $j('#email').val() }; } else if ( system == 'pwd' ) { url = "https://animeserv.net/msi/remote.php?act=dopwd"; data = { email : $j('#email').val() }; } $j.ajax({ type: 'GET', cache: false, global: true, dataType: 'jsonp', url: url, data: data, success: function (user) { //alert(user.error); if ( user.error != '' ) { if ( $j('#msgBox').hasClass('success') == true ) { $j('#msgBox').removeClass('success'); } $j('#msgBox .msgContent').hide(); $j('#msgBox .msgContent').html(user.error).fadeIn('slow'); } else { if ( system == 'reg' || system == 'activate' || system == 'pwd') { msiPreBox('', user.msg); $j('#msiUniBox').hide().fadeIn(1000); } else if ( system == 'usercp' ) { //reload new content msiLoadBox(system, user.msg); $j('#msiUniBox').hide().fadeIn(1000); } else { window.location.href = 'https://animeserv.net/component/content/category/64-sakourasou'; } } } }); } function msiPreBox(pid, text) { //--------------------------------------------------------------- // Main unibox //--------------------------------------------------------------- $j('#msiUniBox').html(text); //Get the window height and width var winH = $j(window).height(); var winW = $j(window).width(); //Set the popup window to center $j('#msiUniBox').css('top', (winH - $j('#msiUniBox').height()) / 3); $j('#msiUniBox').css('left', (winW - $j('#msiUniBox').width()) / 2); //if close button is clicked $j('#msiClose').click(function(e) { //Cancel the link behavior e.preventDefault(); $j('#msiMask').fadeOut('slow'); $j('.window').hide(); }); //--------------------------------------------------------------- // Sub unibox //--------------------------------------------------------------- $j('a[alt=msiubox2]').click(function(e) { //Cancel the link behavior e.preventDefault(); //Get the A tag var sid = $j(this).attr('name'); //found language id with auto setting if ( sid.indexOf('auto') != -1 ) { var langid = sid.substr(sid.indexOf('-')+1, 2); sid = pid; //store to cookie setCookie('msi_lang', langid, 365); setCookie('jfcookie[lang]', langid, 365); } msiLoadBox(sid); }); } function msiLoadBox(id, msg) { var url = "https://animeserv.net/msi/remote.php"; var data = {act : id, msg : msg}; $j.ajax({ type: 'GET', cache: false, global: true, dataType: 'jsonp', url: url, data: data, success: function (resp) { msiPreBox(id, resp.data); if ( msg != null ) { $j('#msgBox').addClass('success'); $j('#msgBox .msgContent').html(msg).fadeIn(1500); } //focus things $j('#msiUniBox input:first').focus(); //Captcha box loading var captIntro = resp.txt.captintro; var captPath = "https://animeserv.net/msi/lib/js/captcha.php"; $j('#captBox.msireg').simpleCaptcha({introText: captIntro, scriptPath: captPath}); } }); } function setCookie(c_name,value,expiredays) { var exdate=new Date(); exdate.setDate(exdate.getDate()+expiredays); document.cookie=c_name+ "=" +escape(value)+ ((expiredays==null) ? "" : ";expires="+exdate.toUTCString()) + ";domain=.animeserv.net" + ";path=/"; } $j(document).ready(function() { $j('a[alt=msiubox]').click(function(e) { //Cancel the link behavior e.preventDefault(); //Get the A tag var id = $j(this).attr('name'); //Get the screen height and width //var maskHeight = $j(window).height(); var maskHeight = $j(document).height(); var maskWidth = $j(window).width(); //Set heigth and width to mask to fill up the whole screen $j('#msiMask').css({'width':maskWidth,'height':maskHeight}); //transition effect $j('#msiMask').fadeTo(500,0.5); $j('#msiMask').fadeIn(500); //Parse content msiLoadBox(id); //transition effect $j('#msiUniBox').fadeIn(1000); }); //if mask is clicked $j('#msiMask').click(function() { $j(this).fadeOut(250); $j('.window').hide(); }); }); //Ajax loading init $j(document).ajaxStart(function(){ //alert('ajax start'); $j('#aniload').fadeIn('slow'); $j('#msgBox .msgContent').hide(); }).ajaxSend(function(){ //alert('ajax send'); $j('#aniload').fadeIn('slow'); $j('#msgBox .msgContent').hide(); }).ajaxComplete(function(){ //alert('ajax stops'); $j('#aniload').fadeOut('slow'); }); //Mask to cover the whole screen document.write("