function card(id,name,rotation)
{var id=id;var name=name;var image_height=ReadingData["Reading"]["CardHeight"];var image_width=ReadingData["Reading"]["CardWidth"];var image_folder=ReadingData["Reading"]["DeckPath"];this.get_id=function(){return id}
this.get_name=function(){return name}
this.get_image_height=function(){return image_height}
this.get_image_width=function(){return image_width}
this.get_image_folder=function(){return image_folder}
this.set_name=function(new_name)
{name=new_name;}
this.set_image_folder=function(new_image_folder)
{image_folder=new_image_folder;}
this.rotation=rotation;}
card.prototype.get_image_path=function()
{if(this.rotation=="upright")
return"/"+this.get_id()+".jpg";else
return"/"+this.rotation+"/"+this.get_id()+"-"+this.rotation+".jpg";}
card.prototype.get_large_image_src=function(position)
{return this.get_image_folder()+"full_size"+this.get_image_path();}
card.prototype.get_card_image_src = function(position)
{return this.get_image_folder()+"table_card"+this.get_image_path();}
card.prototype.get_ghost_image_src = function(position)
{return this.get_image_folder()+"ghost.jpg";}
card.prototype.appendtodiv=function(target_div){
var card_div;if(!document.getElementById(target_div)){return;}else{card_div = document.getElementById(target_div);}
inames[inames.length]=target_div;var card=new Image();if(typeof disableFlipCards=='undefined'||!disableFlipCards){card.src=this.get_card_image_src(target_div);card.prototype=this.get_large_image_src(target_div);}
card.alt=this.get_name();var temp=picked_cards.length+1;picked_cards[picked_cards.length]=card;var i=document.createElement("IMG");i.src=this.get_ghost_image_src(target_div);i.name=target_div+"_img";i.id=target_div+"_img";if(typeof disableFlipCards=='undefined'||!disableFlipCards){i.style.cursor="pointer";i.onclick=function(){flip_over(temp)};}
if (typeof card_slot_angles != "undefined"){my_angle = card_slot_angles[target_div];if (typeof my_angle != 'undefined'){card_div.className = card_div.className + " card-rotate-" + my_angle;}}
card_div.appendChild(i);card_div.appendChild(document.createElement("BR"));
}

