function close()
{
   if( $('notModalLayer_ins') ){
            // IF exists, removed from the DOM
            $('notModalLayer_ins').dispose();
    }
    if(isie && version < 7 && $('uglyIE6Iframe')){
            $('uglyIE6Iframe').dispose();
    }
}
function createLayer_ins( width, height, layerTitleText, contentUrl ){

        if (navigator.appVersion.indexOf("MSIE") != -1){
                  isie = true;
              version = parseFloat(navigator.appVersion.split("MSIE")[1]);
        }
        else
        {
                isie = false;
        }

	if( $('notModalLayer_ins') ){
		// IF exists, removed from the DOM
		$('notModalLayer_ins').dispose();
	}
	if(isie && version < 7 && $('uglyIE6Iframe')){
		$('uglyIE6Iframe').dispose();
	}

	else
        {

                if(isie && version < 7)
                {
                        var topOffset = window.getScrollTop() + window.getHeight()/2;
                }
                else
                {
                        var topOffset = '50%';
                }

		// Common Styles For Layer And IFrame
		var commonStyles = {
			'width': width,
			'height': height,
			'margin-left': -width/2,
			'margin-top': -height/2,
			'top': topOffset,
			'left': '50%'
		};

		var commonStyles1 = {
			'width': width,
			'height': height,
			'margin-left': -width/2,
			'margin-top': -height/2,
			'top': topOffset,
			'left': '50%'
		};



		// Creating the layer itself

		if( isie && version < 7 )
                {
                        var layer = new Element('div',
                        {
				'id': 'notModalLayer_ins',
				'class': 'dpLayer',
				'styles': commonStyles
                        }).setStyle('z-index','999999').setStyle('position','absolute').inject(document.body);

			var iframe = new Element('iframe',
                        {
					'id': 'uglyIE6Iframe',
					'styles': commonStyles1
			}).setStyle('position','absolute').setStyle('z-index','999998').inject(document.body);

                        window.addEvent("scroll", function(event)
                        {
                            var d1=$(document.body).getScroll().y+topOffset
                            $('notModalLayer_ins').setStyle('top',d1)
                            $('uglyIE6Iframe').setStyle('top',d1)
                        });
		}
                else
                {
                    var layer = new Element('div',
                    {
				'id': 'notModalLayer_ins',
				'class': 'dpLayer',
				'styles': commonStyles
                    }).setStyle('z-index','999999').setStyle('position','fixed').inject(document.body);
                }

		var layerContent = new Element('div',
                {
				'id': 'layerAjaxContent',
				'class': 'layerContent'
		});
		layerContent.inject(layer);
                
		/*new Request.HTML({url: contentUrl, update: 'layerAjaxContent',evalScripts :true}).get();*/
                var myRequest = new Request({url: contentUrl, method: 'get', onSuccess: function(responseText, responseXML)
                {
                    $("layerAjaxContent").set("html",responseText);
                    var base_url = $("pro_base_url").value;
                    $("ins_blue").addEvent("click",function(e)
                    {
                        navigate('1');
                    });
                    $("ins_violet").addEvent("click",function(e)
                    {
                        navigate('2');
                    });
                    $("ins_rose").addEvent("click",function(e)
                    {
                        navigate('94');
                    });
                }
                });
                myRequest.send();
	}
}

function navigate(c)
{
        window.location = 'devenir-membre.php?MAIN_CAT='+c;
}

function createxmasLayer( width, height, contentUrl ){
if (navigator.appVersion.indexOf("MSIE") != -1){
	  isie = true;
      version = parseFloat(navigator.appVersion.split("MSIE")[1]);
}
else
{
	isie = false;
}

	if( $('notModalLayer_ins') ){
		// IF exists, removed from the DOM
		$('notModalLayer_ins').dispose();
	}
	if(isie && version < 7 && $('uglyIE6Iframe_ins')){
		$('uglyIE6Iframe_ins').dispose();
	}

	else {

			if(isie && version < 7)
			{
				var topOffset = '0%';
			}
			else
			{
				var topOffset = '0%';
			}

		// Common Styles For Layer And IFrame
		var commonStyles = {
			'width': width,
			'height': height,
                        'margin-left': -width/2,
			'margin-top': 40,
			'top': topOffset,
			'left': '50%'
		};

		var commonStyles1 = {
			'width': width,
			'height': height,
                        'margin-left': -width/2,
			'margin-top': 40,
			'top': topOffset,
			'left': '50%'
		};

                var commonStyles2 = {
			'width': width,
			'height': height+17,
                        'margin-left': -width/2,
			'margin-top': 0,
			'top': topOffset,
			'left': '50%'
		};


		// Creating the layer itself

		if( isie && version < 7 ){
                        var layer = new Element('div', {
				'id': 'notModalLayer_ins',
				'class': 'dpLayer_ins',
				'styles': commonStyles2
		}).setStyle('z-index','999999').setStyle('position','absolute').inject(document.body);

			var iframe = new Element('iframe',{
					'id': 'uglyIE6Iframe_ins',
					'styles': commonStyles2
			}).setStyle('position','absolute').setStyle('z-index','999998').inject(document.body);
                         window.addEvent("scroll", function(event)
                         {
                             var d1=$(document.body).getScroll().y+topOffset
                            $('notModalLayer_ins').setStyle('top',d1)
                            $('uglyIE6Iframe_ins').setStyle('top',d1)
                        });
		}
                else
                {
                   var layer = new Element('div', {
				'id': 'notModalLayer_ins',
				'class': 'dpLayer_ins',
				'styles': commonStyles
		}).setStyle('z-index','999999').setStyle('position','fixed').inject(document.body);
                }

		var layerContent = new Element('div', {
				'id': 'layerAjaxContent',
				'class': 'layerContent'
		});
		layerContent.inject(layer);
		new Request.HTML({url: contentUrl, update: 'layerAjaxContent',evalScripts :true}).get();
	}
}
