/**
 * @author jsaavedra
 */

var sifrUSVI = {
	futura: {
		src: 'swf/futura.swf'
	},
	futuraBold: {
		src: 'swf/futuraBold.swf'
	},
	futuraBoldOblique: {
		src: 'swf/futuraBoldOblique.swf'
	},
	futuraBook: {
		src: 'swf/futuraBook.swf'
	},
	futuraLight: {
		src: 'swf/futuraLight.swf'
	},
	myriadPro: {
		src: 'swf/myriadPro.swf'
	},
	myriadProLight: {
		src: 'swf/myriadProLight.swf'
	},
	trajanPro: {
		src: 'swf/trajanPro.swf'
	},
	activate: function(font) {
		var text = font.split(",");
		var fonts = "";

		for (var i = 0; i < 2; i++) {
			fonts += "this." + text[i];

			if (i < 1)
				fonts += ",";
		}

		sIFR.activate(fonts);
	},
	path: function(basepath) {

		this.futura.src = basepath + "/" + this.futura.src;
		this.futuraBold.src = basepath + "/" + this.futuraBold.src;
		this.futuraBoldOblique.src = basepath + "/" + this.futuraBoldOblique.src;
		this.futuraBook.src = basepath + "/" + this.futuraBook.src;
		this.futuraLight.src = basepath + "/" + this.futuraLight.src;
		this.myriadPro.src = basepath + "/" + this.myriadPro.src;
		this.myriadProLight.src = basepath + "/" + this.myriadProLight.src;
		this.trajanPro.src = basepath + "/" + this.trajanPro.src;
	}
}

/*******************************************************************/
function replaceFuturaLight(selector, color, font_size, lett_spacing, font_weight) { sIFR.replace(sifrUSVI.futuraLight, {
	selector: selector,
	css: {
		'.sIFR-root': {
			'color': color,
			'font-size': font_size,
			'letter-spacing': lett_spacing,
			'font-weight': font_weight
		},
		'a': {
			'text-decoration': 'none',
			'color': color
		},
		'a:link': {
			'color': color
		},
		'a:hover': {
			'color': color
		}
	},
	selectable: false,
	wmode: 'transparent',
	forceSingleLine: 'true'
}); }

function replaceFuturaLightShadow(selector, color, font_size, lett_spacing, font_weight, shadowColor, forceSingleLine) { sIFR.replace(sifrUSVI.futuraLight, {
	selector: selector,
	css: {
		'.sIFR-root': {
			'color': color,
			'font-size': font_size,
			'letter-spacing': lett_spacing,
			'font-weight': font_weight,
			'leading': -3
		},
		'a': {
			'text-decoration': 'none',
			'color': color
		},
		'a:link': {
			'color': color
		},
		'a:hover': {
			'color': color
		}
	},
	filters: {
        DropShadow: {
          distance: 3,
          color: (shadowColor == null) ? '#4296ae' : shadowColor,
          strength: 1,
          alpha: .8,
          blurX: 1,
          blurY: 1
        }
	},
	selectable: false,
	wmode: 'transparent',
	forceSingleLine: (forceSingleLine == null) ? true : forceSingleLine
}); }

function replaceFuturaLightCenter(selector, color, font_size, lett_spacing) { sIFR.replace(sifrUSVI.futuraLight, {
		selector: selector,
		css: {
			'.sIFR-root': {
				'color': color,
				'font-size': font_size,
				'letter-spacing': lett_spacing,
				'text-align': 'center'
			},
			'a': {
				'color': '#ffffff',
				'text-decoration': 'none'
			},
			'a:hover': {
				'color': '#000000',
				'text-decoration': 'none'
			},
			'a:link': {
				'color': '#000000',
				'text-decoration': 'none'
			},
			'a:active': {
				'color': '#000000',
				'text-decoration': 'none'
			}
		},
		selectable: true,
		wmode: 'transparent'
	}); }

function replaceFuturaBook(selector, color, font_size, lett_spacing) { sIFR.replace(sifrUSVI.futuraBook, {
		selector: selector,
		css: {
			'.sIFR-root': {
				'color': color,
				'font-size': font_size,
				'letter-spacing': lett_spacing,
				'width': '200px'
			}
		},
		selectable: true,
		wmode: 'transparent'
	}); }
	
function replaceFuturaBookShadow(selector, color, font_size, lett_spacing, force_single) { sIFR.replace(sifrUSVI.futuraBook, {
		selector: selector,
		css: {
			'.sIFR-root': {
				'color': color,
				'font-size': font_size,
				'letter-spacing': lett_spacing,
				'width': '200px'
			}
		},
		filters: {
	        DropShadow: {
	           distance: 2
	          ,color: '#999999'
	          ,strength: 1
	          ,alpha: .7
	          ,blurX: 1
	          ,blurY: 1
	        }
		},
		selectable: true,
		wmode: 'transparent',
		forceSingleLine: (!force_single)? force_single : true,
		tuneWidth:2
	}); }

function replaceFutura(selector, color, font_size, lett_spacing) { sIFR.replace(sifrUSVI.futura, {
		selector: selector,
		css: {
			'.sIFR-root': {
				'color': color,
				'font-size': font_size,
				'letter-spacing': lett_spacing
			}
		},
		selectable: false,
		wmode: 'transparent'
	}); }

function replaceFuturaBold(selector, color, font_size, lett_spacing) { sIFR.replace(sifrUSVI.futuraBold, {
		selector: selector,
		css: {
			'.sIFR-root': {
				'color': color,
				'font-size': font_size,
				'letter-spacing': lett_spacing
			}
		},
		selectable: false,
		wmode: 'transparent'
	}); }

function replaceFuturaBoldOblique(selector, color, font_size, lett_spacing) { sIFR.replace(sifrUSVI.futuraBoldOblique, {
		selector: selector,
		css: {
			'.sIFR-root': {
				'color': color,
				'font-size': font_size,
				'letter-spacing': lett_spacing
			}
		},
		selectable: false,
		wmode: 'transparent'
	}); }

function replaceMyriadPro(selector, color, font_size, lett_spacing) { sIFR.replace(sifrUSVI.myriadPro, {
		selector: selector,
		css: {
			'.sIFR-root': {
				'color': color,
				'font-size': font_size,
				'letter-spacing': lett_spacing
			}
		},
		selectable: false,
		wmode: 'transparent'
	}); }

function replaceMyriadProLight(selector, color, font_size, lett_spacing) { sIFR.replace(sifrUSVI.myriadProLight, {
		selector: selector,
		css: {
			'.sIFR-root': {
				'color': color,
				'font-size': font_size,
				'letter-spacing': lett_spacing
			}
		},
		selectable: false,
		wmode: 'transparent'
	}); }
	
function replaceTrajanProShadow(selector, color, font_size, lett_spacing, font_weight, shadowColor, forceSingleLine) { sIFR.replace(sifrUSVI.trajanPro, {
	selector: selector,
	css: {
		'.sIFR-root': {
			'color': color,
			'font-size': font_size,
			'letter-spacing': lett_spacing,
			'font-weight': font_weight
		},
		'a': {
			'text-decoration': 'none',
			'color': color
		},
		'a:link': {
			'color': color
		},
		'a:hover': {
			'color': color
		}
	},
	filters: {
        DropShadow: {
          distance: 3,
          color: (shadowColor == null) ? '#000000' : shadowColor,
          strength: 2,
		  alpha: .3,
          blurX: 2,
          blurY: 2
        }
	},
	selectable: false,
	wmode: 'transparent',
	forceSingleLine: (forceSingleLine == null) ? false : forceSingleLine
}); }
/********************************************************************/

