	var registrationBox = {
		mask	:	'<iframe class="mask" frameborder="0"></iframe>',
		markup 	:	'<div class="modalOverlay"></div>'+
					'<div class="modalBox">'+
						'<a class="modalBoxCloseBtn" href="javascript:;"></a>'+
						'<div class="modalBoxInnerTopWrapper">'+
							'<div class="modaBoxHeader"><h1></h1></div>'+
							'<div class="modalBoxInner alternative">'+
								'<div class="ajaxStarted"></div>'+
								'<iframe frameborder="0" scrolling="auto"></iframe>'+
							'</div>'+
						'</div>'+
					'</div>',
		overlay		:	null,
		wrapper		:	null,
		closeBtn	: 	null,
		iframe		:	null,
		title		: 	null,
		iHeight		:	200,
		iWidth		:	200,
		isCloseBtnShow	: 	false,
		close	: function(redirect,redirectUrl) {
					jQuery(registrationBox.wrapper).fadeOut(300,function(){
						jQuery(registrationBox.overlay).fadeOut(300,function(){
							jQuery(this).remove();													   
						})
						jQuery(this).remove();
						jQuery("html,body").css({"overflow":"", "height": "auto"});
						
						if(redirect) {
							if(redirectUrl) {
								window.location.href = redirectUrl;
							}
							else {
								window.location.replace(window.location.href);	
							}
						}
						
					})
		},
		open	: function(url,width,height,title,redirect,redirectUrl,closeBtnFlag) {
			this.initial(closeBtnFlag,redirect,redirectUrl);
			this.resize(url,width,height,title,redirect,redirectUrl);			
		},
		initial	: function(closeBtnFlag,redirect,redirectUrl) {
			jQuery("html").css({"height":"100%", "overflow" :"hidden"});
			jQuery("body").css({"overflow":"hidden", "height": "100%"});

			if(jQuery.browser.msie && jQuery.browser.version=="6.0") {			
				jQuery(this.mask).appendTo("body");
			}
			
			jQuery(this.markup).appendTo("body");
			
			this.closeBtn = jQuery('a.modalBoxCloseBtn');
			this.overlay = jQuery('div.modalOverlay');
			this.wrapper = jQuery('div.modalBox');
			this.title	= jQuery('div.modaBoxHeader h1');
			this.iframe = jQuery('div.modalBox iframe');
			
            if(!closeBtnFlag) {
                this.closeBtn.remove();
            }
            
			this.closeBtn.bind('click',function(e){
				e.preventDefault();
				registrationBox.close(redirect,redirectUrl);									
			})		
		},
		resize	: function(url,width,height,title,redirect,redirectUrl) {
			jQuery(registrationBox.iframe).css({visibility:'hidden'});
			jQuery(registrationBox.wrapper).animate({height : height,marginTop :-(height/2 +30)},700, function() {
					jQuery(registrationBox.wrapper).animate({width : width,marginLeft :-(width/2 +30)},700, function() {
						jQuery("div.ajaxStarted").fadeIn("fast");
						jQuery(registrationBox.closeBtn).animate({"top" : 10},300);
						if(registrationBox.isCloseBtnShow != true) {
							registrationBox.isCloseBtnShow = true;
						}
						jQuery(registrationBox.iframe).css({height:(height-32),visibility:'visible'});
						if(url) {
							jQuery(registrationBox.iframe).attr('src',url);
						}
						jQuery(registrationBox.title).html(title);
						/*
						if(redirect) {
							if(typeof(redirectUrl) != "undefined") {
								setTimeout(function() {window.location.href = redirectUrl}, 10000);	
							}
							else {
								setTimeout(function() {window.location.href = window.location.pathname}, 10000);	
							}
						}
						*/
					})
			})
		}
	}
