var currentPosition = 0;
var ytplayer, cposition;
$rj(document).ready(function(){
/*main top game slider start*/
/*
var slideWidth = 1400;
var slideImageLeft = 0;
var slides = $rj('.game_introduce');
var numberOfSlides = slides.length;
currentPosition = js_util.__getRandom(numberOfSlides);
cposition = currentPosition + 1;
$rj('#slidesContainer').css('overflow', 'hidden');
if (js_util.__ScreenX() < 1025){
slideWidth = 1000;
slideImageLeft = -80;
}else if (js_util.__ScreenX() < 1153){
slideWidth = 1100;
slideImageLeft = -30;
}else if (js_util.__ScreenX() < 1281){
slideWidth = 1200;
slideImageLeft = 30;
}else if (js_util.__ScreenX() < 1361){
slideWidth = 1300;
slideImageLeft = 80;
}else{
slideWidth = 1400;
slideImageLeft = 80;
}
$rj("#TopGame").css({width:slideWidth+"px"});
$rj(".game_introduce").css({width:slideWidth+"px"});
$rj("#slideshow").css({width:slideWidth+"px"});
$rj("#slidesContainer").css({width:slideWidth+"px"});
$rj(".left_character").css({left:slideImageLeft+"px"});
slides
.wrapAll('
')
.css({'float' : 'left', 'width' : slideWidth});
$rj('#slideInner').css('width', slideWidth * numberOfSlides);
//$('#slideshow')
// .prepend('Clicking moves left')
// .append('Clicking moves right');
manageControls(currentPosition);
slideAction(currentPosition);
$rj('.control').bind('click', function(){
currentPosition = ($rj(this).attr('id')=='rightControl') ? currentPosition+1 : currentPosition-1;
manageControls(currentPosition);
slideAction(currentPosition);
// $rj('#slideInner').animate({
// 'marginLeft' : slideWidth*(-currentPosition)
// }//, 1000
// );
});
function slideAction(position){
$rj('#slideInner').animate({
'marginLeft' : slideWidth*(-position)
}//, 1000
);
}
function manageControls(position){
if(position==0){ $rj('#leftControl').hide() } else{ $rj('#leftControl').show() }
if(position==numberOfSlides-1){ $rj('#rightControl').hide() } else{ $rj('#rightControl').show() }
}
*/
/*main top game slider end*/
/*main banner slider start*/
/*
$rj(".banner_num").show();
$rj(".banner_num li:first").addClass("on");
//Get size of images, how many there are, then determin the size of the image reel.
var imageWidth = $rj(".banner_img").width();
var imageHeight = $rj(".banner_img").height();
var imageSum = $rj(".banner_img li").size();
var imageReelWidth = imageWidth * imageSum;
var imageReelHeight = imageHeight * imageSum;
var _movie_play = 0 ;
var _rolling_count = 8000;
var imageTotalCount = 0;
var imageThisNumber = 0;
var imageMoveType = 1; //0:right / 1:left
var imageMoveNumber = 0;
var _bannerlist = 0;
var _bannernumber = 0;
$rj(".banner_img").css({'width' : imageReelWidth});
rotate_fade = function(){
if (imageThisNumber == imageTotalCount){
imageThisNumber = 0;
}else{
imageThisNumber++;
}
var image_reelPosition = (imageThisNumber * imageHeight) + (imageThisNumber * 3);
$rj(".banner_num li").bind({
mouseenter : function(){clearInterval(_movie_play); _movie_play = null;},
mouseleave : function(){rotateSwitch();}
});
var iii=0;
$rj(".banner_img li").each(function(){
if (iii == imageThisNumber){
$rj(this).fadeIn(1500, function(){
$rj(".banner_num li").removeClass("off on");
$rj(".banner_num li").attr("rel", imageThisNumber).addClass(function(index, currentClass){
if (index == imageThisNumber){return "on";}else{return "off";}
});
});
}else{
$rj(this).fadeOut(1000);
}
iii++;
});
};
*/
/*
rotate_rollup = function(){
if (imageThisNumber == imageTotalCount){
imageThisNumber = 0;
}else{
imageThisNumber++;
}
var triggerID = imageThisNumber;
var image_reelPosition = (triggerID * imageHeight) + (triggerID * 3);
$rj(".banner_num li").bind({
mouseenter : function(){clearInterval(_movie_play); _movie_play = null;},
mouseleave : function(){rotateSwitch();}
});
$rj(".banner_img").animate({
top: -image_reelPosition + "px"
}, 500, function(){
$rj(".banner_num li").removeClass("off on");;
$rj(".banner_num li").attr("rel", imageThisNumber).addClass(function(index, currentClass){
if (index == imageThisNumber){return "on";}else{return "off";}
});
}).bind({
mouseenter : function(){clearInterval(_movie_play); _movie_play = null;},
mouseleave : function(){rotateSwitch();}
});
};
*/
/*
rotate_temp = function(){
if (imageThisNumber == imageTotalCount){
imageThisNumber = 0;
//debug.__debug("imageMoveNumber=>" + imageMoveNumber++);
}else{
imageThisNumber++;
}
var triggerID = imageThisNumber;
var image_reelPosition = triggerID * imageWidth;
$rj(".banner_num li").bind({
mouseenter : function(){clearInterval(_movie_play); _movie_play = null;},
mouseleave : function(){rotateSwitch();}
});
$rj(".banner_img").animate({
left: -image_reelPosition
}, 500, function(){
$rj(".banner_num li").removeClass("off on");;
$rj(".banner_num li").attr("rel", imageThisNumber).addClass(function(index, currentClass){
if (index == imageThisNumber){return "on";}else{return "off";}
});
}).bind({
mouseenter : function(){clearInterval(_movie_play); _movie_play = null;},
mouseleave : function(){rotateSwitch();}
});
};
*/
/*
main_banner_click = function(_str){
imageThisNumber = _str-1;
clearInterval(_movie_play);
rotate_fade();
}
*/
/*
//Rotation + Timing Event
rotateSwitch = function(){
clearInterval(_movie_play);
_movie_play = null;
$rj.active = $rj('.banner_num li').next();
imageTotalCount = $rj.active.length;
_movie_play = setInterval(function(){
rotate_fade();
}, _rolling_count);
};
rotateSwitch();
*/
/*main banner slider end*/
/*
2011.10 old version
Login relate
*/
/*
try{
var _userid = $rj("#userid");
var _userpw = $rj("#userpw");
var _submit = $rj("#submit");
var _msgbox = $rj("#msgbox");
var _msgbox_text = $rj("#msgbox_textbox");
var _frm = $rj("#frm");
_userid.live({
load : function(){ _userid.focus();},blur : function(){if(_userid.val() == "" ){_userid.val("Portal ID");}else{_msgbox.fadeOut("fast", function(){ _msgbox_text.html("").css("display","none"); });}},focus : function(){if(_userid.val() == "" || _userid.val() == "Portal ID"){_userid.val("");}}
,keypress : function(e){if(e.which == 13){_userpw.focus();}}
});
_userpw.live({
blur : function(){if(_userpw.val() == "" ){_userpw.val("User Password");}else{_msgbox.fadeOut("fast", function(){ _msgbox_text.html("").css("display","none"); });}}
,focus : function(){if(_userpw.val() == "" || _userpw.val() == "User Password"){_userpw.val("");}}
,keypress : function(e){if(e.which == 13){if(_userid.val() == "" || _userid.val() == "Portal ID"){return;}else{_submit.click();}}}
});
_submit.click(function(e){
if(_userid.val() == "" || _userid.val() == "Portal ID"){
_msgbox.fadeIn("fast", function(){ _msgbox_text.html("Please enter a Portal ID").fadeIn("fast"); $rj(this).delay(1500).fadeOut("fast", function(){ _msgbox_text.css("display","none"); }); }); _userid.focus().val("");
return;
}
if(_userpw.val() == "" || _userpw.val() == "User Password"){
_msgbox.fadeIn("fast", function(){ _msgbox_text.html("Please enter a User Password").fadeIn("fast"); $rj(this).delay(1500).fadeOut("fast", function(){ _msgbox_text.css("display","none"); }); }); _userpw.focus().val("");
return;
}
_msgbox_text.html("Loading...").fadeIn("fast");
_msgbox.fadeIn("fast");
var logincheck = $rj.getJSON("/Login/Login.process.html", _frm.serialize());
logincheck.success(function(data){
if (data.result.returncode == 0){
document.location.reload();
}else{
_msgbox_text.html("Login False
" + data.result.returnmsg.toString()).delay(2000).fadeOut();
_msgbox.delay(2000).fadeOut();
}
});
logincheck.error(function(xhr, ajaxOptions, thrownError){
_msgbox_text.html("Login False
" + xhr.responseText.toString()).delay(2000).fadeOut(); //status
_msgbox.delay(2000).fadeOut();
debug.__debug("Ajax_error : " + xhr.status.toString());
debug.__debug("Ajax_error : " + thrownError);
});
logincheck.complete(function(data, textStatus){
debug.__debug("Ajax_complete : " + textStatus.toString());
});
});
}catch (e){debug.__debug("Error : loginforum { ["+ e +"]");}
*/
/*
2011.11 new version
Login relate
*/
try{
var _userid = $rj("#userid");
var _userpw = $rj("#userpw");
var _submit = $rj("#submit");
var _msgbox = $rj("#msgbox");
var _msgbox_text = $rj("#msgbox_textbox");
var _frm = $rj("#frm");
_userid.live({
load : function(){ _userid.focus();}
,blur : function(){if(_userid.val() == "" ){_userid.val(""); _userid.removeClass("id_off").addClass("id"); }else{_msgbox.fadeOut("fast", function(){ _msgbox_text.html("").css("display","none"); });};}
,focus : function(){if(_userid.val() == ""){_userid.val("");} _userid.removeClass("id").addClass("id_off");}
,keypress : function(e){if(e.which == 13){_userpw.focus();}}
});
_userpw.live({
blur : function(){if(_userpw.val() == "" ){_userpw.val(""); _userpw.removeClass("pw_off").addClass("pw");}else{_msgbox.fadeOut("fast", function(){ _msgbox_text.html("").css("display","none"); });}}
,focus : function(){if(_userpw.val() == ""){_userpw.val("");}; _userpw.removeClass("pw").addClass("pw_off");}
,keypress : function(e){if(e.which == 13){if(_userid.val() == ""){return;}else{_submit.click();}}}
});
_submit.click(function(e){
if(_userid.val() == ""){
_msgbox.fadeIn("fast", function(){ _msgbox_text.html("Please enter a Portal ID").fadeIn("fast"); $rj(this).delay(1500).fadeOut("fast", function(){ _msgbox_text.css("display","none"); }); }); _userid.focus().val("");
return;
}
if(_userpw.val() == ""){
_msgbox.fadeIn("fast", function(){ _msgbox_text.html("Please enter a User Password").fadeIn("fast"); $rj(this).delay(1500).fadeOut("fast", function(){ _msgbox_text.css("display","none"); }); }); _userpw.focus().val("");
return;
}
_msgbox_text.html("Loading...").fadeIn("fast");
_msgbox.fadeIn("fast");
//var logincheck = $rj.getJSON("/Login/Login.process.html", _frm.serialize());
var logincheckbtn = $rj.post(S_domain.__PortalHttps + "/Login/Login.process.html", _frm.serialize(), function(response){}, 'json');
logincheck.success(function(data){
if (data.result.returncode == 0){
document.location.reload();
}else{
_msgbox_text.html("Login False
" + data.result.returnmsg.toString()).delay(2000).fadeOut();
_msgbox.delay(2000).fadeOut();
}
});
logincheck.error(function(xhr, ajaxOptions, thrownError){
_msgbox_text.html("Login False
" + xhr.responseText.toString()).delay(2000).fadeOut();
_msgbox.delay(2000).fadeOut();
debug.__debug("Ajax_error : " + xhr.status.toString());
debug.__debug("Ajax_error : " + thrownError);
});
logincheck.complete(function(data, textStatus){
debug.__debug("Ajax_complete : " + textStatus.toString());
});
});
}catch (e){debug.__debug("Error : loginforum { ["+ e +"]");}
/*main game moving up*/
/*
$rj("#GameInfo1").bind({
mouseenter : function(){ $rj("#GameInfo1").animate({'marginTop' : -252 }); },
mouseleave : function(){ $rj("#GameInfo1").animate({'marginTop' : 0 }); }
});
$rj("#GameInfo2").bind({
mouseenter : function(){ $rj("#GameInfo2").animate({'marginTop' : -252 }); },
mouseleave : function(){ $rj("#GameInfo2").animate({'marginTop' : 0 }); }
});
$rj("#GameInfo3").bind({
mouseenter : function(){ $rj("#GameInfo3").animate({'marginTop' : -252 }); },
mouseleave : function(){ $rj("#GameInfo3").animate({'marginTop' : 0 }); }
});
$rj("#GameInfo4").bind({
mouseenter : function(){ $rj("#GameInfo4").animate({'marginTop' : -252 }); },
mouseleave : function(){ $rj("#GameInfo4").animate({'marginTop' : 0 }); }
});
$rj("#GameInfo5").bind({
mouseenter : function(){ $rj("#GameInfo5").animate({'marginTop' : -252 }); },
mouseleave : function(){ $rj("#GameInfo5").animate({'marginTop' : 0 }); }
});
*/
/*Main Movie click*/
/*
$rj(".movie_click").click(function(){
$rj(this).find("li").first().fadeOut(1);
$rj(this).find("li").last().fadeIn("slow");
});
*/
/*face book url*/
var __FB_SERVER_IFRAME = document.getElementById("FB_SERVER_IFRAME"); //$rj("FB_SERVER_IFRAME");
var __FB_SERVER_IFRAME_URL = parent.location.protocol + "//www.connect.facebook.com/widgets/fan.php?api_key=b54c26dbb87691ae0735cd4e111f81a7&channel_url=http%3A%2F%2Fwww.playrohan.com%2Findex.html%3Ffbc_channel%3D1&id=11194836817&name=&width=230&connections=4&stream=0&logobar=0&css=http%3A%2F%2Fportal.playrohan.com%2FCommon%2FCss%2Ffb.css?1";
//var __FB_SERVER_IFRAME_URL = parent.location.protocol + "//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FRohan-Blood-Feud%2F11194836817&width=230&colorscheme=dark&show_faces=true&border_color&stream=false&header=false&height=62&css=http%3A%2F%2Fsealonline.dontblynk.com%2FCommon%2FCss%2Fseal%2Ffb.css?1";
/////// <- useful facebook __FB_SERVER_IFRAME.src = __FB_SERVER_IFRAME_URL;
/*main notice*/
try{
$rj.each($rj('.announce div'), function(i,item){
if(i != 0){ //all notice
$rj("dd", this).css("display", "none");
}
var ddtitle = $rj("dd", this);
$rj("dt", this).click(function(e){
noticehiddens();
ddtitle.slideDown("slow");
$rj(this).removeClass("close").addClass("view");
});
if(i == 0){ //first notice
$rj("dt:first-child", this).removeClass("close").addClass("view");
}
});
}catch(e){}
function noticehiddens(){
try{
$rj.each($rj('.announce div'), function(i,item){
$rj("dt", this).removeClass("view").addClass("close");
$rj("dd", this).slideUp("slow");
});
}catch(e){}
}
});
/*option*/
var btn_option = function(t, obj){
if (t==0){obj.className='announce off';}
else{obj.className='announce on';}
}
var btn_viewannounce = function (_seq){
if (_seq > 0){ document.location.href = S_domain.__PortalHttp + "/Community/announcements-detail.html?seq="+ _seq +"&page=1"
}
}
/*movie control*/
var onYouTubePlayerReady = function (playerId) {
ytplayer = document.getElementById("my"+playerId);
}
var stopVideo = function (whichway){
ytplayer = document.getElementById("myytplayer" + cposition);
if( whichway == 0 ){
cposition = cposition - 1;
}else{
cposition = cposition + 1;
}
if (ytplayer) {
if( typeof ytplayer.pauseVideo === "function"){ ytplayer.pauseVideo(); }
}
}
/*button*/
var btn_rps_sale = function(){
document.location.href = S_domain.__PortalHttps + "/Point/";
}
var btn_facebook_event = function(){
window.open("http://www.facebook.com/pages/Rohan-Blood-Feud/11194836817?sk=events");
}
var btn_Free_sing_up = function(){
document.location.href = S_domain.__PortalHttps + "/Member/Register/Register.html";
}
var btn_rps_add = function(){
document.location.href = S_domain.__PortalHttps + "/Point/";
}
var btn_findID = function(){
document.location.href = S_domain.__PortalHttps + "/Member/Helper/FindID.html";
}
var btn_findPW = function(){
document.location.href = S_domain.__PortalHttps + "/Member/Helper/FindPW.html";
}
var btn_announcements = function(){
document.location.href = S_domain.__PortalHttp + "/Community/index.html";
}
var btn_accountOverView = function(){
document.location.href = S_domain.__PortalHttps + "/Member/Account/info.html";
}
var btn_passwordChenge = function(){
document.location.href = S_domain.__PortalHttps + "/Member/Account/ChangePassword_qna.html";
}
var btn_History_RPs = function(){
document.location.href = S_domain.__PortalHttps + "/Point/History_RPs.html";
}
var btn_Convert_RPs = function(){
js_util_top.__Exchange();
}