function MyMM_openBrWindownew(canshu)
	 {	
	 	if(safari() && safari()==false) 
	 		var Top = document.body.scrollTop;
		else 
			var Top = document.documentElement.scrollTop;
		Top = Top + 100;

	 	var bWidth=parseInt(document.body.scrollWidth);
		
		var bHeight=parseInt(document.body.scrollHeight);

		if(bHeight<window.screen.height) bHeight =window.screen.height;

		var wd = bWidth/2-250;
		
		var styleStr1 = "height:"+bHeight+"px;width:"+bWidth+"px;display:block;position:absolute;z-index:1;top:0px;left:0px;background-color:#000;FILTER: alpha(opacity=40); opacity:0.4";
		var styleStr = "height:408px;width:470px;display:block;position:absolute;top:"+Top+"px;left:"+wd+"px;z-index:2;";//668
		document.getElementById("cxian").style.cssText=styleStr;
		document.getElementById("gb").style.cssText=styleStr1;
		 send_request('bigimg.asp?'+canshu+'');

	 }


	function cs(canshu,this1)
	{	
		
		if(parseInt(this1.style.width)>500) return;
		if(canshu=="no") {
			document.getElementById("cxian").style.display="none";
			return;
		}
		document.getElementById("cxian").style.display="block";
	}
	  function MyMM_openBrWindownewbenifit(canshu,top)
	 {	
	 	
		
	 	if(canshu=="no") {
			document.getElementById("cxian").style.display="none";
			return;
		}
		var Top = 300 + top;
	 	var bWidth=parseInt(document.body.scrollWidth);
		var bHeight=parseInt(document.body.scrollHeight);
		var wd = bWidth/2-60;
		var styleStr = "height:248px;width:368px;*width:360px;display:block;position:absolute;top:"+Top+"px;left:"+wd+"px;z-index:2;background:url(images/bj_tt.png) left 20px no-repeat;padding-top:30px; padding-left:10px;";
		document.getElementById("cxian").style.cssText=styleStr;
		send_request('bigimg1.asp?'+canshu+'');

	 }
	 
	 function gbwindow()
	 {
	 	
	 	document.getElementById("cxian").style.display = "none";
		document.getElementById("gb").style.display = "none";
	 }

//---------ajax------------------
var http_request = false;
 function send_request(url) {
  http_request = false;
 
  if(window.XMLHttpRequest) { 
   http_request = new XMLHttpRequest();
   if (http_request.overrideMimeType) {
    http_request.overrideMimeType("text/xml");
   }
  }
  else if (window.ActiveXObject) { 
   try {
    http_request = new ActiveXObject("Msxml2.XMLHTTP");
   } catch (e) {
    try {
     http_request = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {}
   }
  }
  if (!http_request) { 
   window.alert("error1");
   return false;
  }
  //alert(url)
  http_request.onreadystatechange = processRequest;
  http_request.open("GET", url, true);
  http_request.send(null);
 }
    function processRequest() {
        if (http_request.readyState == 4) { 
            //alert(http_request.status)  状态信息是第二页出现问题
			if (http_request.status == 200) { 
                document.getElementById("cxian").innerHTML=http_request.responseText;
    //document.getElementById("smalltype").innerHTML=http_request.responseText;
            } else { 
                alert("error2");
            }
        }
    }
	
	
	
function fj(can,can1,can2,can3,k1)
{
	//alert(pid);
	document.getElementById("ht").style.marginTop = "0px";
	var shu = can.split(",");
	var book1 = booksum.split(",");
	var book2 = booktotal.split(",");
	var id2= id.split(",");
	var pid2=pid.split(",");
	var two=k1.split(",");
	var id1 ="";
	var pid1="";
	document.getElementById("tj1").align = "center";
	document.getElementById("tj1").innerHTML ="";
	var hr ="";
	for(var i=0;i<shu.length;i++)
	{
		if(shu[i]=="") continue;
		 id1=id1+id2[i]+",";
		 pid1=pid1+pid2[i]+",";
		 var qudai = shu[i].replace(/<<</g," "); 
		hr += '<table width="95%" border="0" cellspacing="0" cellpadding="0" style="margin-top:10px;"><tr><td height="28" align="left" valign="top" id="tj" class="ziti_3">'+qudai+'&nbsp;&nbsp;</td><td>&nbsp;</td><td align="right" valign="top"  onclick=jia("delete1","'+shu[i]+'","'+id2[i]+'","'+book1[i]+'","'+book2[i]+'");jiaShuzi("'+book1[i]+'","'+two[i]+'",false) class="ziti_4">Delete</td></tr></table></td></tr></table>';

	}
	document.getElementById("tj1").innerHTML = hr;
	//alert(hr)
	//document.getElementById("ht").style.marginTop=top(can3)-top(document.getElementById("ht"))+"px";
//	document.getElementById("ht").style.marginTop = parseInt
	document.form1.id.value = id1;
	document.form1.pid.value = pid1;
	
}

function pd(can1,can2,can3,can4)
{
	var png="";
	for(var u=1;u<=can1;u++)
	{

		if(can3=="deletel")
		{
			if(document.getElementById("a"+can2+u))
				document.getElementById("a"+can2+u).src="images/but_add_0"+can4+".jpg";
				document.getElementById("a"+can2+u).style.cursor = "pointer";

		}
		else
		{
			if(document.getElementById("a"+can2+u))
			{
				var but = "images/button_change.png";
				if(ie()==false) but = "images/button_change.gif";
				document.getElementById("a"+can2+u).src=but;
				document.getElementById("a"+can2+u).style.cursor = "default";
			}
		}
		
	}
	
}

function cz(can)
{
	
	var idValue = document.form1.id.value;
	idValue = idValue.split(",");

	if(idValue.length-1!=can)
	{	
		if(document.getElementById("tj1").innerHTML.indexOf("Please finish")<=0)
		{
			document.getElementById("tj1").innerHTML += '<span class="A_subregister01pinkc"><br>Please finish your book <br>selection before continuing!</span><img src="images/not.gif" />';
			document.getElementById("tj1").align = "left";
		}
		location.href = "#top"
		return;
	}

	document.form1.submit();

}
function safari()
{
	var Sys = {};
     var ua = navigator.userAgent.toLowerCase();
      if (window.openDatabase)
	  {
          Sys.safari = ua.match(/version\/([\d.]+)/)[1];
		  return Sys.safari;
	  }
		
		
		//--firefox
		is_opera = /opera/i.test(navigator.userAgent);  
		var is_ie = (/msie/i.test(navigator.userAgent) && !is_opera) 
		return is_ie;
}
var more = 0;
function hd()
{
	if(more>3) return;
	if(safari()==true)
		document.getElementById("ht").style.height = parseInt(document.getElementById("height1").offsetHeight) -66 +"px";
	else
		document.getElementById("ht").style.height = parseInt(document.getElementById("height1").offsetHeight) -47 +"px";
	if(safari() && safari()==false) 
		{
			if(document.getElementById("height1").offsetHeight<300)
				document.getElementById("ht").style.height = parseInt(document.getElementById("height1").offsetHeight) + 48+"px";
			else
				document.getElementById("ht").style.height = parseInt(document.getElementById("height1").offsetHeight) + 378 +"px";
		}
		more++;
}	

function top(element){
	var offsetTop = element.offsetTop;
	var offsetLeft = element.offsetLeft;

	while(element = element.offsetParent) 
	{
		offsetTop += element.offsetTop;
		offsetLeft += element.offsetLeft;
	}
	return offsetTop;

}


//090701 by dht
function jiaShuzi(i,k,pd)
{
	//alert(i+"<br>"+k)
	var objectTu = document.getElementById("a"+i+k);
	var object = document.getElementById("shuzi"+i+k);	
	if(pd==false)
	{
		if(object.innerHTML=="") 
			var JianZhi=0;
		else
			var JianZhi = parseInt(object.innerHTML) -1;
			
		if(JianZhi<=0) JianZhi="";
		object.innerHTML = JianZhi;
		img(i,k,parseInt(object.innerHTML));
		return;
	}
	if(objectTu.src.indexOf("button_change")>=0) return;	
	var Zhi= "b" + i + k;
	if(Find(Biao,Zhi)==true) 
	{		
		
		if(object.innerHTML=="") 
			var Add=1;
		else
			var Add = parseInt(object.innerHTML) + 1;
		//if(Add==NaN) Add=1;	
		object.innerHTML = Add;
	}		
	else
	{
		object.innerHTML = "1";
	}
		
	Biao.push(Zhi);
	img(i,k,parseInt(object.innerHTML));
}
function img(i,k,num)
{
	var img_t="";
	for(var j=0;j<num;j++)
	{
		img_t+='<img src="images/select_ye.gif" />&nbsp;';
	}
	document.getElementById("img1"+i+k).innerHTML=img_t;
}

function Find( Biao , Zhi )
{
    if(Biao == null || Zhi =="" ) 
        return false;
    for( var i=0 ; i < Biao.length ; i++ )
    {
        if( Biao[i] == Zhi ) return true;
    }
    
    return false;
}