var set_limiter=0;
var return_check_numeric=0;
function check_numeric(field){
         return_check_numeric=0;
         if(set_limiter==0){
            if(isNaN(eval(FormName+"."+field+".value"))){
               alert("Please enter only numeric values in this field!");
               eval(FormName+"['"+field+"'].value=''");
            }
            else{
               return_check_numeric=1;
            }
            set_limiter=0;
         }
         set_limiter=1;
}

function do_link(module,page,params){
	var array_params=Array();
	var i=0;
	var send_params='';
	var param=Array();
	array_params=params.split('&');
	while (i < array_params.length){
		
		param=array_params[i].split("=");	
		send_params=send_params+param[0]+'-'+param[1];
		if(i < array_params.length-1){
			send_params=send_params+'~';
		}
		i++;
  	}
    	
    if (send_params){	
    	DaLink=path+"/"+module+"-"+page+"~"+send_params+'.shtml';
    }
    else {
    	DaLink=path_index+"/"+module+"-"+page+'.shtml';
    }
       
    return DaLink;
}


function show_errors(err_list){

        err_log = err_list.join(" \n ");

           if(err_log.length==0){
                err_log=" No details available ";
           }

          alert(err_log);

}

function check_limit( frm, obj, max, msg){
        ob = eval("document."+frm+"['"+obj+"']");
        if(ob.value.length > max){
                eval("document."+frm+"['"+obj+"'].innerText = ob.value.substring(0,"+max+"-1)");
                alert ("You have reached the maximum number of "+max+" letters for this text box.")
        }
}


function set_select(sel_name,form_name,sel_index){

	if (typeof eval("document." + form_name + "." + sel_name) == 'object') {
	
		sel_length = eval("document." + form_name + "." + sel_name + ".length");
		
		for (optionCounter = 0; optionCounter < sel_length; optionCounter++) {
			
			if (eval("document." + form_name + "." + sel_name + ".options[optionCounter].value == '" + sel_index + "'")) {
				
				eval("document." + form_name + "." + sel_name + ".selectedIndex = optionCounter");
				
			}
			
		}
	
	}

}

function set_navigation(sel_name,form_name,sel_index){
        eval("document."+form_name+"."+sel_name+".value=sel_index");
}

function upload_win(pkd,max,rst){
	window.open(path_index+'/global/upload/?pp=up&PKD='+pkd+'&max='+max+'&rst='+rst,'upload','width=400,height=400,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no,left=0,top=0,screenx=50,screeny=50');

}

function set_checked(check_name,form_name,checked_mode){
    if (typeof eval("document." + form_name + "." + check_name) == 'object') {

        var value = eval("document." + form_name + "." + check_name + ".value");

        if (checked_mode && value === checked_mode) {
            eval("document." + form_name + "." + check_name + ".checked = true");
        }
        if (checked_mode && value !== checked_mode) {
            eval("document." + form_name + "." + check_name + ".checked = false");
        }

    }
}

function url_escape(string){

        out = "/";
        add = "&#47;";
        temp = "" + string;

        while (temp.indexOf(out)>-1) {
                pos= temp.indexOf(out);
                temp = "" + (temp.substring(0, pos) + add +
                temp.substring((pos + out.length), temp.length));
        }
        temp=escape(temp);
        return temp;

}

function check_input(user,pass,pass_retype,email){
   if(user==''){
      alert("Username missing!");
      return false;
   }
   else if(pass==''){
      alert("Password missing!");
      return false;
   }
   else if(pass_retype!=pass){
      alert("Passwords does not match!");
      return false;
   }
   else if(email==''){
      alert("Email address missing!");
      return false;
   }
   else{
      return true;
   }
}

function WinOpen(mypage,myname,w,h,win_position,Scrool){
        var win = null;
        var LeftPosition,TopPosition;
        if (w){
        }
        else {     
        	w=600;
        }
        if (h){
        }
        else {
        	h=600;
        }
        win_position="center";
        if(win_position=="topright"){
           LeftPosition = (screen.width) ? (screen.width-w-12) : 0;
           TopPosition = 20;
        }
        else if(win_position=="center"){
           LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
           TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
        }

        settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+Scrool+',resizable=no'
        win = window.open(mypage,myname,settings);
        if(win==null){
        	alert( "Your popup blocker stopped an window from opening\nPlease disable your popup blocker if you wish to see window content!" )
        }
}

function replaceSubstring(inputString, fromString, toString) {
   // Goes through the inputString and replaces every occurrence of fromString with toString
   var temp = inputString;
   if (fromString == "") {
      return inputString;
   }
   if (toString.indexOf(fromString) == -1) { // If the string being replaced is not a part of the replacement string (normal situation)
      while (temp.indexOf(fromString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(fromString));
         var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
         temp = toTheLeft + toString + toTheRight;
      }
   } else { // String being replaced is part of replacement string (like "+" being replaced with "++") - prevent an infinite loop
      var midStrings = new Array("~", "`", "_", "^", "#");
      var midStringLen = 1;
      var midString = "";
      // Find a string that doesn't exist in the inputString to be used
      // as an "inbetween" string
      while (midString == "") {
         for (var i=0; i < midStrings.length; i++) {
            var tempMidString = "";
            for (var j=0; j < midStringLen; j++) { tempMidString += midStrings[i]; }
            if (fromString.indexOf(tempMidString) == -1) {
               midString = tempMidString;
               i = midStrings.length + 1;
            }
         }
      } // Keep on going until we build an "inbetween" string that doesn't exist
      // Now go through and do two replaces - first, replace the "fromString" with the "inbetween" string
      while (temp.indexOf(fromString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(fromString));
         var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
         temp = toTheLeft + midString + toTheRight;
      }
      // Next, replace the "inbetween" string with the "toString"
      while (temp.indexOf(midString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(midString));
         var toTheRight = temp.substring(temp.indexOf(midString)+midString.length, temp.length);
         temp = toTheLeft + toString + toTheRight;
      }
   } // Ends the check to see if the string being replaced is part of the replacement string or not
   return temp; // Send the updated string back to the user
} // Ends the "replaceSubstring" function

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function TakeAction(action,logins_key,UserName){
	 var seed = Math.random();
	 
	 if(action=='salaam'){	
	
	         
       		if(PMEMBER){ 
	        	imgActions.src=do_link('user','relation_set','pp=up&relation=salaam&logins_key='+logins_key);
	       		
	       		msg="You have successfully sent a salaam to "+UserName+"!";
	       		SmileSent=1;
       		}
       		else{
       			msg="Please login to send a salaam.";       			
       			
       		}               
	 		
         	setTimeout("alert(msg)",1000);
         }
         else if(action=='watch'){
	         if(!MY_ACTIVE){
               		if(MY_COK_USERENAME!=''){
	                     document.location=do_link('user','myaccount','log=on');
	                }
	                else{
	                     document.location=do_link('user','signup','from=relation');
	                }
                }
                else if(MY_ACTIVE==1){
	        	err="activate_profil";
            		//msg="Please wait until your profile has been \nactivated to communicate with other members.\nNormal-approval time for profile is 2-12 hours.";
                }
	        else{
	       		imgActions.src=do_link('user','relation_set','pp=up&relation=watch&logins_key='+logins_key);
	       		
	       		msg="You have successfully added "+UserName+" to your watch list.";
	       		SmileSent=1;
                }
	 		
         	setTimeout("alert(msg)",1000);
         }
         else if(action=='search'){

            if(!MY_ACTIVE){
               if(MY_COK_USERENAME!=''){
                  document.location=do_link('user','myaccount','log=on');
               }
               else{
                  document.location=do_link('user','signup','from=relation');
               }
            }
            else if(MY_ACTIVE==1){
	       msg="Please wait until your profile has been \nactivated to communicate with other members.\nNormal-approval time for profile is 2-12 hours.";
            }
            else{
	       imgActions.src=do_link('user','relation_set','pp=up&relation=search&logins_key='+logins_key);
		
	       //msg="You have successfully added "+UserName+" to your search list.";
	       SmileSent=1;
            }

	 //setTimeout("alert(msg)",1000);

         }
         else if(action=='hide'){

            if(!MY_ACTIVE){
               if(MY_COK_USERENAME!=''){
                  document.location=do_link('user','myaccount','log=on');
               }
               else{
                  document.location=do_link('user','signup','from=relation');
               }
            }
            else if(MY_ACTIVE==1){
	       msg="Please wait until your profile has been \nactivated to communicate with other members.\nNormal-approval time for profile is 2-12 hours.";
            }
            else{
	       imgActions.src=do_link('user','relation_set','pp=up&relation=hide&logins_key='+logins_key);

	       msg="You have successfully added "+UserName+" to your hidden list.";
	       SmileSent=1;
            }

	 setTimeout("alert(msg)",1000);

         }
         else if(action=='unhide'){

            imgActions.src=do_link('user','relation_set','pp=up&relation=hide&mode=del&logins_key='+logins_key);

	    msg="You have successfully removed "+UserName+" from your hidden list.";
	    SmileSent=1;
            

	 setTimeout("alert(msg)",1000);

         }
         else if(action=='block'){

            if(!MY_ACTIVE){
               if(MY_COK_USERENAME!=''){
                  document.location=do_link('user','myaccount','');
               }
               else{
                  document.location=do_link('user','signup','from=relation');
               }
            }
            else{
               imgActions.src=do_link('user','relation_set','pp=up&relation=block&logins_key='+logins_key);
               msg="User successfully blocked";
               JustBlocked=1;
            }

         setTimeout("alert(msg);window.location.reload();",1000);

         }
         else if(action=='unblock'){

            if(!MY_ACTIVE){
               if(MY_COK_USERENAME!=''){
                  document.location=do_link('user','myaccount','');
               }
               else{
                  document.location=do_link('user','signup','from=relation');
               }
            }
            else{
               imgActions.src=do_link('user','relation_set','pp=up&relation=unblock&logins_key='+logins_key);
               msg="User successfully unblocked";
               JustBlocked=1;
            }

         setTimeout("alert(msg);window.location.reload();",1000);

         }
         else if(action=='message'){

            text=escape(document.send_message.message.value);

            if(MY_ACTIVE==2){
               msg="Please wait until your profile has been \nactivated to communicate with other members.\nNormal-approval time for profile is 2-12 hours.";
            }
            else if(text==''){
               msg="Please fill the content of the message.";
            }
            else{
               imgActions.src='/actions.php?action=message&user_key_receiver='+UserId+'&to_username='+UserName+'&liame='+LiaMe+'&view_right='+SecretDirection+'&message='+text+'&'+ seed;
               msg="Message successfully sent";
            }

         setTimeout("MM_swapImage('LOCKER','','/images/but_"+UnlockAction+".gif',1);document.send_message.message.value='';alert(msg)",1000);

         }
}

//################################################################################ NEW FUNCTIONS

var isNN = (navigator.appName.indexOf("Netscape") != -1);
var isIE = (navigator.appName.indexOf("Microsoft") != -1);
var IEVersion = (isIE ? getIEVersion() : 0);
var NNVersion = (isNN ? getNNVersion() : 0);
var EditableGrid = false;
var disableValidation = false;

function checkDate(dateValue, dateFormat)
{
  var DateMasks = new Array(
                    new Array("MMMM", "[a-z]+"),
                    new Array("mmmm", "[a-z]+"),
                    new Array("yyyy", "[0-9]{4}"),
                    new Array("MMM", "[a-z]+"),
                    new Array("mmm", "[a-z]+"),
                    new Array("HH", "([0-1][0-9]|2[0-4])"),
                    new Array("hh", "(0[1-9]|1[0-2])"),
                    new Array("dd", "([0-2][0-9]|3[0-1])"),
                    new Array("MM", "(0[1-9]|1[0-2])"),
                    new Array("mm", "(0[1-9]|1[0-2])"),
                    new Array("yy", "[0-9]{2}"),
                    new Array("nn", "[0-5][0-9]"),
                    new Array("ss", "[0-5][0-9]"),
                    new Array("w", "[1-7]"),
                    new Array("d", "([1-9]|[1-2][0-9]|3[0-1])"),
                    new Array("y", "([1-2][0-9]{0,2}|3([0-5][0-9]|6[0-5]))"),
                    new Array("H", "(00|0?[1-9]|1[0-9]|2[0-4])"),
                    new Array("h", "(0?[1-9]|1[0-2])"),
                    new Array("M", "(0?[1-9]|1[0-2])"),
                    new Array("m", "(0?[1-9]|1[0-2])"),
                    new Array("n", "[0-5]?[0-9]"),
                    new Array("s", "[0-5]?[0-9]"),
                    new Array("q", "[1-4]")
                  );
  var regExp = "^"+stringToRegExp(dateFormat)+"$";
  for (var i=0; i<DateMasks.length; i++)
  {
    regExp = regExp.replace(DateMasks[i][0], DateMasks[i][1]);
  }
  var regExp = new RegExp(regExp,"i");
  return String(dateValue).search(regExp)!=-1;
}

function stringToRegExp(string, arg)
{
  var str = String(string);
  str = str.replace(/\\/g,"\\\\");
  str = str.replace(/\//g,"\\/");
  str = str.replace(/\./g,"\\.");
  str = str.replace(/\(/g,"\\(");
  str = str.replace(/\)/g,"\\)");
  str = str.replace(/\[/g,"\\[");
  str = str.replace(/\]/g,"\\]");
  return str;
}

function GetValue(control) {
    if (typeof(control.value) == "string") {
        return control.value;
    }
    if (typeof(control.tagName) == "undefined" && typeof(control.length) == "number") {
        var j;
        for (j=0; j < control.length; j++) {
            var inner = control[j];
            if (typeof(inner.value) == "string" && (inner.type != "radio" || inner.status == true)) {
                return inner.value;
            }
        }
    }
    else {
        return GetValueRecursive(control);
    }
    return "";
}

function GetValueRecursive(control)
{
    if (typeof(control.value) == "string" && (control.type != "radio" || control.status == true)) {
        return control.value;
    }
    var i, val;
    for (i = 0; i<control.children.length; i++) {
        val = GetValueRecursive(control.children[i]);
        if (val != "") return val;
    }
    return "";
}




function getNNVersion()
{
  var userAgent = window.navigator.userAgent;
  var isMajor = parseInt(window.navigator.appVersion);
  var isMinor = parseFloat(window.navigator.appVersion);
  if (isMajor == 2) return 2;
  if (isMajor == 3) return 3;
  if (isMajor == 4) return 4;
  if (isMajor == 5) return 6;
  return isMajor;
}

function getIEVersion()
{
  var userAgent = window.navigator.userAgent;
  var MSIEPos = userAgent.indexOf("MSIE");
  return (MSIEPos > 0 ? parseInt(userAgent.substring(MSIEPos+5, userAgent.indexOf(".", MSIEPos))) : 0);
}

function inputMasking(evt)
{
  if (isIE && IEVersion > 4)
  {
    if (window.event.altKey) return false;
    if (window.event.ctrlKey) return false;
    if (typeof(this.ccsInputMask) == "string")
    {
      var mask = this.ccsInputMask;
      var keycode = window.event.keyCode;
      this.value = applyMask(keycode, mask, this.value);
    }
    return (window.event.keyCode==13?true:false);
  } else if (isNN && NNVersion<6)
  {
    if (evt.ALT_MASK) return false;
    if (evt.CONTROL_MASK) return false;
    if (typeof(this.ccsInputMask) == "string")
    {
      var mask = this.ccsInputMask;
      var keycode = evt.which;
      this.value = applyMask(keycode, mask, this.value);
    }
    return (evt.which==13?true:false);
  } else if (isNN && NNVersion==6)
  {
    if (evt.altKey) return false;
    if (evt.ctrlKey) return false;
    if (typeof(this.ccsInputMask) == "string")
    {
      var mask = this.ccsInputMask;
      this.value = applyMaskToValue(mask, this.value);
    }
    return (evt.which==13?true:false);
  } else
    return true;
}

function applyMaskToValue(mask, value)
{
  var oldValue = String(value);
  var newValue = "";
  for (var i=0; i<oldValue.length; i++)
  {
    newValue = applyMask(oldValue.charCodeAt(i), mask, newValue);
  }
  return newValue;
}

function applyMask(keycode, mask, value)
{
  var digit = (keycode >= 48 && keycode <= 57);
  var plus = (keycode == 43);
  var dash = (keycode == 45);
  var space = (keycode == 32);
  var uletter = (keycode >= 65 && keycode <= 90);
  var lletter = (keycode >= 97 && keycode <= 122);

  var pos = value.length;
  switch(mask.charAt(pos))
  {
    case "0":
      if (digit)
        value += String.fromCharCode(keycode);
      break;
    case "L":
      if (uletter || lletter)
        value += String.fromCharCode(keycode);
    default:
      var isMatchMask = (String.fromCharCode(keycode) == mask.charAt(pos));
      while (pos < mask.length && mask.charAt(pos) != "0")
        value += mask.charAt(pos++);
      if (!isMatchMask && pos < mask.length)
        value = applyMask(keycode, mask, value);
  }
  return value;
}

function launchIC( userID, destinationUserID )
	{
		var popupWindowTest = window.open( "ic.cfm?strDestinationMemberID=" + destinationUserID, "ICWindow_" + replaceAlpha(userID) + "_" + replaceAlpha(destinationUserID), "width=360,height=420,toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=0,resizable=0" );
		if( popupWindowTest == null )
		{
			alert( "Your popup blocker stopped an InstantCommunicator window from opening\nPlease disable your popup blocker if you wish to receive invitations in the future" )
		}
	}
	
function replaceAlpha( strIn )
{
	var strOut = "";
	for( var i = 0 ; i < strIn.length ; i++ )
	{
		var cChar = strIn.charAt(i);
		if( ( cChar >= 'A' && cChar <= 'Z' )
			|| ( cChar >= 'a' && cChar <= 'z' )
			|| ( cChar >= '0' && cChar <= '9' ) )
		{
			strOut += cChar;
		}
		else
		{
			strOut += "_";
		}
	}
	
	return strOut;
}

function popHelp(anchor,step) {
        window.open(do_link("global","pophelp","pp=up&an="+anchor+"&step="+step), "Help","width=350,height=350,toolbar=no,location=no,scrollbars=yes,directories=no,status=no,menubar=no,resizable=no,copyhistory=no'");
}

function popWin(loc,w,h) {
        window.open(loc, "ppup", "scrollbars=1,width="+w+",height="+h);
}

function addToRel(uid,rel) {
   window.open(do_link("user","rel_mgmt","action="+rel+"&pp=up&logins_key="+uid), "Relations","width=450,height=300,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no'");
}

function open_window(msg,title,w,h)
{
        win = window.open("", "win", "width="+w+",height="+h+",screenX=3,left=3,screenY=3,top=3");
        win.focus();
        win.document.open("text/html");
        win.document.write("<HTML><HEAD><TITLE>"+title+"</TITLE></HEAD><BODY onLoad='window.focus();' marginwidth=0 marginheight=0 topmargin=0 leftmargin=0  bgcolor=#ffffff><center>"+
        msg+"</center></BODY></HTML>");
        win.document.close();
}
function send_alert(msg,title)
{
        win = window.open("", "win", "width=200,height=105,screenX=350,left=350,screenY=250,top=250");
        win.focus();
        win.document.open("text/html");
        win.document.write("<HTML><HEAD><TITLE>"+title+"</TITLE></HEAD><BODY onLoad='window.focus();'  bgcolor=#d3d6ce><center>"+
        "<TABLE border=0 width=100% cellpadding=0 cellspacing=0><TR><TD align=left>"+
        "<img src=img/alert.gif width=32 height=32 hspace=20></TD><TD><font size=1 face=Verdana>"+
        msg+"&nbsp;</TD></TR></TABLE>"+
        "<FO"+"RM onSubmit='return false;' wrap=virtual name=popupForm><input type=image src='img/close.gif' onClick='self.close();'></FO"+"RM>"+
        "</center></BODY></HTML>");
        win.document.close();
}

function do_command_img(module,params,have_path){

         var img_handle = new Image();
         var seed = Math.random();
         var cmds_path = 0;
         
         if(have_path){
            cmds_path = have_path + params +'&rndseed=' + seed;
         }
         else{
            cmds_path = do_link(module,'cmds','x=1');
            cmds_path += params + '&rndseed=' + seed;
         }

         img_handle.width = 0;

         // document.write(cmds_path);
         // document.location = cmds_path;
         img_handle.src = cmds_path;
}

function close_win(msg){
	if(msg){
		window.opener.alert(msg);
	}
	window.self.close();
}

// REMOTE REQUEST FUNCTIONS
var http_request = false;
var http_remote_result = "";

function remote_data_request(url, parameters, callback_function) {
	
	http_request = false;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType("text/xml");
		}
	}
	else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) {}
		}
	}
	if (!http_request) {
		// alert("Cannot create XMLHTTP instance");
		return false;
	}
	
	http_request.onreadystatechange = function(){
		if (http_request.readyState == 4) {
			// alert(http_request.status);
			if (http_request.status == 200) {
				http_remote_result = http_request.responseText;
				eval(http_remote_result);							
				eval(callback_function);		
				
			} 
			else {
				//alert("There was a problem with the request.");
			}
		}
	};
	http_request.open("POST", url, true);
	http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http_request.setRequestHeader("Content-length", parameters.length);
	http_request.setRequestHeader("Connection", "close");
	http_request.send(parameters);
	
}

function check_new_alert(logins_key) {
	
	
	if (logins_key > 0) {
		var URL = do_link("global", "ad_serve", "request=check_new_messages");
		
		remote_data_request(URL, "", "show_new_alert()");
		setTimeout("check_new_alert();", 10000);
	}
}

function show_new_alert() {
	//if (new_mail) {
		//document.getElementById('load_alert_mail').style.display = 'inline';
		//document.getElementById('load_alert_mail').innerHTML = new_mail + '<br>';
	//}
	//if (new_salam) {
		//document.getElementById('load_alert_salam').style.display = 'inline';
		//document.getElementById('load_alert_salam').innerHTML = new_salam + '<br>';
	//}
	//if (new_request_photo) {
		//document.getElementById('load_alert_request_photo').style.display = 'inline';
		//document.getElementById('load_alert_request_photo').innerHTML = new_request_photo + '<br>';
	//}
	//if (new_watchlist) {
		//document.getElementById('load_alert_watchlist').style.display = 'inline';
		//document.getElementById('load_alert_watchlist').innerHTML = new_watchlist + '<br>';
	//}
	if (new_alerts) {
		document.getElementById('load_new_alerts').style.display = 'inline';
		document.getElementById('load_new_alerts').innerHTML = new_alerts;
	}
	if (im_header_status) {
//		document.getElementById('load_im_header_status').style.display = 'inline';
//                alert(load_im_header_status.innerHTML);
                var re = new RegExp('http[s]{0,1}:\/\/','i');
                var m = re.exec(document.URL?document.URL:document.url);
		document.getElementById('load_im_header_status').innerHTML = im_header_status.replace('http://', m);
	}
	else {
//		document.getElementById('load_im_header_status').style.display = 'inline';
//		document.getElementById('load_im_header_status').innerHTML = '<img src=\"img/site/spacer.gif\" width=14 height=16>';
	}
	
	
}

