RedWolves
9/23/2010 - 3:57 PM

globalLabels.js

// used for links to objects like video. This will overlay the video on the screen. Requires jqModal.js.
$.fn.objectOverlay = function(options) {
	var o = $.extend({}, $.fn.objectOverlay.defaults, options);
	o = $.extend({}, $.fn.objectOverlay.labels, o);
	
	return this.each(function(){
		var $this = $(this);
	    $this.bind("click", function(e) {
			e.preventDefault();
		    var vid = $this.attr("href"); 
			o.objHTML = o.objHTML.replace("{closeLabel}", o.closeLabel)
								 .replace("{width}", o.width)
								 .replace("{height}", o.height)
								 .replace("{fallbackLabel}", o.fallbackLabel.replace("{vid}", vid))
								 .replace("{vid}", vid);
			$(o.objHTML).appendTo("body").jqm({onHide: function(hash) {
				hash.w.remove();
				hash.o.remove();
				if ($.browser.msie)
					document.location = document.location;
			}}).jqmShow();
		});
	});
};

$.fn.objectOverlay.defaults = {
	width: '640',
	height: '480',
	objHTML:  '<div class=\"jqmWindow\">' + 
			  '<a id=\"object-close\" class=\"jqmClose\" href=\"javascript:void(0);\">{closeLabel}</a>' +
			  '<object id=\"vid\" width=\"{width}\" height=\"{height}\" data=\"{vid}\">' +
			  '<param name=\"src\" value=\"{vid}\"/>' +
			  '<p>{fallbackLabel}</p>' +
			  '</object></div>',
    closeLabel: 'Close X',
    fallbackLabel: 'Video for {vid}'
};

$.fn.objectOverlay.labels = function() {
		try {
			return labels.objectOverlay;
		} catch (e) {
			return {};
		}	
};
//dynamically generated by ASP.NET for the language passed in.
var labels = {
    language: 'English',
    objectOverlay: {
        closeX: 'Close X',
        fallback: 'Video for {vid}'
    },
    global: {
        label1: 'label1',
        label2: 'label2'
    }
};