//建立xmlhttp实例
function createAjax() {            //该函数将返回XMLHTTP对象实例 
    var _xmlhttp; 
    try {     
        _xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");    //IE的创建方式 
    } 
    catch (e) { 
        try { 
            _xmlhttp=new XMLHttpRequest();    //FF等浏览器的创建方式 
        } 
        catch (e) { 
            _xmlhttp=false;        //如果创建失败，将返回false 
        } 
    } 
    return _xmlhttp;    //返回xmlhttp对象实例
	
} 
//模拟alert
function ShowAlert(title,content)
        {
            var pop=new Popup({ contentType:4,isReloadOnClose:false,width:340,height:80});
            pop.setContent("title",title);
            pop.setContent("alertCon",content);
            pop.build();
            pop.show();
        }
//模拟confirm
 function ShowConfirm(title,content,url)
        {
           var pop=new Popup({ contentType:3,isReloadOnClose:false,width:340,height:80});
           pop.setContent("title",title);
           pop.setContent("confirmCon",content);
           pop.setContent("callBack",ShowCallBack);
           pop.build();
           pop.show();
		   function ShowCallBack()
			{
				window.location=url
			}
        }
		
//模拟Iframe
 function ShowIframe(title,url,w,h)
		{
       var pop=new Popup({ contentType:1,scrollType:'no',isReloadOnClose:false,width:w,height:h});
       pop.setContent("contentUrl",url);
       pop.setContent("title",title);
       pop.build();
       pop.show();
        }
//关闭弹出层
function close_frame()
{
window.top.document.getElementById("dialogCase").style.display='none';	
	}

//连接触发表单
function submit_search()
{
skey = document.getElementById("skey").value;
if (skey=="")
{
	ShowAlert("提示信息","请输入搜索关键词!")
		return false;	
	}
	else{
document.getElementById("formSearch").submit();	
	}
	
	}
	
	
function jiage(str,str1){
if (str==1){
	document.getElementById("jg1"+str1).style.display="";
	document.getElementById("jg2"+str1).style.display="none";
	}else
	{
		document.getElementById("jg1"+str1).style.display="none";
	document.getElementById("jg2"+str1).style.display="";
		}
}

function buy(str,str1)
{
var exitdos =createAjax();
exitdos.open("GET","chklogin.php",false);	
exitdos.send(null);
var aaa=unescape(exitdos.responseText);
if (aaa==1){
	ShowIframe('会员登陆','login.php','400','180')
	//alert ("请登陆系统");
	return false;
	}
	else
	{
ShowConfirm('提示信息','确认购买?',"buy.php?id="+str+"&zh="+str1)	
	}

}
function showmore(id)
{
document.getElementById("bb"+id).style.display="";
}
	function showmore1(id)
{
	document.getElementById("bb"+id).style.display="none";
	}