
function ImageObject(){
	this.laser_hide        = laser_hide;
	this.laser_show_image  = laser_show_image;
	this.laser_find_center = laser_find_center;
}

function laser_show_image(){
	
	var dn  = "#" + this.name;

	$(dn).remove();
	
	$("body").append("<div id='"+this.name+"'/>");

	$(dn).css("position","absolute");
	$(dn).css("top",this.top);
	$(dn).css("left",this.left + this.laser_find_center());
	$(dn).css("width",this.width);
	$(dn).css("height",this.height);
	$(dn).css("z-index",9999);

	$(dn).append( "<img src='" + this.url + "' />" );
}

function VideoObject(){
	this.laser_hide        = laser_hide;
	this.laser_show_video  = laser_show_video;
	this.laser_find_center = laser_find_center;
}

function laser_show_video() {
	
	var dn  = "#" + this.name;

	$(dn).remove();
	
	$("body").append("<div id='"+this.name+"'/>");

	$(dn).css("position","absolute");
	$(dn).css("top",this.top);
	$(dn).css("left",this.left + this.laser_find_center());
	$(dn).css("width",this.width);
	$(dn).css("height",this.height);
	$(dn).css("z-index",9999);

	$(dn).append( 
		"<object width='" + this.width + "' height='" + this.height + "'>" +
		"<param name='movie' value='" + this.url + "'>" +
		"<param name='wmode' value='transparent'>"+
		"<param name='allowScriptAccess' value='sameDomain'>"+
		"<embed src='" + this.url + 
		"' width='"    + this.width + 
		"' height='"   + this.height + 
		"' wmode='transparent'>" +
		"</embed>"+
		"</object>"
	);
}

function laser_hide(){
	
	$("#"+this.name).remove();
}

function laser_find_center(){
	
	if (this.center){ return $(window).width() / 2 ; } 
	
	else { return 0; }
}

jQuery.laser_cookie = function(name, value, options) {
    if (typeof value != 'undefined') {
        options = options || {};
        if (value === null) {
            value = '';
            options = $.extend({}, options);
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString();
        }
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { 
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};

