GenericAssetModel.IMAGE = "IMAGE";
GenericAssetModel.TEXT = "TEXT";
GenericAssetModel.BUTTON = "BUTTON";
GenericAssetModel.CODE = "CODE";
GenericAssetModel.FORM = "FORM";
GenericAssetModel.RECTANGLE = "RECTANGLE";
/* generic asset model
================================================== */
function GenericAssetModel(){    
    this.isSelected;
    this.px = 10;
    this.py = 10;
    this.type;
    
    this.setPX = function(val){
        this.px = val;
        this.onChange();
    }
    this.getPX = function(){
        return this.px;
    }      
      
    this.setPY = function(val){
        this.py = val;
        this.onChange();
    } 
    this.getPY = function(){
        return this.py;
    }
    //set position
    this.setPosition = function(val){
        this.px = val.px;
        this.py = val.py;
        this.onChange();
    }
    
    //set selected
    this.setSelected = function(val){
        this.isSelected = val;
        this.onChange();
    }
    //get selected
    this.getSelected = function(){
        return this.isSelected;
    }           
    
    this.setZ=function(val){
        this.zindex = val;
        this.onChange();
    }
    
    this.setUrl = function(val){
        this.url = val;
    }
    
    
    this.setType = function(val){
        this.type = val;
    }
    this.getType = function(){
        return this.type;
    }    
    
    //incoming animation
    this.incomingAnimationTime;
    this.setIncomingAnimationTime = function(val){
        this.incomingAnimationTime = val;
        this.onChange();
    }
    this.getIncomingAnimationTime = function(){
        return parseFloat(this.incomingAnimationTime);
    }
    
    this.incomeStartAt;
    this.setIncomeStartAt = function(val){
        this.incomeStartAt = val;
        this.onChange();
    }
    this.getIncomeStartAt = function(val){
        return parseFloat(this.incomeStartAt);
    }    
    
    this.incomingAnimationType;
    this.setIncomingAnimationType = function(val){
        this.incomingAnimationType = val;
        this.onChange();
    }
    this.getIncomingAnimationType = function(){
        return this.incomingAnimationType;
    }
    
    this.incomingAnimationEfx;
    this.setIncomingAnimationEfx = function(val){
        this.incomingAnimationEfx  = val;
        this.onChange();
    }
    this.getIncomingAnimationEfx = function(){
        return this.incomingAnimationEfx;
    } 
    
    //outgoing animation
    this.outgoingAnimationTime;
    this.setOutgoingAnimationTime = function(val){
        this.outgoingAnimationTime = val;
        this.onChange();
    }
    this.getOutgoingAnimationTime = function(){
        return parseFloat(this.outgoingAnimationTime);
    }
    
    this.outgoingStartAt;
    this.setOutgoingStartAt = function(val){
        this.outgoingStartAt = val;
        this.onChange();
    }
    this.getOutgoingStartAt = function(val){
        return parseFloat(this.outgoingStartAt);
    }     
    
    this.outgoingAnimationType;
    this.setOutgoingAnimationType = function(val){
        this.outgoingAnimationType = val;
        this.onChange();
    }
    this.getOutgoingAnimationType = function(){
        return this.outgoingAnimationType;
    }
    
    this.outgoingAnimationEfx;
    this.setOutgoingAnimationEfx = function(val){
        this.outgoingAnimationEfx  = val;
        this.onChange();
    }
    this.getOutgoingAnimationEfx = function(){
        return this.outgoingAnimationEfx;
    }
    
    //is outgoing
    this.isOutgoing;
    this.setIsOutgoing = function(val){
        this.isOutgoing = val;
        this.onChange();
    }
    this.getIsOutgoing = function(){
        return (this.isOutgoing==undefined)?false:this.isOutgoing;
    }    
    
    
    //LINK BOX
    this.url;
    this.setURL = function(val){
        this.url = val;
        this.onChange();
    }
    this.getURL = function(){
        return this.url;
    }
    this.target;
    this.setTarget = function(val){
       this.target = val;
       this.onChange();
    }
    this.getTarget = function(){
       return this.target;
    } 
    
    //z-index
    this.zindex;
    this.setZindex = function(val){
        this.zindex = val;
        this.onChange();
    }
    this.getZindex = function(){
        return this.zindex;
    }
    
    //stop video on show
    this.stopVideoOnShow;
    this.setStopVideoOnShow = function(val){
        this.stopVideoOnShow = val;
        this.onChange(); 
    }
    this.getStopVideoOnShow = function(){
        return this.stopVideoOnShow;
    }
    
    //start video on exit
    this.startVideoOnExit;
    this.setStartVideoOnExit = function(val){
        this.startVideoOnExit = val;
        this.onChange(); 
    }
    this.getStartVideoOnExit = function(){
        return (this.startVideoOnExit==undefined)?false:this.startVideoOnExit;
    }              
    
}
GenericAssetModel.prototype = new GenericModel();


/* IMAGE ASSET MODEL
================================================== */
function ImageAssetModel(){
    this.imageUrl;
    this.setImage = function(img){
        this.imageUrl = img;
    }     
    this.getImage = function(){
        return this.imageUrl;
    }
    
    //play vid on click
    this.playVidOnClick;
    this.setPlayVidOnClick = function(val){
        this.playVidOnClick = val;
        this.onChange();
    }
    this.getPlayVidOnClick = function(){
        return this.playVidOnClick;
    }    
    
    //close advertise on click
    this.closeAdvertise;
    this.setCloseAdvertise = function(val){
        this.closeAdvertise = val;
        this.onChange();
    }
    this.getCloseAdvertise = function(val){
        return this.closeAdvertise;
    }       
}
ImageAssetModel.prototype = new GenericAssetModel();





/* TEXT ASSET MODEL
================================================== */
function TextAssetModel(){    
    //set text
    this.text;    
    this.setText = function(val){
        this.text = val;
        this.onChange();
    }     
    this.getText = function(){
        return this.text;
    }
    
    //font size
    this.fontSize;
    this.setFontSize = function(val){
        this.fontSize = val;
        this.lineHeight = val;
        this.onChange();
    }
    this.getFontSize = function(){
        return this.fontSize;
    }
    
    //line height
    this.lineHeight;
    this.getLineHeight = function(){
        return this.lineHeight;
    }
    
    //font color
    this.fontColor;
    this.setFontColor = function(val){
        this.fontColor = val;
        this.onChange();
    }
    this.getFontColor = function(){
        return this.fontColor;
    }
    
    //font data
    this.fontData;
    this.setFontData = function(val){
        this.fontData = val;
        this.onChange();
    }
    this.getFontData = function(){
        return this.fontData;
    }
    
    //font weight
    this.fontWeight;
    this.setFontWeight = function(val){
        this.fontWeight = val;
        this.onChange();
    }
    this.getFontWeight = function(){
        return this.fontWeight;
    }
    
    //font style
    this.fontStyle;
    this.setFontStyle = function(val){
        this.fontStyle = val;
        this.onChange();   
    }
    this.getFontStyle = function(){
        return this.fontStyle;
    }
    
    //text decoration
    this.textDecoration;
    this.setTextDecoration = function(val){
        this.textDecoration = val;
        this.onChange();
    }
    this.getTextDecoration = function(val){
        return this.textDecoration;
    }    
    
    //font align
    this.textAlign;
    this.setTextAlign = function(val){
        this.textAlign = val;
        this.onChange();
    }
    this.getTextAlign = function(){
        return this.textAlign;
    }
    
    //text backgroundColor
    this.backgroundColor;
    this.setBackgroundColor = function(val){
        this.backgroundColor = val;
        this.onChange();
    }
    this.getBackgroundColor = function(){
        return this.backgroundColor;
    }
    
}
TextAssetModel.prototype = new GenericAssetModel();




/* BUTTON ASSET MODEL
================================================== */
function ButtonAssetModel(){    
    //set text
    this.text;    
    this.setText = function(val){
        this.text = val;
        this.onChange();
    }     
    this.getText = function(){
        return this.text;
    }
    
    //button style
    this.buttonStyle;
    this.setButtonStyle = function(val){
        this.buttonStyle = val;
        this.onChange();
    }
    this.getButtonStyle = function(){
        return this.buttonStyle;
    }
    
    //play vid on click
    this.playVidOnClick;
    this.setPlayVidOnClick = function(val){
        this.playVidOnClick = val;
        this.onChange();
    }
    this.getPlayVidOnClick = function(){
        return this.playVidOnClick;
    }
    
    //close advertise on click
    this.closeAdvertise;
    this.setCloseAdvertise = function(val){
        this.closeAdvertise = val;
        this.onChange();
    }
    this.getCloseAdvertise = function(val){
        return this.closeAdvertise;
    }
    
}
ButtonAssetModel.prototype = new GenericAssetModel();

/* FORM ASSET MODEL
================================================== */
function FormAssetModel(){    
    //set background
    this.backgroundColor;    
    this.setBackgroundColor = function(val){
        this.backgroundColor = val;
        this.onChange();
    }     
    this.getBackgroundColor = function(){
        return this.backgroundColor;
    }
    
    //opacity
    this.opacity;
    this.setOpacity = function(val){
        this.opacity = val;
        this.onChange();
    }
    this.getOpacity = function(){
        return this.opacity;
    }
    
    //size
    this.width;
    this.setWidth = function(val){
        this.width = val;
        this.onChange();  
    }
    this.getWidth = function(val){
        return this.width;
    }
    
    this.height;
    this.setHeight = function(val){
        this.height = val;
        this.onChange(); 
    }
    this.getHeight = function(val){
        return this.height;
    } 
    
    this.setSize = function(val){
        this.width = val.w;
        this.height = val.h;
    }      
   
    
}
FormAssetModel.prototype = new GenericAssetModel();

/* RECTANGLE ASSET MODEL
================================================== */
function RectangleAssetModel(){    
    //set background
    this.backgroundColor;    
    this.setBackgroundColor = function(val){
        this.backgroundColor = val;
        this.onChange();
    }     
    this.getBackgroundColor = function(){
        return this.backgroundColor;
    }
    
    //opacity
    this.opacity;
    this.setOpacity = function(val){
        this.opacity = val;
        this.onChange();
    }
    this.getOpacity = function(){
        return this.opacity;
    }
    
    //size
    this.width;
    this.setWidth = function(val){
        this.width = val;
        this.onChange();  
    }
    this.getWidth = function(val){
        return this.width;
    }
    
    this.height;
    this.setHeight = function(val){
        this.height = val;
        this.onChange(); 
    }
    this.getHeight = function(val){
        return this.height;
    } 
    
    this.setSize = function(val){
        this.width = val.w;
        this.height = val.h;
    }      
   
    
}
RectangleAssetModel.prototype = new GenericAssetModel();



/* CODE ASSET MODEL
================================================== */
function CodeAssetModel(){    
    //set background
    this.backgroundColor;    
    this.setBackgroundColor = function(val){
        this.backgroundColor = val;
        this.onChange();
    }     
    this.getBackgroundColor = function(){
        return this.backgroundColor;
    }
    
    //size
    this.width;
    this.setWidth = function(val){
        this.width = val;
        this.onChange();  
    }
    this.getWidth = function(val){
        return this.width;
    }
    
    this.height;
    this.setHeight = function(val){
        this.height = val;
        this.onChange(); 
    }
    this.getHeight = function(val){
        return this.height;
    } 
    
    this.setSize = function(val){
        this.width = val.w;
        this.height = val.h;
    }
    
    //code
    this.codesrc;
    this.setCodeSrc = function(val){
        this.codesrc = val;
        this.onChange();
    }  
    this.getCodeSrc = function(){
        return this.codesrc;
    }
    
    
}
CodeAssetModel.prototype = new GenericAssetModel();


