// JavaScript Document

var pre="td0";
var HOME_PAGE="home.html";

function movein(tdid)
{	
	document.getElementById(tdid).className= tdid+"_move";		
}

function moveout(tdid)
{	
	document.getElementById(tdid).className= tdid;		
}




function movecss(tdid)
{	
	
	for(i=1; i<9; i++){
		if("td"+i !=pre){
			document.getElementById("td"+i).className= "td"+i;
		}
	}
	if(tdid !=pre){
		document.getElementById(tdid).className= tdid+"_move";	//如果当前移动的td不是按下状态，则出现移动状态。
	}
	
}

function presscss(tdid)
{
	pre=tdid;//记录当前被按下的td
	alert(tdid);
	//for(i=1; i<9; i++){				
		//document.getElementById("td"+i).className= "td"+i;			
	//}
	//document.getElementById(tdid).className= tdid+"_pressed";	
	//if(pre =="td1"){
		//pre="td0";
	//}
}

function noselected()
{
	if(pre!="td2" && pre!="td3" && pre!="td4" && pre!="td5" && pre!="td6" && pre!="td7" && pre!="td8" && pre!="td9"){
		for(i=1; i<9; i++){					
			document.getElementById("td"+i).className= "td"+i;	//全部恢复初始css
		}
	}	
}

function noselected2()
{
	for(i=1; i<9; i++){					
		document.getElementById("td"+i).className= "td"+i;	//全部恢复初始css
	}
}


function openwin(url){
	window.open(url,"_self");	
}


function changecontent(str, objid)//此函数用来更换iframe中的网页连接
{
	var obj = document.getElementById(objid);
	obj.src = str;
}

function SetWinHeight(obj)//此函数用来使iframe高度自动匹配。
{
	var win=obj;
	if (document.getElementById)
	{
		if (win && !window.opera)
		{
			if (win.contentDocument && win.contentDocument.body.offsetHeight)	
			win.height = win.contentDocument.body.offsetHeight;
			else if(win.Document && win.Document.body.scrollHeight)
			win.height = win.Document.body.scrollHeight;
		}
	}
}

<!--
//Create a boolean variable to check for a valid Internet Explorer instance.
var xmlhttp = false;
//Check if we are using IE.
try 
{
	//If the Javascript version is greater than 5.
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	//alert ("You are using Microsoft Internet Explorer.");
}catch (e) 
{
	//If not, then use the older active x object.
	try 
	{
		//If we are using Internet Explorer.
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		//alert ("You are using Microsoft Internet Explorer");
	} catch (E) 
	{
		//Else we must be using a non-IE browser.
		xmlhttp = false;
	}
}
//If we are using a non-IE browser, create a javascript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') 
{
	xmlhttp = new XMLHttpRequest();
	//alert ("You are not using Microsoft Internet Explorer");
}
function makerequest(serverPage, objID) //此函数用来更换DIV中的内容
{
	var obj = document.getElementById(objID);
	xmlhttp.open("GET", serverPage);
	xmlhttp.onreadystatechange = function() 
	{
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) 
		{
			obj.innerHTML = xmlhttp.responseText;
			if (serverPage == HOME_PAGE) {
				addBtn();
				iBanner();
			}		
		}
	}
	xmlhttp.send(null);
}

function popUpWindow(url,name,width,height) 
　　{ 
	window.open(url, name, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,width='+width+',height='+height+',left=200,top=200'); 
　　} 
