/*----------------------------------------------------------
*****************  伍剑 斗地主 1.0  *****************
作者：张辉
网站：http://www.wj008.net 
程序员代号：wj008
联系QQ：496865687
版权：版权全体,源代码公开,各种用途均可免费使用
**********************************************************
----------------------------------------------------------*/
function Div(Img,str,type)
{
	this.Name="Card";
	this.value=str;
	this.Div=document.createElement("div");
	this.Div.style.position='absolute';
	
	if(type!=null&&(type==1||type==2))
	{
		this.Div.name='Card';
		this.Div.style.width='74px';
	    this.Div.style.height='98px';
	}
	
	
	//this.Div.style.backgroundColor='#ffffff';
	this.Div.style.visibility='hidden';
	if(Img!="")
	this.Div.innerHTML="<img src='"+Img+"'>";
	
	document.body.appendChild(this.Div);
	this.img=Img;
	this.x=0;
	this.y=0;
	this.z=0;
	this.top=false;
	this.visib=false
	var Y=this.y;
	this.GetDiv=function()
	{
		return this.Div;
	}
	
	if(type!=null&&type==1)
	{
		var Y=this.y;
	this.Div.onclick=function()
	{
		if(!this.top)
		{
		var a=Y-20;
		this.style.top=a+'px';
		AddCard(str);
		}
		else
		{
		var a=Y;
		this.style.top=a+'px';
		RemCard(str);
		}
		this.top=!this.top;
	}
	}
	this.SetClass=function(Classf)
	{
	this.Div.style.width=null;
	this.Div.style.height=null;
	this.Div.className=Classf;
	}
	this.SetId=function(Id)
	{
	this.Div.id=Id;
	}
	
	this.SetW=function(str)
		{
		 this.Div.style.width=str+'px';
		}
	this.SetH=function(str)
		{
		 this.Div.style.height=str+'px';
		}
	this.SetX=function(str)
		{
		 this.Div.style.left=str+'px';
		 this.x=str;
		}
	this.SetY=function(str)
		{
		 this.Div.style.top=str+'px';
		 this.y=str;
		 Y=str;
		}
	this.SetZ=function(str)
		{
		 this.Div.style.zIndex=str;
		 this.z=str;
		}
	this.SetXY=function(nx,ny)
	{
		this.Div.style.left=nx+'px';
		this.x=nx;
		this.Div.style.top=ny+'px';
		this.y=ny;
		Y=ny;
	}
	this.SetV=function(str)
	{
		if(str)
		{
			this.Div.style.visibility='visible';
			
		}
		else
		{
			this.Div.style.visibility='hidden';
			
		}
	}
	this.SetImg=function(imgurl,dz)
	{ 
	    if(dz!==null&&dz==1)
		this.Div.innerHTML="<img src='"+imgurl+"' style='filter: FlipH'>";
		else
		this.Div.innerHTML="<img src='"+imgurl+"'>";
		this.img=imgurl;
	}
	this.SetHtml=function(Html)
	{
		this.Div.innerHTML=Html;
	}
	this.remove=function()
	{
		document.body.removeChild(this.Div);
		
	}
		
}
function CardObj(sImg,nMunber)
{
	this.Img=sImg;
	this.Munber=nMunber;
	
}
