
function urldecode(str){return decodeURIComponent(str.replace(/\+/g,'%20'));}
$(document).ready(function(){$("#journal_posts .show_post_edit").click(function(){var target=$(this).parents(".show_post_author_date");target=$(target).nextAll(".post_form");target.fadeToggle();return false;});});function reply_post(post_id,post_submit)
{document.getElementById("post_process_"+post_id).value='newpost';document.getElementById("post_content_"+post_id).innerHTML='';document.getElementById("post_submit_"+post_id).value=post_submit;}
function edit_post(post_id,post_content,post_submit)
{document.getElementById("post_process_"+post_id).value='editpost';document.getElementById("post_content_"+post_id).innerHTML=urldecode(post_content);document.getElementById("post_submit_"+post_id).value=post_submit;}
function edit_reply(comment_id,comment_content,comment_submit)
{document.getElementById("comment_process_"+comment_id).value='editcomment';document.getElementById("comment_content_"+comment_id).innerHTML=urldecode(comment_content);document.getElementById("comment_submit_"+comment_id).value=comment_submit;}
function urldecode(str){return decodeURIComponent(str.replace(/\+/g,'%20'));}
$(document).ready(function(){$(".comment_reply_link").click(function(){var target=$(this).parents(".comment");target=$(target).next("div").next("div");target.fadeToggle();target2=$(target).find("div.comment_status");target2.hide();return false;});$(".comment_edit_link").click(function(){var target=$(this).parents(".comment");target=$(target).next("div").next("div");target.fadeToggle();target2=$(target).find("div.comment_status");target2.show();return false;});$(".comment_show_hide").click(function(){var target=$(this).parents(".comment_header");target=$(target).next("div").next("div");target.fadeToggle();target2=$(target).find("div.comment_status");target2.show();return false;});});function reply_comment(baseurl,comment_id,comment_submit)
{document.getElementById("comment_process_"+comment_id).value='newcomment';document.getElementById("comment_content_"+comment_id).innerHTML='';document.getElementById("comment_submit_"+comment_id).value=comment_submit;}
function edit_comment(baseurl,comment_id,comment_content,comment_submit)
{document.getElementById("comment_process_"+comment_id).value='editcomment';document.getElementById("comment_content_"+comment_id).innerHTML=urldecode(comment_content);document.getElementById("comment_submit_"+comment_id).value=comment_submit;}
jQuery('document').ready(function($){$(".widget_onoff").click(function(){$.fn.widget_onoff($(this));});});$.fn.widget_onoff=function(widget){var currentId=widget.attr("id");var widget_image=widget.children("img").attr("src");this.widget_image=$(widget_image);var action='';var image_names=widget_image.split('/');var image_name=image_names[image_names.length-1];if(image_name=="active.png"){action='disable';}else{action='enable';}
var formdata='plugin=widgets&action='+action+'&widget='+currentId;var sendurl=BASEURL+'content/plugins/widgets/widgets_functions.php';$.ajax({type:'post',url:sendurl,data:formdata,beforeSend:function(){widget.html('<img src="'+BASEURL+"content/admin_themes/"+ADMIN_THEME+'images/ajax-loader.gif'+'"/>');},error:function(XMLHttpRequest,textStatus,errorThrown){},success:function(data,textStatus){if(data.error===true){}
else
{var img_src="";if(data.enabled=='true'){img_src="active.png";}else{img_src="inactive.png";}
widget.html('<img src="'+BASEURL+"content/admin_themes/"+ADMIN_THEME+'images/'+img_src+'"/>');}
$('#return_message').html(data.message).addClass(data.color);$('#return_message').html(data.message).addClass('message');$('#return_message').fadeIn(1000).fadeout(1000);},dataType:"json"});}
$.fn.widget_order=function(widget){var currentId=widget.attr("id");var action=widget.attr("class");action=action.split("_");action="order_"+action[action.length-1];if(action=="up"){}else{}
var formdata='plugin=widgets&action='+action+'&widget='+currentId;var sendurl=BASEURL+'content/plugins/widgets/widgets_functions.php';$.ajax({type:'post',url:sendurl,data:formdata,beforeSend:function(){widget.html('<img src="'+BASEURL+"content/admin_themes/"+ADMIN_THEME+'images/ajax-loader.gif'+'"/>');},error:function(XMLHttpRequest,textStatus,errorThrown){widget.html('ERROR');},success:function(data,textStatus){if(data.error===true){}
else
{}
$('#return_message').html(data.message).addClass(data.color);$('#return_message').html(data.message).addClass('message');$('#return_message').css({display:"none"}).fadeIn(1000).delay(5000).fadeout(1000);},dataType:"json"});}
jQuery('document').ready(function($){BASEURL='http://journals.hotarucms.org/';ADMIN_THEME='admin_default/';THEME='journals-demo/';});
var xmlhttp=false;if(!xmlhttp&&typeof XMLHttpRequest!='undefined')
{try{xmlhttp=new XMLHttpRequest();}
catch(e){xmlhttp=false}}
function myXMLHttpRequest()
{var xmlhttplocal;if(!xmlhttplocal&&typeof XMLHttpRequest!='undefined'){try{var xmlhttplocal=new XMLHttpRequest();}
catch(e){var xmlhttplocal=false;}}
return(xmlhttplocal);}
var ajax=Array();var returnvalue=Array();jQuery.fn.fadeToggle=function(speed,easing,callback){return this.animate({opacity:'toggle'},speed,easing,callback);};$(document).ready(function(){$(".message").css({display:"none"}).fadeIn(1000);$(".table_drop_down").click(function(){var target=$(this).parents("tr").next("tr");target.fadeToggle();return false;});$(".table_hide_details").click(function(){$(this).parents("tr.table_tr_details").fadeOut();return false;});$(".forgot_password").click(function(){var target=$(this).next("form");target.fadeToggle();return false;});});$.extend({URLEncode:function(c){var o='';var x=0;c=c.toString();var r=/(^[a-zA-Z0-9_.]*)/;while(x<c.length){var m=r.exec(c.substr(x));if(m!=null&&m.length>1&&m[1]!=''){o+=m[1];x+=m[1].length;}else{if(c[x]==' ')o+='+';else{var d=c.charCodeAt(x);var h=d.toString(16);o+='%'+(h.length<2?'0':'')+h.toUpperCase();}x++;}}return o;},URLDecode:function(s){var o=s;var binVal,t;var r=/(%[^%]{2})/;while((m=r.exec(o))!=null&&m.length>1&&m[1]!=''){b=parseInt(m[1].substr(1),16);t=String.fromCharCode(b);o=o.replace(m[1],t);}return o;}});function handleEnter(field,event){var keyCode=event.keyCode?event.keyCode:event.which?event.which:event.charCode;if(keyCode==13){return false;}
else
return true;}
