// All this Java Script
// Be Find By Vaflan
// And Edited By Vaflan

function hidden(curobj) {
    if(document.getElementById(curobj)) {
        folder=document.getElementById(curobj).style;
    }
    else {
        if(ns6==1||operaaa==true) {folder=curobj.nextSibling.nextSibling.style;}
        else {folder=document.all[curobj.sourceIndex+1].style;}
    }
    if(folder.display=="none") {folder.display="";}
    else {folder.display="none";}
}




////////////////////////////////////////////////




function confirmLink(theLink, theQuery) {
    if(typeof(window.opera) != 'undefined') {
        return true;//script_by_vaflan
    }
    var is_confirmed = confirm(theQuery);
    if(is_confirmed) {
        if(typeof(theLink.href) != 'undefined' ) {theLink.href;} 
        else if (typeof(theLink.form) != 'undefined') {theLink.form.action;}
    }
    return is_confirmed;
}




////////////////////////////////////////////////




function CheckLeng(Target,MaxLength) {
 if(Target.value.length > MaxLength) {
  document.new_request.msg.value = document.new_request.msg.value.substr(0,MaxLength);
 }
}




/////////////////////////////////////////////////////////////////




function reload() {
 now = new Date(); reloadtimeout = now.getSeconds();
 ajax_loadContent("reload","reload.php?r="+reloadtimeout,'<!-- Reload Done -->');
 setTimeout("reload()", 30000);
}




/////////////////////////////////////////////////////////////////




var titlenum = 1;
function writetitle() {
 if(titlenum==1) {
  titlenum = 2;
  document.title = '***MESSAGE***';
 }
 else if(titlenum==2) {
  titlenum = 3;
  document.title = '************';
 }
 else if(titlenum==3) {
  titlenum = 0;
  document.title = '***PODRIV***';
 }
 else {
  titlenum = 1;
  document.title = '***********';
 }
 setTimeout("writetitle()", 1000);
}




/////////////////////////////////////////////////////////////////




function SubmitWithKey(form,e) {
 if(e) {event = e;}
 if(event.which) {
  pressed = event.which;
 }
 if(event.keyCode) {
  pressed = event.keyCode;
 }

 if(pressed == 17) {pressed_kesh = 17;}
 if(pressed == 13) {pressed_kesh = pressed_kesh + '13';}

 if(pressed_kesh == '1713') {
  pressed_kesh = '';
  document.getElementById(form).submit();
  return true;
 }
 else {
  return true;
 }
}




/////////////////////////////////////////////////////////////////




