//判断浏览器ie6创建的div的样式和非ie6创建的div的样式
//创建div
function show(w,h){
var isIE = (document.all) ? true : false;
var isIE6 = isIE && ([/MSIE (\d)\.0/i.exec(navigator.userAgent)][0][1] == 6);
var newbox=document.createElement("div");
newbox.style.width=w+"px";
newbox.style.height=h+"px";
newbox.style.border="1px solid #000";
newbox.style.background="#fff"
newbox.style.zIndex="9999";
newbox.id = 'newnewbox';
document.body.appendChild(newbox);   
newbox.style.position = !isIE6 ? "fixed" : "absolute";
newbox.style.top = "10px";
newbox.style.left = "50%";
newbox.style.marginTop ="10px";
newbox.style.marginLeft = - newbox.offsetWidth / 2 + "px";
if(isIE6){
newbox.style.marginTop = "10px";
newbox.style.marginLeft = document.documentElement.scrollLeft - newbox.offsetWidth / 2 + "px";
window.attachEvent("onscroll",function(){
newbox.style.marginTop = "10px";
newbox.style.marginLeft = document.documentElement.scrollLeft - newbox.offsetWidth / 2 + "px";
})
}
}
function showid(idname){
var isIE = (document.all) ? true : false;
var isIE6 = isIE && ([/MSIE (\d)\.0/i.exec(navigator.userAgent)][0][1] == 6);
var newbox=document.getElementById(idname);
newbox.style.zIndex="9999";
newbox.style.display="block"
newbox.style.position = !isIE6 ? "fixed" : "absolute";
newbox.style.top ="10px";
newbox.style.left = "50%";
newbox.style.marginTop = "10px";
newbox.style.marginLeft = - newbox.offsetWidth / 2 + "px";   
var layer = document.getElementById("layer");
if (document.getElementById("layer") == null){
	layer=document.createElement("div");
	layer.id="layer";
	document.body.appendChild(layer);
}
 
	layer.style.width=layer.style.height="100%";
	layer.style.position= !isIE6 ? "fixed" : "absolute";
	layer.style.top=layer.style.left=0;
	layer.style.backgroundColor="#000";
	layer.style.zIndex="9998";
	layer.style.opacity="0.2";
	layer.style.display="block";
 

function layer_iestyle(){       
layer.style.width=Math.max(document.documentElement.scrollWidth, document.documentElement.clientWidth)

+ "px";
layer.style.height= Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight) +

"px";
}
function newbox_iestyle(){       
newbox.style.marginTop = "10px";
newbox.style.marginLeft = document.documentElement.scrollLeft - newbox.offsetWidth / 2 + "px";
}
if(isIE){layer.style.filter ="alpha(opacity=20)";}
if(isIE6){   
layer_iestyle()
newbox_iestyle();
window.attachEvent("onscroll",function(){                               
newbox_iestyle();
})
window.attachEvent("onresize",layer_iestyle)           
}   
layer.onclick=function(){newbox.style.display="none";this.style.display="none";}
}

function hideid(idname){
	if (document.getElementById(idname) != null){
		document.getElementById(idname).style.display = "none";
	}
	if (document.getElementById("layer") != null){
		document.getElementById("layer").style.display = "none";
	}
}

function ishidden(idname){
	if (document.getElementById(idname) != null){
		return  document.getElementById(idname).style.display == "none" ? true : false ;
	}
	return  false;
}

