
//Illustrations

var xmlHttp 		=	createXmlHttpRequestObject();
var serverAddress 	=   "validate.php?name12=";
function createXmlHttpRequestObject() {
	var xmlHttp;
	try {
		xmlHttp = new XMLHttpRequest();
	}
	catch(e) {
		var XmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP");
		for (var i=0; i<XmlHttpVersions.length && !xmlHttp; i++) {
			try {
				xmlHttp = new ActiveXObject(XmlHttpVersions[i]);
			}
			catch (e) {} 
		}
	}
	if (!xmlHttp)
		alert("Your Browser Does not Support AJAX Architecture");
	else
		return xmlHttp;
}

function checkUserId(username) {
	if(xmlHttp) {
		xmlHttp.open("GET", serverAddress+username, true);
		xmlHttp.onreadystatechange = handleRequestStateChange;
		xmlHttp.send(null);
	}
}

function handleRequestStateChange() {
	if (xmlHttp.readyState==4) {
		var targetObj =document.getElementById('spanbox');
		targetObj.innerHTML=xmlHttp.responseText;
	if(targetObj.innerHTML==''){
targetObj.style.visibility = 'hidden';	
targetObj.style.display = 'none';
		}
else{
targetObj.style.visibility = 'visible';	
targetObj.style.display = 'block';
		targetObj.innerHTML = '<img src="icon.gif" width="13" height="13" border="0" alt="">&nbsp;&nbsp;' + xmlHttp.responseText;
		return false;
		}
		
	}
}

function display(id)
  {

  document.getElementById("content").innerHTML= document.getElementById(id).innerHTML
  }
//Reviewer registration

function reviewer(id)
  {

  document.getElementById("content").innerHTML= document.getElementById(id).innerHTML
  }
//editors registration
function banner(id)
  {

  document.getElementById("content").innerHTML= document.getElementById(id).innerHTML
  }
function editors(id)
  {

  document.getElementById("content").innerHTML= document.getElementById(id).innerHTML
  }
function list(id)
  {

  document.getElementById("contents").innerHTML= document.getElementById(id).innerHTML
  }
//sections
function sections_add(id)
  {

  document.getElementById("add").innerHTML= document.getElementById(id).innerHTML
  }
//Reviewer
function reviewer_invite(id)
  {

  document.getElementById("content").innerHTML= document.getElementById(id).innerHTML
  }
 //subscriber
function subscriber_invite(id)
  {

  document.getElementById("content").innerHTML= document.getElementById(id).innerHTML
  }
//editors and Registration......

function isEmpty(str){
return (str.length == 0 || str=='')?true:false;
}

function isAlpha(str){
	var alpha = /^([a-zA-Z]+)$/;
	return alpha.test(str);
}

function isNumeric(str){
	var numeric = /^([\d]+)$/ ;
	return numeric.test(str);
}

function isAlphaNumeric(str){
	var alphaNumeric = /^([0-9a-zA-Z]+)$/
	return alphaNumeric.test(str);
}

function isValidEmail(str){
var email = /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/i; 
return email.test(str);
}

function isValidDate(str){
var dob = /^([\d]{2})(\/|-)([\d]{2})(\/|-)([\d]{4})$/;
return dob.test(str);
}

function isValidPhoneNo(str){
var phoneNo = /^([\d]{11})$/;
return phoneNo.test(str);
}

function isValidURL(str){
	
var url = /^(http:\/\/www.|https:\/\/www.|ftp:\/\/www.|www.){1}([\w]+)(.[\w]+){1,2}$/;
return url.test(str);
}

function isValid(srcId,targetId,validations,error){
var  valids = validations.split('|');
var srcObj = document.getElementById(srcId);
var targetObj = document.getElementById(targetId);
var srcValue = srcObj.value;
var errorMess = error.split("|");


for(num in valids){
/*alert(errorMess[num]);*/
switch(valids[num]){
		case 'isEmpty':
			validationResult = (isEmpty(srcValue))?errorMess[num]:'';
		break;
		case 'isNumeric':
			validationResult = (!isNumeric(srcValue))?errorMess[num]:'';
		break;
		case 'isAlpha':
			validationResult = (!isAlpha(srcValue))?errorMess[num]:'';
		break;
		case 'isAlphaNumeric':
			validationResult = (!isAlphaNumeric(srcValue))?errorMess[num]:'';
		break;
		case 'isValidEmail':
			validationResult = (!isValidEmail(srcValue))?errorMess[num]:'';
		break;
		case 'isValidDate':
			validationResult = (!isValidDOB(srcValue))?errorMess[num]:'';
		break;
		case 'isValidPhoneNo':
			validationResult = (!isValidPhoneNo(srcValue))?errorMess[num]:'';
		break;
		case 'isValidURL':
			validationResult = (!isValidURL(srcValue))?errorMess[num]:'';
		break;
		default:
		break;
		}//End Switch Case
	if(!isEmpty(validationResult)){
		targetObj.className = 'error';
		targetObj.style.visibility = 'visible';		
		targetObj.innerHTML = '<img src="icon.gif" width="13" height="13" border="0" alt="">&nbsp;&nbsp;' + validationResult;
		return false;
	}//End If
	else {
	targetObj.style.visibility = 'hidden';
	targetObj.className = 'noerror';
	targetObj.innerHTML = '';
	}
	}//End For Loop
}//End Function isValid
function writeHelpText(id,message){
obj = document.getElementById(id);
obj.className = 'help';
obj.innerHTML = message;
}

function help()
{
  window.open ("./help.html",
"mywindow","menubar=1,resizable=1,height=450,width=550,toolbar=no,menubar=yes,scrollbars=yes"); 
 }
function login_help()
{
  window.open ("./login_help.php",
"mywindow","menubar=1,resizable=1,height=450,width=550,toolbar=no,menubar=yes,scrollbars=yes"); 
 }
function body_help()
{
  window.open ("./body_help.html",
"mywindow","menubar=1,resizable=1,height=450,width=550,toolbar=no,menubar=yes,scrollbars=yes"); 
 }

 function formating_help()
{
  window.open ("./formating_help.html",
"mywindow","menubar=1,resizable=1,height=450,width=550,toolbar=no,menubar=yes,scrollbars=yes"); 
 }

		


// ///////Date Function////
function today(){
	var d=new Date();
	var date=d.getDate();        
	var mon=d.getMonth();
	var month = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
	var year=d.getFullYear();
	var hour=d.getHours();
	document.writeln(date+"  "+month[mon]+"  "+year);
}

/////////Advertisements.....
function adv_validation()
{ 
	
	name	=	document.getElementById('name').value;
	company	=	document.getElementById('company').value;
	image	=	document.getElementById('image').value;
	loc 	=	document.getElementById('loc').value;
	pages	=	document.getElementById('pages').value;
	
	if(name	==	'')
	{
		alert("Please Enter The Name...");
		return false;
	}
	if(company	==	'')
	{
		alert("Please Enter The Company...");
		return false;
	}
		if(image	==	'')
	{
		alert("Please Select The Image...");
		return false;
	}
		if(loc	==	'right')
	{
		alert("Please Enter The Location...");
		return false;
	}
		if(pages	==	'all')
	{
		alert("Please Enter The Pages...");
		return false;
	}

}

////Reviewers
function reviewer_validation()
{ 
    
	email	=	document.getElementById('reviewer').value;
	
	if(email	==	'')
	{
		alert("Please Enter The Email-Ids...");
		return false;
	}
}
/////Manu Script Validation
function manu_validation()
{
	file		=	document.getElementById('file').value;
    video		=	document.getElementById('video').value;
	title		=	document.getElementById('title').value;

	if(file	==	'')
	{
		
	}
	else
	{
		 name = file_validation();
         if(name==false)return false;
	}

    if(title	==	'')
	{

	}
	
	if(video	==	'')
	{

	}
	else
	{
		 name = video_validation();
         if(name==false)return false;
	}
return true;
}

function file_validation()
{
	v =	document.getElementById('file').value;

	var ext = v.lastIndexOf('.');
	var extStr = v.substring((ext+1),(v.length));
	if(extStr != 'pdf' && extStr != 'doc' && extStr != 'rtf' )
	{
	  document.getElementById('manu').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid gray 1px ; color:red;'><img src='icon.gif' width='15' height='15'>&nbsp;&nbsp;Only PDF or DOC or RTF files are allowed</div>";
	  return false;
   }
   
}

function video_validation()
{
	v =	document.getElementById('video').value;

	var ext = v.lastIndexOf('.');
	var extStr = v.substring((ext+1),(v.length));
	if(extStr != 'avi' && extStr != 'wmv' && extStr != 'mov' && extStr != 'mpeg' && extStr != 'flv' && extStr != 'jpg' && extStr != 'tiff' )
	{
	  document.getElementById('manu').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid gray 1px ; color:red;'><img src='icon.gif' width='15' height='15'>&nbsp;&nbsp;Only AVI or WMV or WOV or FLV or MPEG or JPG or TIFF videos are allowed</div>";
	  return false;
   }
   
}
/////Change Password...............
function change_passvalid()
{   
         password=document.getElementById("newpassword").value;
         oldpass=document.getElementById("oldpass").value;
         cpassword= document.getElementById("cpassword").value;
         email=document.getElementById('primary_email').value;
       
         if(email=='')
         {
       
            document.getElementById ('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:black;'><img src=' icon.gif' width='15' height='15'>&nbsp;&nbsp;Email should not be empty</div>";
            //document.getElementById('primary_email').focus();
            return false;
          }
          else
          {
            resemail=emailval(email);
            if(resemail==false)
            {
                document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:black;'><img src=' icon.gif' width='15' height='15'>&nbsp;&nbsp;Enter valid Email</div>";
            return false;
            }

          }

          if(oldpass=='')
          {
            document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:black;'><img src=' icon.gif' width='15' height='15'>&nbsp;&nbsp;Old Password should not be empty</div>";
            return false;
          }
          if(password == '')
          {
                document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:black;'><img src=' icon.gif' width='15' height='15'>&nbsp;&nbsp;Password should not be empty</div>";
            return false;
          }
          else
          {
            res=passvalidation(password);
            if(res==false)return false;
          }

          /* ConfirmationPassword Validation*/
           if(cpassword == '')
         {
            document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:black;'><img src=' icon.gif' width='15' height='15'>&nbsp;&nbsp;Confirm Password should not be empty</div>";
            return false;
        }
        else
        {
            res7=cpassvalidation(cpassword);
            if(res7==false)return false;
        }
}
function passvalidation(pwd)
    {
        for(i=0;i<pwd.length;i++)
        {
            password1=pwd.length;
            if(password1<6)
            {
        document.getElementById("display").innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:black;'><img src=' icon.gif' width='15' height='15'>&nbsp;&nbsp;Please Enter Minimum of 6 Characters for Password</div>";
        return false;
            }
        }
    }

    function cpassvalidation(cpwd)
    {
        for(i=0;i<cpwd.length;i++)
        {
            cpassword1=cpwd.length;       
            if(((password!=cpassword)&&(password1!=cpassword1))||((password!=cpassword)&&(password1=cpassword1)))
            {
                document.getElementById("display").innerHTML="<BR><BR><div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:black;'><img src=' icon.gif' width='15' height='15'>&nbsp;&nbsp;New Password & Confirmation Password Should be Same</div>";
                return false;
            }
        }
    } 
////End Change Password........................

////Toll-Tip.............

/***********************************************
* Fixed ToolTip script- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
		
var tipwidth='150px' //default tooltip width
var tipbgcolor='#EEEEEE'  //tooltip bgcolor
var disappeardelay=250  //tooltip disappear speed onMouseout (in miliseconds)
var vertical_offset="0px" //horizontal offset of tooltip from anchor link
var horizontal_offset="-3px" //horizontal offset of tooltip from anchor link

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="fixedtipdiv" style="visibility:hidden;width:'+tipwidth+';background-color:'+tipbgcolor+'" ></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, tipwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function fixedtooltip(menucontents, obj, e, tipwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidetip()
dropmenuobj=document.getElementById? document.getElementById("fixedtipdiv") : fixedtipdiv
dropmenuobj.innerHTML=menucontents

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", tipwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}
}

function hidetip(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidetip(){
if (ie4||ns6)
delayhide=setTimeout("hidetip()",disappeardelay)
}

function clearhidetip(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

function home_reg()
{
	//alert('hii');
	email=document.getElementById('primary_email').value;
	if(email=='')
	{
		
		document.getElementById('display_divi').innerHTML='';
        //document.getElementById('primary_email').focus();
		return false;
	}
	else
	{
	        resemail=emailvalidation(email);
            if(resemail==false)return false;

	}
return true;

}
function emailvalidation(str)
{
	var email = /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/i; 
    return email.test(str);
}

function banner_ins()
{
	
	banner=document.getElementById('banner').value;
	if(banner=='')
	{
		
		document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#FFFFCC;border:solid red 1px ; color:red;'><img src='icon.gif' width='15' height='15'> Banner should not be empty</div>";
        //document.getElementById('primary_email').focus();
		return false;
	}
	else
	{ 
         var ext = banner.lastIndexOf('.');
	     var extStr = banner.substring((ext+1),(banner.length));
	     if((extStr != 'gif')&&(extStr != 'jpg')&&(extStr != 'png'))
	     {
	       document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#FFFFCC;border:solid red 1px ; color:red;'><img src='icon.gif' width='15' height='15'> Only GIF or JPEG or PNG Images are allowed</div>";
	       return false;
         }

	}
}
function adminform()
{
	
	email=document.getElementById('primary_email').value;
	if(email=='')
	{
		
		document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696  1px ; color:red;'><img src='icon.gif' width='15' height='15'> Email should not be empty</div>";
        //document.getElementById('primary_email').focus();
		return false;
	}
	else
	{
	        resemail=emailval(email);
            if(resemail==false)
		    {
				document.getElementById('display').innerHTML="<BR><BR><div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:black;'><img src=' icon.gif' width='15' height='15'>&nbsp;&nbsp;Enter valid Email</div>";
			return false;
			}

	}
return true;
}

function emailval(str)
{
	var email = /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/i; 
    return email.test(str);
}

function adminadd()
{
	
	name=document.getElementById('name').value;
	company=document.getElementById('company').value;
	desc=document.getElementById('desc').value;
	image=document.getElementById('image').value;
	url=document.getElementById('url').value;
	
	if(name=='')
	{		
		document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#FFFFCC;border:solid red 1px ; color:red;'><img src='icon.gif' width='15' height='15'>Adv Name should not be empty</div>";
		return false;
	}
	if(company=='')
	{
		
		document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#FFFFCC;border:solid red 1px ; color:red;'><img src='icon.gif' width='15' height='15'>Adv Company should not be empty</div>";
		return false;
	}if(desc=='')
	{
		
		document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#FFFFCC;border:solid red 1px ; color:red;'><img src='icon.gif' width='15' height='15'>Adv Description should not be empty</div>";
		return false;
	}if(image=='')
	{
		
		document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#FFFFCC;border:solid red 1px ; color:red;'><img src='icon.gif' width='15' height='15'>Adv Image should not be empty</div>";
		return false;
	}
	else
	{
         var ext = image.lastIndexOf('.');
	     var extStr = image.substring((ext+1),(image.length));
	     if((extStr != 'gif')&&(extStr != 'jpg')&&(extStr != 'png'))
	     {
	       document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#FFFFCC;border:solid red 1px ; color:red;'><img src='icon.gif' width='15' height='15'> Only GIF or JPEG or PNG Images are allowed</div>";
	       return false;
         }
	}
	
	if(url=='')
	{
		
		document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#FFFFCC;border:solid red 1px ; color:red;'><img src='icon.gif' width='15' height='15'>Adv URL should not be empty</div>";
		return false;
	}

}
function adminsection()
{
	
	name=document.getElementById('name').value;
	des=document.getElementById('de').value;

	if(name=='')
	{		
		document.getElementById('display').innerHTML="<BR><BR><div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:black;'><img src=' icon.gif' width='15' height='15'>&nbsp;&nbsp;Name should not be empty</div>";
		return false;
	}if(des=='')
	{		
		document.getElementById('display').innerHTML="<BR><BR><div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:black;'><img src=' icon.gif' width='15' height='15'>&nbsp;&nbsp;Description should not be empty</div>";
		return false;
	}
}
function manuscript_contact()
{   
    phone_no=document.getElementById('phone_no').value;
    email=document.getElementById('email').value;
    if(phone_no=='')
    {       
        document.getElementById('display').innerHTML="";
    }
    else
    {
        resmob=mobilevalidation(phone_no);
        if(resmob == false)
        {
            return false;   
        }
    }
    if(email=='')
     {
        document.getElementById('display').innerHTML="";
     }
     else
    {
            resemail=emailval(email);
            if(resemail==false)
            {
                document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid gray 1px ; color:red;'><img src='icon.gif' width='15' height='15'>&nbsp;&nbsp;Enter valid Email</div>";
            return false;
            }

          }
}
function mobilevalidation(mv)
    {
        for(i=0;i<mv.length;i++)
        {
            if(!(mv.charAt(i)>=0 && mv.charAt(i)<=9))
            {
                document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid gray 1px ; color:red;'><img src='icon.gif' width='15' height='15'>&nbsp;&nbsp;Enter the number b/w(0-9)</div>";
                document.getElementById('phone_no').focus();
                return false;
            }
        }
    }
function displayContent(obj,divID){
	if(obj.innerHTML=="+")obj.innerHTML="-";
	else obj.innerHTML="+";
	x = document.getElementById(divID);
	if(x.style.display=="none")x.style.display="block";
	else x.style.display="none";
}

function displayManuscript(obj,divID){
	x = document.getElementById(divID);
	if(x.style.display=="none")x.style.display="block";
	else x.style.display="none";
}

 function sendMail(name,to,from,sub,mess,mid,uid){
	name = 'mail';
	document.getElementById('mailCont').style.display = 'block';
	document.getElementById('mailCont').style.posTop = 800;
	document.forms[name].elements[0].value = to ;
	document.forms[name].elements[1].value = to ;
	document.forms[name].elements[2].value = to ;
	document.forms[name].elements[3].value = from ;
	document.forms[name].elements[4].value = sub ;
	document.forms[name].elements[5].value = mess ;
	document.forms[name].elements[6].value = mid ;
	document.forms[name].elements[7].value = uid ;
 }
function loadMessage(formName,fieldName,value){
document.forms[formName].elements[fieldName].value = document.getElementById(value).innerHTML;
/*alert(formName + fieldName + value + document.getElementById(value).innerHTML);*/
}
//alert(getMailMessage('http://www.jafib.com/admin/addCommentToManuscript.php',24,4458,'getManuscriptValidationIdByReviewer'));

function loadMailMessage(formName,fieldName,value){

}

function addCommentToManuscript(mid,uid){
/*alert(mid + uid);*/
document.getElementById('addCommentToManu').style.display = 'block';
	document.forms['addComment2Manuscript'].elements['mid'].value = mid ;
	document.forms['addComment2Manuscript'].elements['rid'].value = uid ;
}
 
function createAjax(){
	var ua;
	if(window.XMLHttpRequest) {
		try {
			ua = new XMLHttpRequest();
			}
			catch(e) {
				ua = false;
			}
		}
	else if(window.ActiveXObject) {
		try {       
			ua = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(e) {
				ua = false;
			}
		}   
	return ua;   
}


function getMailMessage(file,mid,uid,func){
/*alert(file+mid+uid+func);*/
var req = createAjax();
var url = file+'?mid='+mid+'&uid='+uid+'&func='+func ;
	req.open('GET',url,true);
	req.onreadystatechange = function(){
		if(req.readyState == 4){
			if(req.status == 200 ){
				return req.responseText ;
			}
		}
	}
	req.send();
}
function updateValueInTable(file,mid,field,value,func,targetOBJ){
/*alert(file+mid+uid+func);*/
var req = createAjax();
var url = file+'?mid='+mid+'&field='+field+'&value='+value+'&func='+func ;
	req.open('GET',url,true);
	req.onreadystatechange = function(){
		if(req.readyState == 4){
			if(req.status == 200 ){
				targetOBJ.innerText = req.responseText ;
			}
		}
	}
	req.send();
}
function section_saved()
{
alert('Section Saved');
document.getElementById('sec_saved').innerHTML = "Saved";

}

function preview_saved()
{
alert('Preview Status Saved');

}