



// Custom insert link callback, extends the link function

function customInsertLink(href, target) {

  var result = new Array();



  alert("customInsertLink called href: " + href + " target: " + target);



  result['href'] = "http://www.sourceforge.net";

  result['target'] = '_blank';



  return result;

}



// Custom insert image callback, extends the image function

function customInsertImage(src, alt, border, hspace, vspace, width, height, align) {

  var result = new Array();



  var debug = "CustomInsertImage called:\n"

  debug += "src: " + src + "\n";

  debug += "alt: " + alt + "\n";

  debug += "border: " + border + "\n";

  debug += "hspace: " + hspace + "\n";

  debug += "vspace: " + vspace + "\n";

  debug += "width: " + width + "\n";

  debug += "height: " + height + "\n";

  debug += "align: " + align + "\n";

  alert(debug);



  result['src'] = "logo.jpg";

  result['alt'] = "test description";

  result['border'] = "2";

  result['hspace'] = "5";

  result['vspace'] = "5";

  result['width'] = width;

  result['height'] = height;

  result['align'] = "right";



  return result;

}



// Custom save callback, gets called when the contents is to be submitted

function customSave(id, content) {

  alert(id + "=" + content);

}



<!-- /tinyMCE -->



function Validator(frmname)

{

  this.formobj=document.forms[frmname];

  if(!this.formobj)

  {

    alert("BUG: couldnot get Form object "+frmname);

    return;

  }

  if(this.formobj.onsubmit)

  {

    this.formobj.old_onsubmit = this.formobj.onsubmit;

    this.formobj.onsubmit=null;

  }

  else

  {

    this.formobj.old_onsubmit = null;

  }

  this.formobj.onsubmit=form_submit_handler;

  this.addValidation = add_validation;

  this.setAddnlValidationFunction=set_addnl_vfunction;

  this.clearAllValidations = clear_all_validations;

}

function set_addnl_vfunction(functionname)

{

  this.formobj.addnlvalidation = functionname;

}

function clear_all_validations()

{

  for(var itr=0;itr < this.formobj.elements.length;itr++)

  {

      this.formobj.elements[itr].validationset = null;

    }

}

function form_submit_handler()

{

  for(var itr=0;itr < this.elements.length;itr++)

  {

      if(this.elements[itr].validationset &&

        !this.elements[itr].validationset.validate())

        {

        return false;

      }

    }

  if(this.addnlvalidation)

  {

    str =" var ret = "+this.addnlvalidation+"()";

    eval(str);

    if(!ret) return ret;

  }

  return true;

}

function add_validation(itemname,descriptor,errstr)

{

  if(!this.formobj)

  {

    alert("BUG: the form object is not set properly");

    return;

  }//if

  var itemobj = this.formobj[itemname];

  if(!itemobj)

  {

    alert("BUG: Couldnot get the input object named: "+itemname);

    return;

  }

  if(!itemobj.validationset)

  {

    itemobj.validationset = new ValidationSet(itemobj);

  }

  itemobj.validationset.add(descriptor,errstr);

}

function ValidationDesc(inputitem,desc,error)

{

  this.desc=desc;

  this.error=error;

  this.itemobj = inputitem;

  this.validate=vdesc_validate;

}

function vdesc_validate()

{

  if(!V2validateData(this.desc,this.itemobj,this.error))

  {

    this.itemobj.focus();

    return false;

  }

  return true;

}

function ValidationSet(inputitem)

{

  this.vSet=new Array();

  this.add= add_validationdesc;

  this.validate= vset_validate;

  this.itemobj = inputitem;

}

function add_validationdesc(desc,error)

{

  this.vSet[this.vSet.length]=

  new ValidationDesc(this.itemobj,desc,error);

}

function vset_validate()

{

  for(var itr=0;itr<this.vSet.length;itr++)

  {

      if(!this.vSet[itr].validate())

      {

        return false;

      }

    }

  return true;

}

function validateEmailv2(email)

{

  // a very simple email validation checking.

  // you can add more complex email checking if it helps

  if(email.length <= 0)

  {

    return true;

  }

  var splitted = email.match("^(.+)@(.+)$");

  if(splitted == null) return false;

  if(splitted[1] != null )

  {

    var regexp_user=/^\"?[\w-_\.]*\"?$/;

    if(splitted[1].match(regexp_user) == null) return false;

  }

  if(splitted[2] != null)

  {

    var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;

    if(splitted[2].match(regexp_domain) == null)

    {

      var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;

      if(splitted[2].match(regexp_ip) == null) return false;

    }// if

    return true;

  }

  return false;

}

function V2validateData(strValidateStr,objValue,strError) 

{ 

  var epos = strValidateStr.search("="); 

  var  command  = ""; 

  var  cmdvalue = ""; 

  if(epos >= 0) 

  { 

    command  = strValidateStr.substring(0,epos);

    cmdvalue = strValidateStr.substr(epos+1);

  } 

  else 

  { 

    command = strValidateStr;

  } 

  switch(command) 

  { 

    case "req": 

    case "required":

    {

        if(eval(objValue.value.length) == 0)

        {

          if(!strError || strError.length ==0)

          {

            strError = objValue.name + " : Required Field";

          }//if

          alert(strError);

          return false;

        }//if

        break;

      }//case required

    case "maxlength": 

    case "maxlen":

    {

        if(eval(objValue.value.length) >  eval(cmdvalue))

        {

          if(!strError || strError.length ==0)

          {

            strError = objValue.name + " : "+cmdvalue+" characters maximum ";

          }//if

          alert(strError + "\n[Current length = " + objValue.value.length + " ]");

          return false;

        }//if

        break;

      }//case maxlen

    case "minlength": 

    case "minlen":

    {

        if(eval(objValue.value.length) <  eval(cmdvalue))

        {

          if(!strError || strError.length ==0)

          {

            strError = objValue.name + " : " + cmdvalue + " characters minimum  ";

          }//if

          alert(strError + "\n[Current length = " + objValue.value.length + " ]");

          return false;

        }//if

        break;

      }//case minlen 

    case "alnum": 

    case "alphanumeric":

    {

        var charpos = objValue.value.search("[^A-Za-z0-9]");

        if(objValue.value.length > 0 &&  charpos >= 0)

        {

          if(!strError || strError.length ==0)

          {

            strError = objValue.name+": Only alpha-numeric characters allowed ";

          }//if

          alert(strError + "\n [Error character position " + eval(charpos+1)+"]");

          return false;

        }//if

        break;

      }//case alphanumeric

    case "num": 

    case "numeric":

    {

        var charpos = objValue.value.search("[^0-9]");

        if(objValue.value.length > 0 &&  charpos >= 0)

        {

          if(!strError || strError.length ==0)

          {

            strError = objValue.name+": Only digits allowed ";

          }//if

          alert(strError + "\n [Error character position " + eval(charpos+1)+"]");

          return false;

        }//if

        break;

      }//numeric

    case "alphabetic": 

    case "alpha":

    {

        var charpos = objValue.value.search("[^A-Za-z]");

        if(objValue.value.length > 0 &&  charpos >= 0)

        {

          if(!strError || strError.length ==0)

          {

            strError = objValue.name+": Only alphabetic characters allowed ";

          }//if

          alert(strError + "\n [Error character position " + eval(charpos+1)+"]");

          return false;

        }//if

        break;

      }//alpha

    case "alnumhyphen":

    {

        var charpos = objValue.value.search("[^A-Za-z0-9\-_]");

        if(objValue.value.length > 0 &&  charpos >= 0)

        {

          if(!strError || strError.length ==0)

          {

            strError = objValue.name+": characters allowed are A-Z,a-z,0-9,- and _";

          }//if

          alert(strError + "\n [Error character position " + eval(charpos+1)+"]");

          return false;

        }//if

        break;

      }

    case "email":

    {

        if(!validateEmailv2(objValue.value))

        {

          if(!strError || strError.length ==0)

          {

            strError = objValue.name+": Enter a valid Email address ";

          }//if

          alert(strError);

          return false;

        }//if

        break;

      }//case email

    case "lt": 

    case "lessthan":

    {

        if(isNaN(objValue.value))

        {

          alert(objValue.name+": Should be a number ");

          return false;

        }//if

        if(eval(objValue.value) >=  eval(cmdvalue))

        {

          if(!strError || strError.length ==0)

          {

            strError = objValue.name + " : value should be less than "+ cmdvalue;

          }//if

          alert(strError);

          return false;

        }//if

        break;

      }//case lessthan

    case "gt": 

    case "greaterthan":

    {

        if(isNaN(objValue.value))

        {

          alert(objValue.name+": Should be a number ");

          return false;

        }//if

        if(eval(objValue.value) <=  eval(cmdvalue))

        {

          if(!strError || strError.length ==0)

          {

            strError = objValue.name + " : value should be greater than "+ cmdvalue;

          }//if

          alert(strError);

          return false;

        }//if

        break;

      }//case greaterthan

    case "regexp":

    {

        if(objValue.value.length > 0)

        {

          if(!objValue.value.match(cmdvalue))

          {

            if(!strError || strError.length ==0)

            {

              strError = objValue.name+": Invalid characters found ";

            }//if

            alert(strError);

            return false;

          }//if

        }

        break;

      }//case regexp

    case "dontselect":

    {

        if(objValue.selectedIndex == null)

        {

          alert("BUG: dontselect command for non-select Item");

          return false;

        }

        if(objValue.selectedIndex == eval(cmdvalue))

        {

          if(!strError || strError.length ==0)

          {

            strError = objValue.name+": Please Select one option ";

          }//if

          alert(strError);

          return false;

        }

        break;

      }//case dontselect

  }//switch 

  return true; 

}







// Login Pic Handler

function login( email , pass )

{





  document.getElementById( "login_1" ).style.visibility="hidden";

  document.getElementById( "log_status" ).innerHTML ="<center><br />Checking...<br /><img src='images/ajax-loader.gif' /><br /></center>";

  new ajax ('login_scr.php', {
    postBody: 'mode=log_in_jax&email='+ email +'&password='+ pass +' ' ,
    update: $( "mye" ),
    onComplete: loginRes
  });

  function loginRes(request){

	

    if(request.responseText == 0){

      document.getElementById( "log_status" ).style.display= 'none';

      document.getElementById( "login_1" ).style.visibility="visible";

      alert("Access Denied, please try again..");

    }else{

      document.getElementById( "log_status" ).innerHTML ="<center><br />Checking...<br /><img src='images/ajax-loader.gif' /><br /></center>";



      window.location.reload();

    }

  //document.getElementById("login").innerHTML = request.responseText ;

  //	alert(request.responseText);

  //	window.location.reload();

  }

}



/**
     * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
     */

function echeck(str) {

  var at = "@";
  var dot=".";
  var lat=str.indexOf(at)
  var lstr=str.length
  var ldot=str.indexOf(dot)
  if (str.indexOf(at)==-1){
    alert("Invalid E-mail ID")
    return false;
  }

  if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
    alert("Invalid E-mail ID")
    return false;
  }

  if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
    alert("Invalid E-mail ID")
    return false;
  }

  if (str.indexOf(at,(lat+1))!=-1){
    alert("Invalid E-mail ID")
    return false;
  }

  if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
    alert("Invalid E-mail ID")
    return false;
  }

  if (str.indexOf(dot,(lat+2))==-1){
    alert("Invalid E-mail ID")
    return false;
  }

  if (str.indexOf(" ")!=-1){
    alert("Invalid E-mail ID")
    return false;
  }

  return true;
}




//Approve SEND CONTACT

function sendContact( name, email , subject, message, topic )
{

  if(!checkMailValid(email)){
    alert('Insert a valid email!');
    return false;
  }

  document.getElementById( "contact" ).innerHTML ="<center><br /><br /><br /><br />Sending...<br /><img src='images/ajax-loader2.gif' /><br /><br /></center>";
  document.getElementById( "contact" ).style.height = "200px";

  new ajax ('proMan.php', {
    postBody: 'mode=send_contact&name='+ name +'&email='+ email +'&topic='+ topic +'&subject='+ subject +'&message='+ message +'',
    update: $('mye'),
    onComplete: apprUcommentRes
  });

  function apprUcommentRes(request){

    document.getElementById( "contact" ).innerHTML = "<center><br /><br /><br />Thank You!<br /><b>Your message has been sent!!</b></center>" ;
    return true;
  //document.getElementById( id ).style.display= 'none';
  //window.location.reload();
  }



}


function checkMailValid(email){
  var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  if (filter.test(email)) {
    return true;
  }
  return false;
}






/*	

// make Friends handler

 */

function makefriends( id )

{

  document.getElementById("status_report").innerHTML ="Working...";

  new ajax ('proMan.php', {
    postBody: 'mode=make_friends&id='+ id +'',
    update: $( "status_report" ),
    onComplete: makeFriendsRes
  });

  function makeFriendsRes(request){

    document.getElementById("status_report").style.color="#FF0000";

    document.getElementById("status_report").innerHTML = request.responseText ;



  }

}





/*	

// make Friends handler

 */



function blockuser( id )

{

  //alert(id);

  var erase= confirm("Do you really want to block this user?");

  if (erase == true)

  {



    document.getElementById("status_report").innerHTML ="Working...";

    new ajax ('proMan.php', {
      postBody: 'mode=block_user&id='+ id +'',
      update: $( "status_report" ),
      onComplete: blockUserRes
    });

  }

  function blockUserRes(request){



    document.getElementById("status_report").style.color="#993300";

    //document.getElementById("status_report").style.font-weight ="bold";

    //document.getElementById("status_report").style.border-style = "double";

    //document.getElementById("status_report").style.text-align="center";

    //document.getElementById("status_report").style.padding="5px";

    //document.getElementById("status_report").style.background-color= "#993300";

    document.getElementById("status_report").innerHTML ="<style=style.background-color= '#993300' "+request.responseText+"</style> " ;





  }

}

	

//Erase Pic Handler

function erase( id, img )

{

  var erase= confirm("Do you really want to delete this image?");

  if (erase == true)

  {

    document.getElementById( id ).innerHTML ="<center><br /><br /><img src='images/ajax-loader.gif' /><br /><br /></center>";

    document.getElementById( id ).style.height = "120px";



    new ajax ('picMan.php', {
      postBody: 'mode=del&id='+ id +'&img='+ img +'',
      update: $('mye'),
      onComplete: delRes
    });

  } // end of the IF

  function delRes(request){

    document.getElementById( id ).innerHTML ="Complete...";

    document.getElementById( id ).style.display = "none";

  //alert(request.responseText);

  //window.location.reload();

  }



}



//Edit Pic redirector

function editPic( id, img )

{

  window.location="editPic.php?id="+ id +"";

}





//Default pic handler

function setMain( id )

{

  document.getElementById( id ).innerHTML ="Updating...";

  new ajax ('picMan.php', {
    postBody: 'mode=set_main&id='+ id +'',
    update: $( id ),
    onComplete: setMainRes
  });

  function setMainRes(request){

    document.getElementById( id ).innerHTML ="Image Set as Default!";

    window.location.reload();

  //document.getElementById("caption").innerHTML = request.responseText ;

  }

}



// Censor Pic Handler

function censor_img ( id , mode )

{

  document.getElementById( id ).innerHTML ="<center><br />Working...<br /><img src='images/ajax-loader.gif' /><br /><br /></center>";

  new ajax ('picMan.php', {
    postBody: 'mode=censor&id='+ id +'&r='+ mode +' ' ,
    update: $( id ),
    onComplete: censorRes
  });

  function censorRes(request){

    document.getElementById( id ).innerHTML = request.responseText ;

  //window.location.reload();

  }

}

	

//Erase Email handler

function deletemail( id )

{

  var erase= confirm("Do you really want to delete this Email");

  if (erase == true)

  {

    new ajax ('mailMan.php', {
      postBody: 'mode=del_mail&id='+ id +'',
      update: $('mye'),
      onComplete: delMailRes
    });

  } // end of the IF

  function delMailRes(request){

    window.location="mail.php?del=true";

  }



}



//Submit Comment

function sendComment( comment , sender , id )

{

  document.getElementById( "comment_status" ).innerHTML ="Working...";

  new ajax ('proMan.php', {
    postBody: 'mode=send_comment&id='+ id +'&comment='+ comment +'&sender='+ sender +' ',
    update: $( id ),
    onComplete: sendCommentRes
  });

  function sendCommentRes(request){

    document.getElementById( "comment_status" ).innerHTML = request.responseText;

  }

}



//Submit Comment FOR PIC

function sendPicComment( comment ,owner, sender , id )

{



  document.getElementById( "comment_status" ).innerHTML ="Working...";

  new ajax ('picMan.php', {
    postBody: 'mode=send_pic_comment&id='+ id +'&comment='+ comment +'&sender='+sender+'&owner='+owner+' ',
    update: $( id ),
    onComplete: sendCommentRes
  });

  function sendCommentRes(request){

    document.getElementById( "comment_status" ).innerHTML = request.responseText;

  }

}





//Delete Friend

function delFriend( id , friendID )

{

  var erase= confirm("Do you really want to delete this friend");

  if (erase == true)

  {

    document.getElementById( id ).innerHTML ="<center><br />Deleting..<br /><img src='images/ajax-loader2.gif' /><br /><br /></center>";



    new ajax ('proMan.php', {
      postBody: 'mode=del_friend&id='+ id +'&friend_id='+ friendID +' ',
      update: $('mye'),
      onComplete: delFriendRes
    });

  } // end of the IF

  function delFriendRes(request){

    //	alert(id);

    document.getElementById( id ).style.display= 'none';

	

  }

}







//Approve Friend

function apprFriend( id , approver )

{



  document.getElementById( id ).innerHTML ="<center><br />Working...<br /><img src='images/ajax-loader.gif' /><br /><br /></center>";



  new ajax ('proMan.php', {
    postBody: 'mode=appr_friend&id='+ id +'&approver='+ approver +'',
    update: $('mye'),
    onComplete: delFriendRes
  });



  function delFriendRes(request){

    window.location.reload();

  }



}



//Approve Coment

function apprUcomment( id )

{



  document.getElementById( id ).innerHTML ="<center><br /><br />Approving...<br /><img src='images/ajax-loader2.gif' /><br /><br /></center>";

  document.getElementById( id ).style.height = "150px";



  new ajax ('proMan.php', {
    postBody: 'mode=appr_Ucomment&id='+ id +'',
    update: $('mye'),
    onComplete: apprUcommentRes
  });



  function apprUcommentRes(request){



    document.getElementById( id ).innerHTML = request.responseText ;

    document.getElementById( id ).style.display= 'none';

  ;

  }



}

//Approve Picture Comment

function apprPcomment( id )

{



  document.getElementById( id ).innerHTML ="<center><br /><br />Approving...<br /><img src='images/ajax-loader2.gif' /><br /><br /></center>";

  document.getElementById( id ).style.height = "150px";



  new ajax ('proMan.php', {
    postBody: 'mode=appr_Pcomment&id='+ id +'',
    update: $('mye'),
    onComplete: apprUcommentRes
  });



  function apprUcommentRes(request){



    document.getElementById( id ).innerHTML = request.responseText ;

    document.getElementById( id ).style.display= 'none';



  }



}







//Delete Comment

function delBlock( id )

{

	

  var erase= confirm("Do you really want to unblock this user?");

  if (erase == true)

  {

    document.getElementById( id ).innerHTML ="<center><br /><br />Deleting...<br /><img src='images/ajax-loader.gif' /><br /><br /></center>";

    document.getElementById( id ).style.height = "150px";



    new ajax ('proMan.php', {
      postBody: 'mode=del_block&id='+ id +'',
      update: $('mye'),
      onComplete: delCommentRes
    });

  } // end of the IF

  function delCommentRes(request){

    document.getElementById( id ).style.display= 'none';

  }

}







//Delete Comment

function delComment( id )

{

  //	alert(id);

  var erase= confirm("Do you really want to delete this comment");

  if (erase == true)

  {

    document.getElementById( id ).innerHTML ="<center><br /><br />Deleting...<br /><img src='images/ajax-loader2.gif' /><br /><br /></center>";

    document.getElementById( id ).style.height = "150px";



    new ajax ('proMan.php', {
      postBody: 'mode=del_comment&id='+ id +'',
      update: $('mye'),
      onComplete: delCommentRes
    });

  } // end of the IF

  function delCommentRes(request){

    //	alert(id);

    document.getElementById( id ).style.display= 'none';

  //alert("Friend Deleted");

  }



}





//Delete PIcture Comment

function delPComment( id )

{

  //	alert(id);

  var erase= confirm("Do you really want to delete this comment");

  if (erase == true)

  {

    document.getElementById( id ).innerHTML ="<center><br /><br />Deleting...<br /><img src='images/ajax-loader2.gif' /><br /><br /></center>";

    document.getElementById( id ).style.height = "150px";



    new ajax ('proMan.php', {
      postBody: 'mode=del_Pcomment&id='+ id +'',
      update: $('mye'),
      onComplete: delCommentRes
    });

  } // end of the IF

  function delCommentRes(request){

    //	alert(id);

    document.getElementById( id ).style.display= 'none';

  //alert("Friend Deleted");

  }



}

//  Send Password

function sendPass( email )

{

  document.getElementById( "sendpass" ).style.visibility="hidden";

  document.getElementById("status" ).style.visibility = "visible";

  document.getElementById("status" ).style.height = "100px";

  document.getElementById( "status" ).innerHTML ="<center><br />Checking...<br /><img src='images/ajax-loader2.gif' /><br /></center>";



  new ajax ('proMan.php', {
    postBody: 'mode=send_pass&email='+ email +'' ,
    update: $( "mye" ),
    onComplete: sendRes
  });

  function sendRes(request){

    if(request.responseText == 1){

      document.getElementById("status" ).style.height = "100px";

      document.getElementById( "status" ).innerHTML ="<center><br />Sorry...<br />Your Email is not in our database.<br />You can try again.</center>";

      document.getElementById( "sendpass" ).style.visibility="visible";

		

    }else{

      document.getElementById( "status" ).innerHTML ="<center><br />Success!!<br />Your password has been sent to your email address<br /><a href=\"login.php\">Go To Login</a></center>";



    }



  }

}





//  Send Password





function showPass2()

{

  document.getElementById( "changepass" ).style.display="block";

  document.getElementById("changepass" ).style.height = "100px";

  document.getElementById( "status" ).innerHTML ="<center><br />Checking...<br /><img src='images/ajax-loader2.gif' /><br /></center>";



  new ajax ('proMan.php', {
    postBody: 'mode=send_pass&email='+ email +'' ,
    update: $( "mye" ),
    onComplete: sendRes
  });

  function sendRes(request){

    if(request.responseText == 1){

      document.getElementById("status" ).style.height = "100px";

      document.getElementById( "status" ).innerHTML ="<center><br />Sorry...<br />Your Email is not in your database.<br />You can try again.</center>";

      document.getElementById( "sendpass" ).style.visibility="visible";

		

    }else{

      document.getElementById( "status" ).innerHTML ="<center><br />Success!!<br />Your password has been sent to your email address<br /><a href=\"login.php\">Go To Login</a></center>";



    }



  }

}



/// change password



function changePass( oldPass, newPass , newPass2 )

{



  if( newPass !== newPass2){

    alert('Your new passwords do not match');

    return false;

  }

  document.getElementById( "changepass" ).style.visibility="hidden";

  document.getElementById( "status" ).style.display="block";

  document.getElementById( "status" ).innerHTML ="<center>Processing...<br /><img src='images/ajax-loader2.gif' /><br /></center>";



  new ajax ('proMan.php', {
    postBody: 'mode=change_pass&newPass='+ newPass +'&oldPass='+ oldPass +'' ,
    update: $( "mye" ),
    onComplete: passRes
  });

  function passRes(request){



    if(request.responseText == 1){ // 1 = error

		

      document.getElementById( "status" ).innerHTML ="<center>Sorry...<br />Your OLD password is incorrect.<br />You can try again.</center>";

      document.getElementById( "changepass" ).style.visibility="visible";

		

    }else{

      document.getElementById( "status" ).innerHTML ="<center>Success!!<br />Your password has been changed<br /></center>";



    }



  }

}









// Send Caption



function pic_info( caption )

{

  var dump = $('picinfo').toQueryString();





  document.getElementById("caption").innerHTML ="Updating Caption....";



  new ajax ('picMan.php', {
    postBody: dump ,
    update: $('caption_'),
    onComplete: myFunction
  });



  function myFunction(request){

	

    document.getElementById("caption").innerHTML = caption ;

    document.getElementById("cap_status").innerHTML ="Information has been Updated!";

  }

}





function promoteMB()

{

  var dump = $('promote').toQueryString();

  document.getElementById( "promote_div" ).innerHTML ="<center>Sending invites...<br /><img src='images/ajax-loader2.gif' /><br /></center>";





  new ajax ('proMan.php', {
    postBody: dump ,
    update: $('mye'),
    onComplete: myFunction
  });



  function myFunction(request){

    document.getElementById("promote_div").innerHTML = request.responseText ;



  }

}











function reply_c( thereply , gallery_id, comment_id )

{





  document.getElementById( comment_id ).innerHTML ="<center><br /><br />replying...<br /><img src='images/ajax-loader2.gif' /><br /><br /></center>";



  new ajax ('picMan.php', {
    postBody: 'comment_reply='+ thereply +'&comment_id='+ comment_id +'&gallery_id='+ gallery_id +'&mode=reply_pic_comment' ,
    update: $('status'),
    onComplete: myFunction
  });



  function myFunction(request){

	



    document.getElementById( comment_id ).style.display= 'none';



  }

} 





function postBullet( bullet )

{



 

  if(bullet == ''){

    alert("Bullet field is empty");

    return false;

  }

	

  var dump = $('post_bullet').toQueryString();





  document.getElementById( "bullet_post" ).innerHTML ="<center>Posting...<br /><img src='images/ajax-loader2.gif' /><br /></center>";





  new ajax ('proMan.php', {
    postBody: dump+'&mode=post_bullet' ,
    update: $('mye'),
    onComplete: myFunction
  });



  function myFunction(request){

    document.getElementById("bullet_post").innerHTML ="<br /><b><center>"+ request.responseText +"</center></b><br />"  ;



  //document.getElementById("bullet_post").innerHTML ="<br /><b><center> You bulleting has been posted! </center></b><br />";

  }

}


function delEvent( eventID )
{
  var erase= confirm("Do you really want to delete this event");
  if (erase == true) {
    function onDone(request){
      document.getElementById('event_'+eventID).style.display= 'none';
    }

    document.getElementById('event_'+eventID).innerHTML ="<br /><b><center>Deleting... </center></b><br />"  ;
    new ajax ('proMan.php', {
      postBody: 'mode=del_event&id='+ eventID +'',
      update: $('mye'),
      onComplete: onDone
    });
  }
}



function delBul( bulID )

{



  var erase= confirm("Do you really want to delete this bullet");

  if (erase == true)

  {



    function onDone(request){



      document.getElementById( bulID ).style.display= 'none';



    }



    document.getElementById( bulID ).innerHTML ="<br /><b><center>Deleting... </center></b><br />"  ;



    new ajax ('proMan.php', {
      postBody: 'mode=del_bullet&id='+ bulID +'',
      update: $('mye'),
      onComplete: onDone
    });





  }

}





function mini_search( id )

{

  var id=id;

 

 

 

  if(id == ''){

    alert("Enter A ModelBase Member Number");

    return false;

  }

		

  var charpos = id.search("[^0-9]");

  if( charpos >= 0) {

    alert("Enter A ModelBase Member Number");

    return false;

  }



	

  var dump = $('mini_search').toQueryString();





  document.getElementById( "search_status" ).innerHTML ="<center>Searching...<br /><img src='images/ajax-loader2.gif' /><br /></center>";





  new ajax ('lib/search_scr.php', {
    postBody: dump ,
    update: $('mye'),
    onComplete: myFunction
  });



  function myFunction(request){

 

    if(request.responseText == 0 ){

      alert('Sorry, This user does not exist or is suspended.');

      document.getElementById( "search_status" ).innerHTML ="";

	

    }else{



      window.location=request.responseText;

    }

  }

}





//Delete Comment

function delMail1( id , type )

{



  var erase= confirm("Do you really want to delete this email " );

  if (erase == true)

  {

    if(type == 1 ){

      var mode = "del_mail1";

    }else{

      var mode = "del_mail2";

    }

    document.getElementById( id ).innerHTML ="<center><br /><br />Deleting...<br /><img src='images/ajax-loader2.gif' /><br /><br /></center>";

    document.getElementById( id ).style.height = "150px";



    new ajax ('mailMan.php', {
      postBody: 'mode='+ mode +'&id='+ id +'',
      update: $('mye'),
      onComplete: delCommentRes
    });

  } // end of the IF

  function delCommentRes(request){

    if(request.responseText == 1){

      document.getElementById( id ).style.display= 'none';

    }else{

      alert("Failed! Refresh and try again later...");

    }

	

  }

}


function settings( type , userID )
{
  document.getElementById( "settings_status" ).innerHTML ="<center><img src='images/ajax-loader.gif' /></center>";
  new ajax ('proMan.php', {
    postBody: 'mode=settings&user_id='+ userID +'&type='+ type +'' ,
    update: $('s'),
    onComplete: myFunction
  });
  function myFunction(request){
    document.getElementById( "settings_status" ).innerHTML ="<center><b> Updated! </b></center> ";
  }
} 

/*
	Copyright 2007 Peter
 */
