//IFRAME TEMPLATES
function IFrameTemplates(){
    //get video template editor
    this.getVideoTemplateEditor = function(videoID, w, h, iFrameID){
        var tmpl = '<iframe id="editor_'+iFrameID+'" width="'+w+'" height="'+h+'" src="https://www.youtube.com/embed/'+videoID+'?rel=0&amp;wmode=transparent" frameborder="0" allowfullscreen></iframe>';
        return tmpl;
    }
    
    this.getVideoTemplateFallback = function(videoID, w, h, iFrameID){
        var tmpl = '<iframe id="editor_'+iFrameID+'" width="'+w+'" height="'+h+'" src="https://www.youtube.com/embed/'+videoID+'?rel=0" frameborder="0" allowfullscreen></iframe>';
        return tmpl;
    }    
    
    //get video template preview
    this.getVideoITemplate = function(videoID, w, h, iFrameID){
        var id = IFrameTemplates.ITEMPLATE+iFrameID;
        var tmpl = '<iframe id="'+id+'" width="'+w+'" height="'+h+'" src="https://www.youtube.com/embed/'+videoID+'?enablejsapi=1&rel=0&version=3&playerapiid='+id+'" frameborder="0" allowfullscreen></iframe>';
        return tmpl;
    }    
}
IFrameTemplates.getInstance=function(){
    if(IFrameTemplates.instance==null){
        IFrameTemplates.instance = new IFrameTemplates();
    }
    return IFrameTemplates.instance;
}
IFrameTemplates.ITEMPLATE = "video_";

//APP DEFAULTS
function Defaults(){
    
    this.buildDefaults = function(obj){
        obj.setIncomingAnimationTime(0.2);
        obj.setIncomeStartAt(1);
        obj.setOutgoingStartAt(10);
        obj.setIncomingAnimationType(Presets.getInstance().getIncommingAnimationTypes()[0].val);
        obj.setIncomingAnimationEfx(Presets.getInstance().getEffects()[0].efx);        
        obj.setOutgoingAnimationTime(0.2);
        obj.setOutgoingAnimationType(Presets.getInstance().getOutgoingAnimationTypes()[0].val);
        obj.setOutgoingAnimationEfx(Presets.getInstance().getEffects()[0].efx); 
        obj.setURL('');
        obj.setTarget('_blank');
        obj.setStopVideoOnShow(false);
        return obj;        
    }
    
    //default text model
    this.getDefaultTextModel = function(){
        var txtM = new TextAssetModel();
        this.buildDefaults(txtM);
        txtM.setType(GenericAssetModel.TEXT);
        txtM.setPX(100);
        txtM.setPY(150);        
        txtM.setText('video ad');
        txtM.setFontSize(50);
        txtM.setFontColor('000000');
        txtM.setFontData(Fonts.getInstance().getFont(0));
        txtM.setFontWeight('normal');
        txtM.setFontStyle('normal');
        txtM.setTextDecoration('none');
        txtM.setTextAlign('left');
        txtM.setBackgroundColor('');                
        return txtM;
    }
    
    //default image model
    this.getDefaultImageModel = function(){
        var imgM = new ImageAssetModel();
        this.buildDefaults(imgM);
        imgM.setType(GenericAssetModel.IMAGE);
        imgM.setPX(50);
        imgM.setPY(50);
        imgM.setPlayVidOnClick(false); 
        imgM.setCloseAdvertise(false);                  
        return imgM;
    }
    
    //default rectangle model
    this.getRectangleModel = function(){
        var recObj = new RectangleAssetModel();
        this.buildDefaults(recObj);
        recObj.setType(GenericAssetModel.RECTANGLE);
        recObj.setPX(150);
        recObj.setPY(50);
        recObj.setWidth(170);
        recObj.setHeight(90);
        recObj.setBackgroundColor('000000');
        recObj.setOpacity(.5);        
        return recObj;       
    }
	
	//default form model
    this.getDefaultFormModel = function(){
        var formObj = new FormAssetModel();
        this.buildDefaults(formObj);
        formObj.setType(GenericAssetModel.FORM);
        formObj.setPX(150);
        formObj.setPY(50);
        formObj.setWidth(170);
        formObj.setHeight(90);
        formObj.setBackgroundColor('000000');
        formObj.setOpacity(.5);        
        return formObj;       
    }
    
    //default code model
    this.getCodeModel = function(){
        var codeObj = new CodeAssetModel();
        this.buildDefaults(codeObj);
        codeObj.setType(GenericAssetModel.CODE);
        codeObj.setPX(150);
        codeObj.setPY(250);
        codeObj.setWidth(468);
        codeObj.setHeight(60);
        codeObj.setBackgroundColor('CCC');
        codeObj.setCodeSrc('');
        return codeObj;       
    }    
    
    
    
    //default button model
    this.getDefaultButtonModel = function(){
        var btnM = new ButtonAssetModel();
        this.buildDefaults(btnM);
        btnM.setType(GenericAssetModel.BUTTON);
        btnM.setButtonStyle(this.getButtonStyles()[0].btn_class);
        btnM.setText('Label');
        btnM.setPX(50);
        btnM.setPY(100);
        btnM.setPlayVidOnClick(false); 
        btnM.setCloseAdvertise(false);        
        return btnM;
    }
    this.getButtonStyles = function(){
        var styles = new Array();
        styles.push({btn_class:'sk_orange', name: 'Orange'});
        styles.push({btn_class:'sk_red', name: 'Red'});
        styles.push({btn_class:'sk_blue', name: 'Blue'});
        styles.push({btn_class:'sk_green', name: 'Green'});
        styles.push({btn_class:'sk_black', name: 'Black'});
        styles.push({btn_class:'sk_grey', name: 'Grey'});
        return styles;
    }    
}
Defaults.getInstance=function(){
    if(Defaults.instance==null){
        Defaults.instance = new Defaults();
    }
    return Defaults.instance;
}

//AVAILABLE FONTS
function Fonts(){    
    
    this.fontData;
    this.getAllFonts = function(){
        this.fontData = new Array();
        this.fontData.push({ID: 0, fontDisplayName: 'Arial', font: 'Arial, Helvetica, sans-serif'});
        this.fontData.push({ID: 1, fontDisplayName: 'Arial Black', font: 'Arial Black, Gadget, sans-serif'});
        this.fontData.push({ID: 2, fontDisplayName: 'Comic Sans MS', font: 'Comic Sans MS, cursive, sans-serif'}); 
        this.fontData.push({ID: 3, fontDisplayName: 'Impact', font: 'Impact, Charcoal, sans-serif'});
        this.fontData.push({ID: 4, fontDisplayName: 'Lucida Sans', font: 'Lucida Sans, Lucida Grande'});
        this.fontData.push({ID: 5, fontDisplayName: 'Tahoma', font: 'Tahoma, Geneva, sans-serif'});
        this.fontData.push({ID: 6, fontDisplayName: 'Trebuchet MS', font: 'Trebuchet MS, Helvetica, sans-serif'});
        this.fontData.push({ID: 7, fontDisplayName: 'Verdana', font: 'Verdana, Geneva, sans-serif'});
        this.fontData.push({ID: 8, fontDisplayName: 'Courier New', font: 'Courier New, Courier, monospace'});
        this.fontData.push({ID: 9, fontDisplayName: 'Lucida Console', font: 'Lucida Console, Monaco, monospace'});

        return this.fontData;
    } 
        
    this.getFontByID = function(ID){
        
    }
    
    this.getFont = function(indx){
        var obj = {ID: 0, fontDisplayName: 'Helvetica', font: 'Helvetica'};
        if(this.getAllFonts()[indx]!=undefined){
            obj = this.getAllFonts()[indx];
        }
        return obj;
    }       
}
Fonts.getInstance=function(){
    if(Fonts.instance==null){
        Fonts.instance = new Fonts();
    }
    return Fonts.instance;
}



//TEMPLATES
function SkTemplates(){                   
    
    //get incoming
    this.getIncomming = function(type, efx){        
        var animationTypes = Presets.getInstance().getIncommingAnimationTypes();
        var animationsT = '';        
        for(var i=0;i<animationTypes.length;i++){
            var selected_type = '';
            (type==animationTypes[i].val)?selected_type="selected":'';
            animationsT += '<option '+selected_type+' value="'+animationTypes[i].val+'">'+animationTypes[i].name+'</option>';
        }
        var efxs = Presets.getInstance().getEffects();
        var efxsT = '';
        for(var j=0;j<efxs.length;j++){
            var selected_efx = '';
            (efx==efxs[j].efx)?selected_efx="selected":'';
            efxsT += '<option '+selected_efx+' value="'+efxs[j].efx+'">'+efxs[j].efx+'</option>';
        }
        var tmpl = ''+
            '<!--incoming animation box-->'+
            '<p class="contentboxTitle">Incoming animation</p>'+           
            '<div id="incommingAnimation" class="contentBoxProperties contentBoxBackground">'+             
                '<p class="contentBoxSubtitle">Animation type</p>'+
                
                '<!--animation type-->'+
                '<select class="contentboxSelect atype">'+
                    animationsT+

                '</select>'+
                '<!--/animation type-->'+
                
                '<div class="hLine"></div>'+
                
                '<!--animation efx-->'+
                '<p class="contentBoxSubtitle">Animation effect</p>'+
                '<select class="contentboxSelect efx">'+
                    efxsT+
                '</select>'+
                '<!--/animation efx-->'+
                
                '<div class="hLine"></div>'+
                
                 '<!--animation start-->'+
                '<p class="contentBoxSubtitle">Start at</p>'+
                '<input class="spinnerBoxStart" name="value" value=".5" />'+'<label class="customLabel">sec</label>'+
                '<!--/animation start-->'+ 
                
                '<div class="hLine"></div>'+
                
                '<!--animation duration-->'+
                '<p class="contentBoxSubtitle">Duration</p>'+
                '<input class="spinnerBox" name="value" value=".5" />'+'<label class="customLabel">sec</label>'+
                '<!--/animation duration-->'+                                                                         
                
            '</div>'+
            '<!--/incoming animation box-->';        
        
        return tmpl;
    }
    
    
    //get incoming
    this.getOutgoing = function(type, efx, isOut){        
        var animationTypes = Presets.getInstance().getOutgoingAnimationTypes();
        var animationsT = '';        
        for(var i=0;i<animationTypes.length;i++){
            var selected_type = '';
            (type==animationTypes[i].val)?selected_type="selected":'';
            animationsT += '<option '+selected_type+' value="'+animationTypes[i].val+'">'+animationTypes[i].name+'</option>';
        }
        var efxs = Presets.getInstance().getEffects();
        var efxsT = '';
        for(var j=0;j<efxs.length;j++){
            var selected_efx = '';
            (efx==efxs[j].efx)?selected_efx="selected":'';
            efxsT += '<option '+selected_efx+' value="'+efxs[j].efx+'">'+efxs[j].efx+'</option>';
        }
        var checked_outgoing = '';
        (isOut==true)?checked_outgoing='checked':checked_outgoing='';
        var tmpl = ''+
            '<!--outgoing animation box-->'+        
                           
                '<!--is outgoing-->'+
                '<div style="margin-top:15px;">'+
                '<input id="isOotgoingAnimation" type="checkbox" value="ON" '+checked_outgoing+' />'+'<label class="customLabel">Use outgoing animation</label>'+
                '<!--/is outgoing-->'+         
                '</div>'+
                '<p id="outgoingTitle" class="contentboxTitle">Outgoing animation</p>'+      
                     
            '<div id="outgoingAnimation" class="contentBoxProperties contentBoxBackground">'+             
                '<p class="contentBoxSubtitle">Animation type</p>'+
                
                '<!--animation type-->'+
                '<select class="contentboxSelect atype">'+
                    animationsT+

                '</select>'+
                '<!--/animation type-->'+
                
                '<div class="hLine"></div>'+
                
                '<!--animation efx-->'+
                '<p class="contentBoxSubtitle">Animation effect</p>'+
                '<select class="contentboxSelect efx">'+
                    efxsT+
                '</select>'+
                '<!--/animation efx-->'+
                
                '<div class="hLine"></div>'+
                
                '<!--animation start-->'+
                '<p class="contentBoxSubtitle">End at</p>'+
                '<input class="spinnerBoxStart" name="value" value=".5" />'+'<label class="customLabel">sec</label>'+
                '<!--/animation start-->'+                 
                
                '<div class="hLine"></div>'+
                
                '<!--animation duration-->'+
                '<p class="contentBoxSubtitle">Duration</p>'+
                '<input class="spinnerBox" name="value" value=".5" />'+'<label class="customLabel">sec</label>'+
                '<!--/animation duration-->'+                                                                          
                
            '</div>'+
            '<!--/outgoing animation box-->';        
        
        return tmpl;
    }
    
    
    //get remove box
    this.getRemove = function(stopVideo, playVideo){
        var checked = '';
        if(stopVideo){
            checked = 'checked';
        }
        var checked_exit;
        (playVideo)?checked_exit='checked':checked_exit='';   
        var tmpl = ''+
        '<div class="propertiesBox">'+
            '<p class="contentboxTitle">General properties</p>'+
            '<!--remove box-->'+
            '<div id="removeBox" class="contentBoxProperties contentBoxBackground boxPropExtra">'+             
                '<a class="button-secondary removeObjBTN">Remove object</a>'+
                
                '<div class="hLine"></div>'+
                
                '<!--z-index-->'+
                '<input class="spinnerBox" name="value" value=".5" />'+'<label class="customLabel">Z-index</label>'+
                '<!--/z-index-->'+
                
                '<div class="hLine"></div>'+ 
                
                '<!--stop video checkbox-->'+
                '<input id="stopAnimationCB" type="checkbox" value="ON" '+checked+' />'+'<label class="customLabel">Stop video on show</label>'+
                '<!--/stop video checkbox-->'+
                
                '<div class="hLine"></div>'+ 
                
                '<!--play video checkbox'+
                '<input id="stopExitAnimationCB" type="checkbox" value="ON" '+checked_exit+' />'+'<label class="customLabel">Play video on exit</label>'+
                'play video checkbox-->'+                                                 
                
            '</div>'+
            '<!--/remove box-->'+                                                         
        '</div>';
        return tmpl;
    }    
    
    //get URL template
    this.getURLTemplate = function(url, target){
        var selected_self='';
        var selected_blank='';
        (target=='_self')?selected_self='selected':selected_self='';
        (target=='_blank')?selected_blank='selected':selected_blank='';
        var tmpl = ''+
            '<div class="propertiesBox propertiesSpace">'+
                '<!--link box-->'+
                '<p class="contentboxTitle">Object URL</p>'+           
                '<div id="linkBox" class="contentBoxProperties contentBoxBackground boxPropExtra">'+                
                    '<!--target type-->'+
                    '<p class="contentBoxSubtitle">URL</p>'+
                    '<input class="inputText" type="text" name="" value="'+url+'" />'+
                    '<!--target type-->'+              
                    
                    '<div class="hLine"></div>'+
                                                                    
                    '<!--target type-->'+
                    '<p class="contentBoxSubtitle">Target</p>'+
                    '<select class="contentboxSelect target">'+
                        '<option '+selected_self+' value="_self">Self</option>'+
                        '<option '+selected_blank+' value="_blank">Blank</option>'+
                    '</select>'+
                    '<!--target type-->'+                                  
                '</div>'+
                '<!--/link box-->'+
            '</div>';
        return tmpl;
    }
    
    
    
    //get image prop template
    this.getImageMainProp = function(playVid, closeAds){
        var closeAllAds = '';        
        (closeAds==true)?closeAllAds = 'checked':closeAllAds='';
        var playVidChecked = '';
        (playVid==true)?playVidChecked = 'checked':playVidChecked='';

        var tmpl = ''+
        '<div class="propertiesBox propertiesSpace">'+
            '<p class="contentboxTitle">Image properties</p>'+
            '<!-- box-->'+
            '<div id="imageMainProps" class="contentBoxProperties contentBoxBackground boxPropExtra">'+                                          
                                
                
                '<!--play video checkbox-->'+
                '<input id="iPlayVidCB" type="checkbox" value="ON" '+playVidChecked+' />'+'<label class="customLabel">Play video on click</label>'+
                '<!--/play video checkbox-->'+                
                
                '<div class="hLine"></div>'+  
                
                '<!--close all ads-->'+
                '<input id="iCloseAdsCB" type="checkbox" value="ON" '+closeAllAds+' />'+'<label class="customLabel">Close all ads on click</label>'+
                '<!--/close all ads-->'+                            
                
            '</div>'+
            '<!--/ box-->'+                                                          
        '</div>';
        return tmpl;        
    }    
    
    
    
    //rectangle main prop box
    this.getRectangleMainPropBox = function(bkColor){
        var tmpl = ''+
        '<div class="propertiesBox propertiesSpace">'+
            '<p class="contentboxTitle">Rectangle properties</p>'+
            '<!--remove box-->'+
            '<div id="rectangleMainProps" class="contentBoxProperties contentBoxBackground boxPropExtra">'+                                          
                
                '<!--width spinnner-->'+
                '<input id="rWSpinner" class="spinnerBox" name="value" value=".5" />'+'<label class="customLabel">Width</label>'+
                '<!--/width spinnner-->'+
                
                '<div class="hLine"></div>'+
                
                '<!--height spinnner-->'+
                '<input id="rHSpinner" class="spinnerBox" name="value" value=".5" />'+'<label class="customLabel">Height</label>'+
                '<!--/height spinnner-->'+                                  
                
                '<div class="hLine"></div>'+                
                
                '<!--opacity spinnner-->'+
                '<input id="rOpacitySpinner" class="spinnerBox" name="value" value=".5" />'+'<label class="customLabel">Opacity</label>'+
                '<!--/opacity spinnner-->'+                                                 
                
                '<div class="hLine"></div>'+                
                
                '<!--background color picker-->'+
                '<input id="rBackCol" class="inputText" type="text" maxlength="6" size="6" value="'+bkColor+'" />'+'<label class="customLabel">Background color</label>'+
                '<!--/background color picker-->'+                                 
                
                
            '</div>'+
            '<!--/remove box-->'+                                                          
        '</div>';
        return tmpl;        
    }
    
    
    this.getButtonMainProp = function(label, btnSt, playVid, closeAds){
        var playVidChecked = '';
        var closeAllAds = '';        
        (playVid==true)?playVidChecked = 'checked':playVidChecked='';
        (closeAds==true)?closeAllAds = 'checked':closeAllAds='';
        var btnStyles = Defaults.getInstance().getButtonStyles();
        var stylesT = '';        
        for(var i=0;i<btnStyles.length;i++){
            var selected_style = '';
            if(btnSt==btnStyles[i].btn_class){
                selected_style = "selected";
            }
            stylesT += '<option '+selected_style+' value="'+btnStyles[i].btn_class+'">'+btnStyles[i].name+'</option>';
        }
        var tmpl = ''+
        '<div class="propertiesBox propertiesSpace">'+
            '<p class="contentboxTitle">Button properties</p>'+
            '<!-- box-->'+
            '<div id="buttonMainProps" class="contentBoxProperties contentBoxBackground boxPropExtra">'+                                          
                
                
                '<input id="bLabel" class="inputText" type="text" value="'+label+'" />'+'<label class="customLabel">Button label</label>'+
                
                '<div class="hLine"></div>'+
                
                '<!--button style-->'+
                '<p class="contentBoxSubtitle">Button style</p>'+
                '<select id="btnStyle" class="contentboxSelect">'+
                    stylesT+
                '</select>'+
                '<!--/button style-->'+                
                
                '<div class="hLine"></div>'+
                
                '<!--play video checkbox-->'+
                '<input id="rPlayVidCB" type="checkbox" value="ON" '+playVidChecked+' />'+'<label class="customLabel">Play video on click</label>'+
                '<!--/play video checkbox-->'+
                
                '<!--close all ads-->'+
                '<input id="bCloseAdsCB" type="checkbox" value="ON" '+closeAllAds+' />'+'<label class="customLabel">Close all ads on click</label>'+
                '<!--/close all ads-->'+                            
                
            '</div>'+
            '<!--/ box-->'+                                                          
        '</div>';
        return tmpl;        
    }
    
    
    //get code template
    this.getCodeMainProp = function(codeSrc){
        var tmpl = ''+
        '<div class="propertiesBox propertiesSpace">'+
            '<p class="contentboxTitle">Code object properties</p>'+
            '<!-- box-->'+
            '<div id="codeMainProps" class="contentBoxProperties contentBoxBackground boxPropExtra">'+                                          
              
              
                '<!--width spinnner-->'+
                '<input id="cWSpinner" class="spinnerBox" name="value" value=".5" />'+'<label class="customLabel">Width</label>'+
                '<!--/width spinnner-->'+
                
                '<div class="hLine"></div>'+
                
                '<!--height spinnner-->'+
                '<input id="cHSpinner" class="spinnerBox" name="value" value=".5" />'+'<label class="customLabel">Height</label>'+
                '<!--/height spinnner-->'+               
                
                '<div class="hLine"></div>'+
                
                '<p class="contentBoxSubtitle">Code (Ex: adsense code)</p>'+
                '<textarea id="codeSrc" class="boxTextarea" name="" rows="4">'+codeSrc+'</textarea>'+                                  
                
            '</div>'+
            '<!--/ box-->'+                                                          
        '</div>';
        return tmpl;        
    }
    
    
    //get code template
    this.getTextMainProp = function(fontData, txtCol, backCol){
        if(backCol=="none"){
            backCol = "";
        }
        var fontsT = '';
        var fonts = Fonts.getInstance().getAllFonts();
        for(var i=0;i<fonts.length;i++){
            var selected_font = '';
            (fontData.font==fonts[i].font)?selected_font='selected':selected_font='';
            fontsT += '<option '+selected_font+' value="'+fonts[i].font+'">'+fonts[i].fontDisplayName+'</option>';
        }
//ID        
        var tmpl = ''+
        '<div class="propertiesBox propertiesSpace">'+
            '<p class="contentboxTitle">Text properties</p>'+
            '<!-- box-->'+
            '<div id="textMainProps" class="contentBoxProperties contentBoxBackground boxPropExtra">'+                                          
                
                '<!--available fonts-->'+
                '<p class="contentBoxSubtitle">Choose font</p>'+
                '<select id="fontsSelect" class="contentboxSelect">'+
                    fontsT+
                '</select>'+
                '<!--/available fonts-->'+                  
                                      
                '<div class="hLine"></div>'+ 
                
                '<!--fonts style and text align-->'+
                '<div class="leftFloat">'+       
                    '<p class="contentBoxSubtitle">Font style</p>'+
                    '<div id="fontstyles"></div>'+             
                '</div>'+ 
                '<div class="leftFloat leftFloatSpace" style="padding-right: 10px;">'+       
                    '<p class="contentBoxSubtitle">Text align</p>'+
                    '<div id="textalign"></div>'+             
                '</div>'+ 
                '<div class="clear-fx"></div>'+
                '<!--/fonts style and text align-->'+ 
                
                '<div class="hLine"></div>'+
                
                '<!--width spinnner-->'+
                '<input id="fSizeSpinner" class="spinnerBox" name="value" value=".5" />'+'<label class="customLabel">Font size</label>'+
                '<!--/width spinnner-->'+ 
                
                '<div class="hLine"></div>'+                
                
                '<!--text color-->'+
                '<div>'+
                '<input id="tCol" class="inputText" type="text" maxlength="6" size="6" value="'+txtCol+'" />'+'<label class="customLabel">Text color</label>'+
                '</div>'+
                '<!--/text color-->'+
                
                '<div class="hLine"></div>'+ 
                
                '<!--back color-->'+
                '<div>'+
                '<input id="tBCol" class="inputText" type="text" maxlength="6" size="6" value="'+backCol+'" />'+'<label class="customLabel">Background color</label>'+
                '</div>'+
                '<!--/back color-->'+  
                
                                                                                                         
                
            '</div>'+
            '<!--/ box-->'+                                                          
        '</div>';
        return tmpl;        
    }
    
    this.getTextSecondProp = function(text){
        var tmpl = ''+
        '<div class="propertiesBox propertiesSpace">'+
            '<p class="contentboxTitle">Text content</p>'+
            '<!-- box-->'+
            '<div id="textSecondProps" class="contentBoxProperties contentBoxBackground boxPropExtra">'+                                          
                
                '<p class="contentBoxSubtitle">Edit text here</p>'+
                '<textarea id="txtSrc" class="boxTextarea" name="" rows="4">'+text+'</textarea>'+                

            '</div>'+
            '<!--/ box-->'+                                                          
        '</div>';
        return tmpl;         
    }    
    
    this.getClearFix = function(){
        return '<div class="clear-fx"></div>';
    }   
    
    
}
SkTemplates.getInstance=function(){
    if(SkTemplates.instance==null){
        SkTemplates.instance = new SkTemplates();
    }
    return SkTemplates.instance;
}




//PRESETS
function Presets(){
    
    //get incomming animations types
    this.getIncommingAnimationTypes = function(){             
        var obj = new Array();
        obj.push({val: "none", name: 'None'});
        obj.push({val: "popin", name: 'Pop in'});
        obj.push({val: "fadein", name: 'Fade in'});
        obj.push({val: "left", name: 'Slide from left'});
        obj.push({val: "right", name: 'Slide from right'});
        obj.push({val: "top", name: 'Slide from top'});
        obj.push({val: "bottom", name: 'Slide from bottom'});
        return obj;
    }
    //get outgoing animations types
    this.getOutgoingAnimationTypes = function(){             
        var obj = new Array();
        obj.push({val: "none", name: 'None'});
        obj.push({val: "popout", name: 'Pop out'});
        obj.push({val: "fadeout", name: 'Fade out'});
        obj.push({val: "left", name: 'Slide to left'});
        obj.push({val: "leftfade", name: 'Slide left & fade out'});
        obj.push({val: "right", name: 'Slide to right'});
        obj.push({val: "rightfade", name: 'Slide right & fade out'});
        obj.push({val: "top", name: 'Slide to top'});
        obj.push({val: "topfade", name: 'Slide top & fade out'});
        obj.push({val: "bottom", name: 'Slide to bottom'});
        obj.push({val: "bottomfade", name: 'Slide bottom & fade out'});
        return obj;
    }
    
    //get animations efxs
    this.getEffects = function(){
        var obj = new Array();
        obj.push({efx:'Linear.easeNone'});
        obj.push({efx:'Power1.easeIn'});
        obj.push({efx:'Power1.easeInOut'});
        obj.push({efx:'Power1.easeOut'});
        obj.push({efx:'Power2.easeIn'});
        obj.push({efx:'Power2.easeInOut'});
        obj.push({efx:'Power3.easeOut'});
        
        
        obj.push({efx:'Back.easeIn'});
        obj.push({efx:'Back.easeInOut'});
        obj.push({efx:'Back.easeOut'});
        
        obj.push({efx:'Bounce.easeIn'});
        obj.push({efx:'Bounce.easeInOut'});
        obj.push({efx:'Bounce.easeOut'});
        
        obj.push({efx:'Circ.easeIn'});
        obj.push({efx:'Circ.easeInOut'});
        obj.push({efx:'Circ.easeOut'});
        
        obj.push({efx:'Elastic.easeIn'});
        obj.push({efx:'Elastic.easeInOut'});
        obj.push({efx:'Elastic.easeOut'});
        
        obj.push({efx:'Expo.easeIn'});
        obj.push({efx:'Expo.easeInOut'});
        obj.push({efx:'Expo.easeOut'});
        
        obj.push({efx:'Sine.easeIn'});
        obj.push({efx:'Sine.easeInOut'});
        obj.push({efx:'Sine.easeOut'});                                         
        
        obj.push({efx:'SlowMo.ease'});
        return obj;
    }  
}
Presets.getInstance=function(){
    if(Presets.instance==null){
        Presets.instance = new Presets();
    }
    return Presets.instance;
}