﻿// JavaScript Document
var CompanyCity = "长沙";
var FFextraHeight = 0;
 if(window.navigator.userAgent.indexOf("Firefox")>=1)
 {
  FFextraHeight = 16;
  }
  
  //iframe自适应
 function ReSizeiFrame(iframe)
 {
    var iframeHeight=0; 
    iframe.style.display = "block";  
    iframe.height=0;  
    if (iframe && !window.opera) {   
                     if (iframe.contentDocument && iframe.contentDocument.body.offsetHeight) {   
                        iframe.height = iframe.contentDocument.body.offsetHeight + 5;   
                        } 
                     else if (iframe.Document && iframe.Document.body.scrollHeight) {   
                             iframe.height = iframe.Document.body.scrollHeight + 5;   
                        }   

    }   
 }
 
 //获取get方式的值
function getArgs(query) {  
    var args = {}; 
        // Get query string 
   var pairs = query.split("&");  
                    // Break at ampersand 
    for(var i = 0; i < pairs.length; i++) { 
           var pos = pairs[i].indexOf('='); 
           // Look for "name=value" 
           if (pos == -1) continue; 
                   // If not found, skip 
              var argname = pairs[i].substring(0,pos);// Extract the name 
               var value = pairs[i].substring(pos+1);// Extract the value 
               value = value;// Decode it, if needed 
                args[argname] = value; 
                       // Store as a property 
       } 
    return args;// Return the object
} 
 

 //异步获取页面
 function loadFragmentInToElement(fragment_url, element_id) {
        var element = document.getElementById(element_id);
        var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        xmlhttp.open("GET", fragment_url + "&" + parseInt(10 * Math.random()));
        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                element.innerHTML = xmlhttp.responseText;
            }
        }
        xmlhttp.send(null);

        

    }







