//判断浏览器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 =newbox.style.left = "50%";
newbox.style.marginTop = - newbox.offsetHeight / 2 + "px";
newbox.style.marginLeft = - newbox.offsetWidth / 2 + "px";
if(isIE6){
newbox.style.marginTop = document.documentElement.scrollTop - newbox.offsetHeight / 2 + "px";
newbox.style.marginLeft = document.documentElement.scrollLeft - newbox.offsetWidth / 2 + "px";
window.attachEvent("onscroll",function(){
newbox.style.marginTop = document.documentElement.scrollTop - newbox.offsetHeight / 2 + "px";
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 =newbox.style.left = "50%";
newbox.style.marginTop = - newbox.offsetHeight / 2 + "px";
newbox.style.marginLeft = - newbox.offsetWidth / 2 + "px"; 
var layer=document.createElement("div");
layer.id="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.6";
document.body.appendChild(layer);
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 = document.documentElement.scrollTop - newbox.offsetHeight / 2 + "px";
newbox.style.marginLeft = document.documentElement.scrollLeft - newbox.offsetWidth / 2 + "px";
}
if(isIE){layer.style.filter ="alpha(opacity=60)";}
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";}
closefava.onclick=function(){newbox.style.display="none";layer.style.display="none";}
closelogin.onclick=function(){newbox.style.display="none";layer.style.display="none";}
}
function Checkshoucang(){
var taget2_obj = document.getElementById('shoucang');
myajax2 = new DedeAjax(taget2_obj,false,false,"","","");
}

function CheckLogin(){
var taget_obj = document.getElementById('smallLay');
myajax = new DedeAjax(taget_obj,false,false,"","","");
myajax.SendGet("/info.php");
}
function shoucang(id,classid)
{
var iframe=document.getElementById("yyshoucang");
iframe.src="/e/member/fava/add/add.php?classid="+classid+"&id="+id;
}

