		var opts = {
		addr: 'login.html',
		opacity: 0.8,
		bg: '#000'
	};
	var j = jQuery.noConflict();
function ajaxshow(searchkey,el,stype){
		j("#searchkey").val(searchkey);
		j("#stype").val(stype);
		//从服务器查询是否存在session
		j.ajax({
        type:"GET",
        url:"sessioncheck.asp?random()",
        data:"",
        timeout: 1000,
      	error: function(){
					alert('sorry, server is busy now!');
				},
        success:function(comments_data){
        	if(comments_data == 1){
        		el.createDialog(opts);
						j.startOver();
					}
        	else{
        		if(stype == 'collist'){
        			window.location.href = "collectionlist.asp";
        			}
        		else{
        		var sql = selectSQL(searchkey,stype);
        		window.location.href = sql;
        	}
        	}
        }
    });
	}
	function doajaxlogin(){
		var username = j('#username').attr("value");
		var pass = j('#password').attr("value");
		var searchkey = j('#searchkey').attr("value");
		var stype = j('#stype').attr("value");
		j.ajax({
        type:"GET",
        url:"ajaxlogin.asp?username="+username+"&password="+pass,
        data:"",
        timeout: 10000,
      	error: function(){
					alert('sorry, server is busy now!');
				},
        success:function(comments_data){
        	if(comments_data == 1){
        		if(stype == 'collist'){
        			window.location.href = 'collectionlist.asp';
        		}
        		else{
        		var sql = selectSQL(searchkey,stype);
        		window.location.href = sql;
        	}
        	}
        	else{
        		alert('wrong password!')
        		//关闭登录窗口
        		j.closeDialog();
        	}
        }
    });
	}
function selectSQL(skey,stype){
		var sql = "productlist.asp?";
		var mykey = "";
		mystr=skey.split(",");
		if(mystr.length>1){
		  for(var i=0;i<mystr.length;i++){
			  if(i<mystr.length-1)	mykey+=mystr[i]+"',"+"'"
			  else mykey+=mystr[i];
		  }
		}
		else{
			mykey = skey;
		}

		if("col" == stype){
			sql += "collectionkey="+mykey;
		}
		else if("func" == stype)
		{
			sql += "functionskey="+mykey;
		}
		else if("search" == stype)
		{
			sql += "searchkey="+mykey;
		}
		else if("mater" == stype)
		{
			sql += "materialkey="+mykey;
		}
		return sql;
	}
	
	
	
	function ajaxheadshow(el,stype){
		var searchkey = j("#headsearch").attr("value");
		j("#searchkey").val(searchkey);
		j("#stype").val(stype);
		//从服务器查询是否存在session
		j.ajax({
        type:"GET",
        url:"sessioncheck.asp",
        data:"",
        timeout: 1000,
      	error: function(){
					alert('sorry, server is busy now!');
				},
        success:function(comments_data){
        	if(comments_data == 1){
        		el.createDialog(opts);
						j.startOver();
					}
        	else{
        		var sql = selectSQL(searchkey,stype);
        		window.location.href = sql;
        	}
        }
    });
	}