
	//-- Ajax HTTPRequest Gloabl variable
      	var ajaxhttprequest = null;
	//--end here

	function get_timezone(id,url){  // fn will content to webserver in backend to perform code name unique validation

	  document.getElementById('loading_span').style.display='none';  //remove the previous loading msg

      document.getElementById('loading_span').style.display='block';  // display the new msg
      
	  var temp_timezone = new Array();
	  
	  temp_timezone = id.split(',');
     
      // parameters need to be send to webserver for manipulation

      var poststr="id="+temp_timezone[0];

      // i am using ajax to connect to web server and acess 'dest_status_display.php' file for getting status of dest location

      if(typeof ajaxhttprequest == 'object') ajaxhttprequest = null;

      if (window.XMLHttpRequest){              //IE7 and mozilla

            ajaxhttprequest = new XMLHttpRequest();

      }else if(window.ActiveXObject){  // IE <=6

        	ajaxhttprequest = new ActiveXObject("Microsoft.XMLHTTP");  // to avoid the cache problem in IE

      }else{

        	ajaxhttprequest = null;
      }

      if (ajaxhttprequest != null){

            ajaxhttprequest.open("POST", url,true); // post method

            // content type

            ajaxhttprequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

        	ajaxhttprequest.setRequestHeader("Content-length", poststr.length);

        	ajaxhttprequest.setRequestHeader("Connection", "close");

        	if(navigator.appName == "Microsoft Internet Explorer"){  // IE

          		ajaxhttprequest.onreadystatechange = ajax_response;  // this fn will be called if web server response state changes

        	}else{  // Firefox,Safari

          		ajaxhttprequest.onload = ajax_response;  // this fn will be called if web server response state changes

        	}

        	ajaxhttprequest.send(poststr);  // send the parameter to web server
       }

    }
    
    function ajax_response(){  // if there is any response from webserver through ajax this fn will execute

        if (ajaxhttprequest.readyState == 4 && ajaxhttprequest.status == 200) {  //'4'  means we received response from webserver
       
            var res = ajaxhttprequest.responseText;

            if(res=='error'){

                 alert("we can't able to process your request, please try again");
                 
                 document.getElementById('loading_span').style.display='none';  //remove the previous loading msg

                 return false;

             }else{
             	
             	 document.getElementById('get_timezone').innerHTML = "";
             	 
             	 document.getElementById('get_timezone').innerHTML = res;
             	 
             	 document.getElementById('loading_span').style.display='none';  //remove the previous loading msg
             }
        }
    }
    
    