function serverselect() {
if ($('input[name=region]:checked').val()=='eu') {
$('#servereu').show();
$('#serverna').hide();
}
else {
$('#serverna').show();
$('#servereu').hide();
}
}
$(document).ready(function() {
var i=1;
var selimg=false;
var imgseloldheight=parseInt($('#imageselect').css('height'));
var imgselnewheight=parseInt($('#charselect').css('height'));
serverselect();
for (i=1 ; i<=59 ; i=i+1) {
$('#imgul').append('
');
}
$('#imageselect').hover(
function () {
$('#imageselect').css({'height':imgselnewheight});
$('#imageselectlist').css({'height': imgselnewheight-40});
},
function () {
$('#imageselectlist').css({'height':imgseloldheight-40});
$('#imageselect').css({'height':imgseloldheight});
$('.imgli').removeClass('imghover');
if (selimg!=false) {$('#imageselectlist').scrollTo($(selimg),500);}
}
);
$('.imgli').hover(
function () { $(this).addClass('imghover'); },
function () { $(this).removeClass('imghover'); }
);
$('.mybutton').hover(
function() { $(this).addClass('ui-state-hover'); },
function() { $(this).removeClass('ui-state-hover'); }
);
$('.imgli').click(function() {
$('.imgli').removeClass('imgsel');
if (selimg!=this) {
$(this).addClass('imgsel');
selimg=this;
}
else {
selimg=false;
}
});
$('#button_gen').click(function () {
if ($('input[name=charname]').val()=='') {
alert('You have to enter a character name to generate signature!');
return;
}
if (selimg==false) {
alert('You have to select an image to generate signature!');
return;
}
$('#imgnum').val($(selimg).find('img').attr('alt'));
var today = new Date();
var link = 'http://sig.hypernics.hu/aion/'+$('input[name=region]:checked').val().toLowerCase()+'/'+$('select[name=server'+$('input[name=region]:checked').val()+']').val().toLowerCase()+'/'+$('input[name=charname]').val().toLowerCase()+'.jpg';
var forumcode = '[url="http://sig.hypernics.hu"][img]'+link+'[/img][/url]';
$('#signature').html('
');
$('#sometext').html('Your signature link: '+link+'
'+
'Forum code: '+forumcode+'
'+
'
Your signature data update automatically every 12 hours. '+
'This image link above only function for 1 month. So you have to visit this site before '+expireday+'!
'
);
});
$('#colorpicker').farbtastic().dialog({
title: "Choose color",
autoOpen: false,
width:220,
height:240,
minWidth:220,
minHeight:240,
resizable: false,
open: function(event, ui) {$('#colorpicker').parent().hide();$('#colorpicker').parent().fadeIn(500);},
close: function(event, ui) {$('#colorpicker').parent().show();$('#colorpicker').parent().fadeOut(500);}
});
$('#textcolorch').click(function () {
$.farbtastic('#colorpicker').linkTo(function () {
$('#textcolor').css('background-color',$.farbtastic('#colorpicker').color);
$('#textcolorval').val($.farbtastic('#colorpicker').color);
});
$('#colorpicker').dialog('option','title','Choose text color');
$('#colorpicker').dialog('open');
});
$('#shadowcolorch').click(function () {
$.farbtastic('#colorpicker').linkTo(function () {
$('#shadowcolor').css('background-color',$.farbtastic('#colorpicker').color);
$('#shadowcolorval').val($.farbtastic('#colorpicker').color);
});
$('#colorpicker').dialog('option','title','Choose shadow color');
$('#colorpicker').dialog('open');
});
});