function addHeightLayer() {
	var intbodyheight = document.body.clientHeight + 30
	var intbodywidth = document.body.clientWidth
	document.getElementById('layer').style.height = ''+intbodyheight+'px';
	document.getElementById('map').style.left = ''+(intbodywidth-720)/2+'px';
}
function AlertForm (alerts,mode) {
	var AlertInput = alerts.split(",");
	var ModeInput = mode.split(",");
	for (i=0; i < AlertInput.length; i++){
	    if (ModeInput[i] == "hidden"){
		   	if (document.getElementById(AlertInput[i]).value == ""){
	 	       	document.getElementById(AlertInput[i]).className = 'alertinput';
				document.getElementById(AlertInput[i]).focus();
				return false;
			}
			else {
				document.getElementById(AlertInput[i]).className = '';
			}
		}
	}
}
//--------------------------------------------------------------------
function show_map(post){
	document.getElementById('layer').style.display ='';
	document.getElementById('map').style.display ='';
    map_do('map.asp'+post+'', 'map_data');
}

function close_map(){
	document.getElementById('layer').style.display ='none';
	document.getElementById('map').style.display ='none';
}

function loading_effect(k){
	ht = document.getElementsByTagName("html");
	if(k==1){
	    ht[0].style.cursor = 'wait';
	}else{
	    ht[0].style.cursor = 'auto';
	}
}

function map_do(url, id, post){
 	addHeightLayer();
	var xmlhttp=false;
    document.getElementById(id).innerHTML = '<div class="slr_loading"><img src="../images/loading.gif" width="16" height="16" align="absmiddle"/>&nbsp;در حال بارگذاری ...</div>';
	loading_effect(1);
    /*@cc_on @*/
    /*@if (@_jscript_version >= 5)
       	try {
        	xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');
        } 
        catch (e) {
            try {xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');} 
			catch (E) { 
            xmlhttp = false; 
            }
    	}
    @end @*/
	
	if(!xmlhttp) {xmlhttp=new XMLHttpRequest();}
	
	xmlhttp.open('POST', url, true);
    xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); post=post+'&my_time='+escape(new Date().getTime());
    xmlhttp.send(post); 
    xmlhttp.onreadystatechange = function() {
         if(xmlhttp.readyState == 4  && xmlhttp.status == 200){
            document.getElementById(id).innerHTML = xmlhttp.responseText;
			loading_effect(0);
         }
    }
}
