function autoSizeIFrame(iframe) {
    if (iframe.contentDocument) {
        iframe.height = iframe.contentDocument.height;
    } else {
        iframe.style.height = iframe.contentWindow.document.body.scrollHeight;
    }
}

function Go3c (idElemnt, idBanner, bannSWf, bannGIF, linkBanner, widthBanner, heightBanner, async, container) {
	
    this.idElemnt = idElemnt;
	this.idBanner = idBanner;
	this.bannSWf = bannSWf;
	this.bannGIF = bannGIF;
	this.linkBanner = linkBanner;
	this.widthBanner = widthBanner;
	this.heightBanner = heightBanner;
	this.async = async;
	
	this.container = (container) ? container : '';
	
    document.write('<div id="'+ idElemnt+'" style="width:'+widthBanner+';height:'+heightBanner+';"></div>');
    this.div = document.getElementById(idElemnt);
    this.write = function () {
        if (this.h == "auto") {
            onload = "onload='autoSizeIFrame(this);'";
        }
        var params = '{c:\''+this.container+
					  '\', b:\''+this.idBanner+
					  '\', s:\''+this.bannSWf+
					  '\', g:\''+this.bannGIF+
					  '\', l:\''+this.linkBanner+
					  '\', w:\''+this.widthBanner+
					  '\', h:\''+this.heightBanner+'\'}';//quick JSON 
		
        this.div.innerHTML = '<ifr' + 'ame src="http://www.lorlux-bazar.com/www/go3c/go3c.php#'+escape(params)+'" frameborder="no" scrolling="no" marginheight="0" marginwidth="0" width="'+this.widthBanner+'" height="'+this.heightBanner+'" align="center" valign="middle" border="1" allowTransparency="true" '+onload+'><\/ifr'+'ame>';
		
		
    };
    if (async) {
        this.async = false;
        var self = this;
        addLoadEvent(function () {self.write();});
    } else {
        this.write();
    }
}
