function NowLi( N , City , Where )
{
	document.getElementById("NowLi").value =   1 + N;
	document.getElementById("Flag").value =   1 ;
	if(N==0){document.getElementById("LI2").style.background="url()";}
	if(N==1){document.getElementById("LI3").style.background="url()";}
	
	if( N == 777 )
	{ ViSupperShow(City );}
 	else
	{
	
	CityShow( City ,Where );
	
	}
}


function ViSupperShow(City)
{
	$("Super").value = 13640661;
	$("NowLi").value == 2 ;
	LoadingVIShow(City);
	
	return false;
}


function CityShow( City ,Where )
{
	AjaxGetData( City , Where);
}



function LoadingVIShow( URL )
{
	
	
	//Iframe( 'Black.htm' );
	Iframe( URL );



}



















/////////////////////   

function Iframe(url)
{
	var Content = '<iframe id="F_Content" name="F_Content" width="670" height="405" border="0" frameborder="0" scrolling="no" src="'+url+'"></iframe>' ;
	document.getElementById("LI3").innerHTML = Content;
	//document.write('<iframe id="F_Content" name="F_Content" width="'+w+'" height="'+h+'" border="0" frameborder="0" scrolling="no" src="'+url+'"></iframe>');
} 





//  判断 高度
function reinitIframe()
{
	var iframe = document.getElementById("F_Content");
	try
	{
		var bHeight = iframe.contentWindow.document.body.scrollHeight;
		var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
		var height = Math.max(bHeight, dHeight);
		iframe.height =  height;
	}catch (ex){}
}
//window.setInterval("reinitIframe()", 2000);












var id;

function AjaxGetData(url,sid){
        //调用AJAX
		id = sid;
        document.getElementById(id).innerHTML = "Loading...";
		if (window.XMLHttpRequest) {
            // 非IE浏览器
            req = new XMLHttpRequest();
            req.onreadystatechange = processStateChange;
            
            try {
                req.open("GET", url, true);
            } catch (e) {
            //alert("Server Communication Problem "+e);
			document.getElementById(id).innerHTML = e;
            }
            req.send(null);
        } else if (window.ActiveXObject) {
            // IE
            req = new ActiveXObject("Microsoft.XMLHTTP");
            
            if (req) {
                req.onreadystatechange=processStateChange;
                req.open("GET", url, true);
                req.send();
            }
    
        }
    }

function processStateChange()
{
	
	if (req.readyState == 4) { // 完成
		if (req.status == 200) { // 响应正常
			//将响应的文本分割成Span元素
			//alert(id+" "+req.responseText);
			document.getElementById(id).innerHTML = req.responseText;
			
		} else {
			document.getElementById(id).innerHTML =  req.statusText;
		}
	}
}



/*
function VIShow( N )
{
	AjaxGetData();
	return false;
}
*/
