/**

Notes:

- requires jquery
- animations fade and none work on IE & FF ... slidein only on FF

*/

/*	Animation for the slideup ...
	Can be 'slide', 'fade' or 'none'
*/
var rsm_slideup_animation = 'slide';
/**	Can be 'none' or '#close' */
var rsm_slideup_closelink = '#close';
/** 	slideup height in pixels */
var rsm_slideup_height = 100;
/**	slideup delay in milliseconds */
var rsm_slideup_delay = 3000;
/**	slideup url */
var rsm_slideup_url = '/lpages/slideup/';


jQuery.fn.slideup = function(options) {
	this.settings = {
		closeLink: 'none',
		animation: 'slide',
		height: '50' ,
        delay: 400
	}
	if(options)
		jQuery.extend(this.settings, options);
	
	if ( this.settings.animation != 'slide' && this.settings.animation != 'none' && this.settings.animation != 'fade' ) {
		alert('animation can only be set to \'slide\', \'none\' or \'fade\'');
	}
	
	var id = this.attr('id');
	settings = this.settings;

	jQuery(this).css('padding', '0').css('height', this.settings.height + 'px').css('margin', '0');
	jQuery('html').css('padding', '0 0 ' + ( this.settings.height * 1 + 50 ) + 'px 0');
	if ( typeof document.body.style.maxHeight != "undefined" ) {
		jQuery(this).css('position', 'fixed').css('bottom', '0').css('left', '0').css('right', '0');
	}
	
	if ( this.settings.animation == 'slide' ) {
		jQuery(this).slideDown(this.settings.delay);
	}
	else if ( this.settings.animation == 'fade' ) {
		jQuery(this).fadeIn(this.settings.delay);
	}
	else {
		jQuery(this).show();
	}
	if ( this.settings.closeLink != 'none' ) {
		jQuery(this.settings.closeLink).click(function(){
			jQuery.closeslideup(id);
			return false;
		});
	}
	
	// Return jQuery to complete the chain
	return this;
};
jQuery.closeslideup = function(id) {
	this.slideup = jQuery('#' + id);
	jQuery(this.slideup).hide();
	jQuery('html').css('padding', '0');
	jQuery('body').css('overflow', 'visible'); // Change IE6 hack back
};// Open Slide Up
 

document.write('<DIV ID="slideupfx"><div id="slideup"  style="overflow:visible; width:100%; height:100px;" class="" style="background-color:transparent;position:fixed;bottom:0;"></div></div>');

$(window).load(function(){
    $('#slideup').hide();
         $('#slideup').html('<iframe id="slideupframe" src="' + rsm_slideup_url + '" scrolling="no" allowtransparency="true" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%;display:yes;height:100px;"></iframe>');

    /*this.settings={
                    animation: 'slide',
                    closeLink: '#close',
                    height: 140 ,
                    delay: 3 * 1000
     };*/
     
    this.settings= {closeLink: rsm_slideup_closelink,animation: rsm_slideup_animation,height: rsm_slideup_height,delay: rsm_slideup_delay  };;
    $('#slideup').slideup(this.settings);

});
function slideup_hide(){
    $('#slideup').slideUp('slow');
}
