﻿

/* define class to store object information */

//when this is added to, update paste() section also
function globalProperties() {
    this.colorId = 1;
    this.colorValue = "000000";
    this.colorType = 'standard';
    this.text = "";
    this.height = "";
    this.width = "";
    this.font = "Arial";
    this.scale = 0;
    this.ratio = 0;
    this.bold = false;
    this.italic = false;
    this.shadow = false;
    this.shadowColorValue = "000000";
    this.shadowColorId = 1;
    this.shadowColorType = 'standard';
    this.outline = false;
    this.outlineColorValue = "000000";
    this.outlineColorId = 1;
    this.outlineColorType = 'standard';
    this.outlineTwo = false;
    this.outlineTwoColorValue = "000000";
    this.outlineTwoColorId = 1;
    this.outlineTwoColorType = 'standard';
    this.textAlign = "center";
    this.type = "textv2";
    this.filename = "";
    this.active = true;
    this.l = 0;
    this.t = 0;
    this.flipVertical = false;
    this.flipHorizontal = false;
    this.allowColorChange = false;
    this.location = "side"; //top, hood, side
    this.measuredHeight = 0;
    this.measuredWidth = 0;
    this.useCustomSize = false;
    this.price = 0;
    this.gradient = false;
    this.gradientTopColorValue = "000000";
    this.gradientTopColorId = 1;
    this.gradientBottomColorValue = "FFFFFF";
    this.gradientBottomColorId = 2;
}  

globalProperties.prototype.clone = function() {
  var newObj = (this instanceof Array) ? [] : {};
  for (i in this) {
    if (i == 'clone') continue;
    if (this[i] && typeof this[i] == "object") {
      newObj[i] = this[i].clone();
    } else newObj[i] = this[i]
  } return newObj;
};


var initDND = function(){    
    globalTypeList = new dojox.collections.ArrayList();
	globalPropertiesArray['image1'] = new globalProperties(); //initialize properties class
	dojo.byId('aspnetForm').onsubmit = function(){return false}; //fixes a bug(feature?) with safari and chrome that submits the form when you press enter on the inputs
}; 
dojo.addOnLoad(initDND); 

