/////////////////////////////////
// File Name: mBanner.js      //
// By: Manish Kumar Namdeo    //
/////////////////////////////////

function fw24h_getFlash( object) {
	var str = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" border="0" height="'+object.height+'" width="'+object.width+'"><param name="movie" value="'+object.bannerPath+'"><param name="AllowScriptAccess" value="always"><param name="quality" value="High"><param name="wmode" value="transparent"><embed src="'+object.bannerPath+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" height="'+object.height+'" width="'+object.width+'"></object>';
	return str;
}

// BANNER OBJECT
function Banner(objName){
        this.obj = objName;
        this.aNodes = [];
        this.currentBanner = 0;
       
};

// ADD NEW BANNER
Banner.prototype.add = function(bannerType, bannerPath, bannerDuration, height, width, hyperlink) {
        this.aNodes[this.aNodes.length] = new Node(this.obj +"_"+ this.aNodes.length, bannerType, bannerPath, bannerDuration, height, width, hyperlink);
};

// Node object
function Node(name, bannerType, bannerPath, bannerDuration, height, width, hyperlink) {
        this.name = name;
        this.bannerType = bannerType;
        this.bannerPath = bannerPath;
        this.bannerDuration = bannerDuration;
        this.height = height
        this.width = width;
        this.hyperlink= hyperlink;
//        alert (name +"|" + bannerType +"|" + bannerPath +"|" + bannerDuration +"|" + height +"|" + width + "|" + hyperlink);
};

function Node2(name, bannerType, bannerPath, bannerDuration, height, width, hyperlink, position) {
        this.name = name;
        this.bannerType = bannerType;
        this.bannerPath = bannerPath;
        this.bannerDuration = bannerDuration;
        this.height = height
        this.width = width;
        this.hyperlink= hyperlink;
        this.position= position;
};

// Outputs the banner to the page
Banner.prototype.toString = function() {
        this.currentBanner = Math.floor(Math.random()*this.aNodes.length); // lay ngau nhien 1 banner
		var str = ""
        for (var iCtr=0; iCtr < this.aNodes.length; iCtr++){
                str = str + '<span name="'+this.aNodes[iCtr].name+'" '
                str = str + 'id="'+this.aNodes[iCtr].name+'" ';
                str = str + 'class="m_banner_hide" ';
                //str = str + 'bgcolor="#FFFCDA" ';        // CHANGE BANNER COLOR HERE
                //str = str + 'align="center" ';
                //str = str + 'valign="top" >\n';
				str = str + 'style="padding:0px;margin:0px;width:100%;" >\n';
                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '<a  href="'+this.aNodes[iCtr].hyperlink+'" target="_blank">';
                }
                       
                if ( this.aNodes[iCtr].bannerType == "FLASH" ){
                        str = str + '<OBJECT '
                        str = str + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
                        str = str + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'id="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="" '
                        str = str + 'VIEWASTEXT>'
                        str = str + '<PARAM NAME=movie VALUE="'+ this.aNodes[iCtr].bannerPath + '">'
                        str = str + '<PARAM NAME=quality VALUE=high>'
                        str = str + '<PARAM NAME=bgcolor VALUE=#FFFCDA>'
                        str = str + '<PARAM NAME=wmode VALUE="transparent">'
                        str = str + '<EMBED ';
                        str = str + 'src="'+this.aNodes[iCtr].bannerPath+'" '
                        str = str + 'quality=high '
//                        str = str + 'bgcolor=#FFFCDA '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'NAME="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="center"  wmode="transparent"  '
                        str = str + 'TYPE="application/x-shockwave-flash" '
                        str = str + 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'
                        str = str + '</EMBED>'
                        str = str + '</OBJECT>'
                }else if ( this.aNodes[iCtr].bannerType == "IMAGE" ){
                        str = str + '<img src="'+this.aNodes[iCtr].bannerPath+'" ';
                        str = str + 'border="0" ';
                        str = str + 'height="'+this.aNodes[iCtr].height+'" ';
                        str = str + 'width="'+this.aNodes[iCtr].width+'">';
                }

                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '</a>';
                }

                str += '</span>';
        }
        return str;
};

// START THE BANNER ROTATION
Banner.prototype.start = function(){
        this.changeBanner();
        var thisBannerObj = this.obj;
        // CURRENT BANNER IS ALREADY INCREMENTED IN cahngeBanner() FUNCTION
        setTimeout(thisBannerObj+".start()", this.aNodes[this.currentBanner].bannerDuration * 1000);
}

// CHANGE BANNER
Banner.prototype.changeBanner = function(){
        var thisBanner;
        var prevBanner = -1;
        if (this.currentBanner < this.aNodes.length ){
                thisBanner = this.currentBanner;
                if (this.aNodes.length > 1){
                        if ( thisBanner > 0 ){
                                prevBanner = thisBanner - 1;
                        }else{
                                prevBanner = this.aNodes.length-1;
                        }
                }
                if (this.currentBanner < this.aNodes.length - 1){
                        this.currentBanner = this.currentBanner + 1;
                }else{
                        this.currentBanner = 0;
                }
        }
       

        if (prevBanner >= 0){
                document.getElementById(this.aNodes[prevBanner].name).className = "m_banner_hide";
        }

		//alert(this.aNodes[thisBanner].name + " ------- " + document.getElementById(this.aNodes[thisBanner].name).className );
        document.getElementById(this.aNodes[thisBanner].name).className = "m_banner_show";
}


// d_Banner
// Written by Dungpt
function d_Banner(objName){
        this.obj = objName;
        this.aNodes = [];
        this.currentBanner = 0;
       
};
// ADD NEW BANNER
d_Banner.prototype.add = function(bannerType, bannerPath, height, width, hyperlink) {
		var bannerDuration = 0;
        this.aNodes[this.aNodes.length] = new Node(this.obj +"_"+ this.aNodes.length, bannerType, bannerPath, bannerDuration, height, width, hyperlink);
};
// Outputs the banner to the page
d_Banner.prototype.toString = function() {
        var str = "";
		var BannerPostion = Math.floor(Math.random()*12321) % this.aNodes.length;
        for (var iCtr=BannerPostion; iCtr < this.aNodes.length; iCtr++){
                str = str + '<span name="'+this.aNodes[iCtr].name+'" '
                str = str + 'id="'+this.aNodes[iCtr].name+'" ';
                str = str + 'class="d_banner_show" ';
                //str = str + 'bgcolor="#FFFCDA" ';        // CHANGE BANNER COLOR HERE
                //str = str + 'align="center" ';
                //str = str + 'valign="top" >\n';
				str = str + 'style="padding:0px;padding-bottom:5px;margin:0px;width:100%;" >\n';
                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '<a  href="'+this.aNodes[iCtr].hyperlink+'" target="_blank">';
                }
                       
                if ( this.aNodes[iCtr].bannerType == "FLASH" ){
                        str = str + '<OBJECT '
                        str = str + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
                        str = str + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'id="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="" '
                        str = str + 'VIEWASTEXT>'
                        str = str + '<PARAM NAME=movie VALUE="'+ this.aNodes[iCtr].bannerPath + '">'
                        str = str + '<PARAM NAME=quality VALUE=high>'
                        str = str + '<PARAM NAME=bgcolor VALUE=#FFFCDA>'
						str = str + '<PARAM NAME=wmode VALUE="transparent">'
                        str = str + '<EMBED ';
                        str = str + 'src="'+this.aNodes[iCtr].bannerPath+'" '
                        str = str + 'quality=high '
//                        str = str + 'bgcolor=#FFFCDA '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'NAME="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="center" wmode="transparent" '
                        str = str + 'TYPE="application/x-shockwave-flash" '
                        str = str + 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'
                        str = str + '</EMBED>'
                        str = str + '</OBJECT>'
                }else if ( this.aNodes[iCtr].bannerType == "IMAGE" ){
                        str = str + '<img  src="'+this.aNodes[iCtr].bannerPath+'" ';
                        str = str + 'border="0" ';
                        str = str + 'height="'+this.aNodes[iCtr].height+'" ';
                        str = str + 'width="'+this.aNodes[iCtr].width+'">';
                }
				if( this.aNodes[iCtr].bannerType == "TEXT") {
					str = str + '<iframe width="'+this.aNodes[iCtr].width+'" height="'+this.aNodes[iCtr].height+'" src="'+this.aNodes[iCtr].bannerPath+'" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></iframe>'
				}

                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '</a>';
                }

                str += '</span>';
        }
		for (var iCtr=0; iCtr < BannerPostion; iCtr++){
                str = str + '<span name="'+this.aNodes[iCtr].name+'" '
                str = str + 'id="'+this.aNodes[iCtr].name+'" ';
                //str = str + 'class="m_banner_hide" ';
                //str = str + 'bgcolor="#FFFCDA" ';        // CHANGE BANNER COLOR HERE
                //str = str + 'align="center" ';
                //str = str + 'valign="top" >\n';
				str = str + 'style="padding:0px;padding-bottom:5px;margin:0px;width:100%;" >\n';
                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '<a  href="'+this.aNodes[iCtr].hyperlink+'" target="_blank">';
                }
                       
                if ( this.aNodes[iCtr].bannerType == "FLASH" ){
                        str = str + '<OBJECT '
                        str = str + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
                        str = str + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'id="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="" '
                        str = str + 'VIEWASTEXT>'
                        str = str + '<PARAM NAME=movie VALUE="'+ this.aNodes[iCtr].bannerPath + '">'
                        str = str + '<PARAM NAME=quality VALUE=high>'
                        str = str + '<PARAM NAME=bgcolor VALUE=#FFFCDA>'
						str = str + '<PARAM NAME=wmode VALUE="transparent">'
                        str = str + '<EMBED ';
                        str = str + 'src="'+this.aNodes[iCtr].bannerPath+'" '
                        str = str + 'quality=high '
//                        str = str + 'bgcolor=#FFFCDA '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'NAME="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="center" wmode="transparent" '
                        str = str + 'TYPE="application/x-shockwave-flash" '
                        str = str + 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'
                        str = str + '</EMBED>'
                        str = str + '</OBJECT>'
                }else if ( this.aNodes[iCtr].bannerType == "IMAGE" ){
                        str = str + '<img  src="'+this.aNodes[iCtr].bannerPath+'" ';
                        str = str + 'border="0" ';
                        str = str + 'height="'+this.aNodes[iCtr].height+'" ';
                        str = str + 'width="'+this.aNodes[iCtr].width+'">';
                }
				if( this.aNodes[iCtr].bannerType == "TEXT") {
					str = str + '<iframe width="'+this.aNodes[iCtr].width+'" height="'+this.aNodes[iCtr].height+'" src="'+this.aNodes[iCtr].bannerPath+'" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></iframe>'
				}

                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '</a>';
                }

                str += '</span>';
        }
        return str;
};

// d_Banner2
// Written by ThaoDX
function d_Banner2(objName){
        this.obj = objName;
        this.aNodes = [];
        this.bNodes = [];
        this.currentBanner = 0;
       
};
// ADD NEW BANNER
d_Banner2.prototype.add = function(bannerType, bannerPath, height, width, hyperlink) {
		var bannerDuration = 0;
        this.aNodes[this.aNodes.length] = new Node(this.obj +"_"+ this.aNodes.length, bannerType, bannerPath, bannerDuration, height, width, hyperlink);
};
// add2
d_Banner2.prototype.add2 = function(bannerType, bannerPath, height, width, hyperlink, position) {
		var bannerDuration = 0;
        this.bNodes[this.bNodes.length] = new Node2(this.obj +"_"+ this.bNodes.length, bannerType, bannerPath, bannerDuration, height, width, hyperlink, position);
};
// Outputs the banner to the page
d_Banner2.prototype.toString = function() {
        var str = "";
		var BannerPostion = Math.floor(Math.random()*12321) % this.aNodes.length;
		var i = 1;
		for (var iCtr=BannerPostion; iCtr < this.aNodes.length; iCtr++){
                // iB for loop
				//str += "I: " + i + "<HR>";
				for(var iB=0; iB < this.bNodes.length; iB++){
					if(i == this.bNodes[iB].position){
						str = str + '<span name="'+this.bNodes[iB].name+'" '
						str = str + 'id="'+this.bNodes[iB].name+'" ';
						str = str + 'class="d_banner2_show" ';
						// str = str + 'bgcolor="#FFFCDA" ';        // CHANGE BANNER COLOR HERE
						// str = str + 'align="center" ';
						// str = str + 'valign="top" >\n';
						str = str + 'style="padding:0px;padding-bottom:5px;margin:0px;width:100%;" >\n';
						if (this.bNodes[iB].hyperlink != ""){
								str = str + '<a href="'+this.bNodes[iB].hyperlink+'" target="_blank">';
						}
							   
						if ( this.bNodes[iB].bannerType == "FLASH" ){
							str  += fw24h_getFlash( this.bNodes[iB]);
						}else if ( this.bNodes[iB].bannerType == "IMAGE" ){
								str = str + '<img src="'+this.bNodes[iB].bannerPath+'" ';
								str = str + 'border="0" ';
								str = str + 'height="'+this.bNodes[iB].height+'" ';
								str = str + 'width="'+this.bNodes[iB].width+'">';
						}
						if( this.bNodes[iB].bannerType == "TEXT") {
							str = str + '<iframe width="'+this.bNodes[iB].width+'" height="'+this.bNodes[iB].height+'" src="'+this.bNodes[iB].bannerPath+'" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></iframe>'
						}
		
						if (this.bNodes[iB].hyperlink != ""){
								str = str + '</a>';
						}
		
						str += '</span>';
						// str = str + 'Thao Pro '+i;
						i++; continue;
					}
				}
				// End iB for loop
				str = str + '<span name="'+this.aNodes[iCtr].name+'" '
                str = str + 'id="'+this.aNodes[iCtr].name+'" ';
                str = str + 'class="d_banner2_show" ';
                // str = str + 'bgcolor="#FFFCDA" ';        // CHANGE BANNER COLOR HERE
                // str = str + 'align="center" ';
                // str = str + 'valign="top" >\n';
				str = str + 'style="padding:0px;padding-bottom:5px;margin:0px;width:100%;" >\n';
                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '<a href="'+this.aNodes[iCtr].hyperlink+'" target="_blank">';
                }
                       
                if ( this.aNodes[iCtr].bannerType == "FLASH" ){
                        str  += fw24h_getFlash( this.aNodes[iCtr]);
                }else if ( this.aNodes[iCtr].bannerType == "IMAGE" ){
                        str = str + '<img src="'+this.aNodes[iCtr].bannerPath+'" ';
                        str = str + 'border="0" ';
                        str = str + 'height="'+this.aNodes[iCtr].height+'" ';
                        str = str + 'width="'+this.aNodes[iCtr].width+'">';
                }
				if( this.aNodes[iCtr].bannerType == "TEXT") {
					str = str + '<iframe width="'+this.aNodes[iCtr].width+'" height="'+this.aNodes[iCtr].height+'" src="'+this.aNodes[iCtr].bannerPath+'" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></iframe>'
				}

                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '</a>';
                }

                str += '</span>';
				i++;
        }
		//BannerPostion = 0;
		//return str;
		//str += "<HR>a " + BannerPostion + "  a <HR>";;
		for (var iCtr=0; iCtr < BannerPostion; iCtr++){
                // iB for loop
				for(var iB=0; iB < this.bNodes.length; iB++){
					if(i == this.bNodes[iB].position){
						str = str + '<span name="'+this.bNodes[iB].name+'" '
						str = str + 'id="'+this.bNodes[iB].name+'" ';
						str = str + 'class="d_banner2_show" ';
						// str = str + 'bgcolor="#FFFCDA" ';        // CHANGE BANNER COLOR HERE
						// str = str + 'align="center" ';
						// str = str + 'valign="top" >\n';
						str = str + 'style="padding:0px;padding-bottom:5px;margin:0px;width:100%;" >\n';
						if (this.bNodes[iB].hyperlink != ""){
								str = str + '<a href="'+this.bNodes[iB].hyperlink+'" target="_blank">';
						}
							   
						if ( this.bNodes[iB].bannerType == "FLASH" ){
								str  += fw24h_getFlash( this.bNodes[iB]);
						}else if ( this.bNodes[iB].bannerType == "IMAGE" ){
								str = str + '<img src="'+this.bNodes[iB].bannerPath+'" ';
								str = str + 'border="0" ';
								str = str + 'height="'+this.bNodes[iB].height+'" ';
								str = str + 'width="'+this.bNodes[iB].width+'">';
						}
						if( this.bNodes[iB].bannerType == "TEXT") {
							str = str + '<iframe width="'+this.bNodes[iB].width+'" height="'+this.bNodes[iB].height+'" src="'+this.bNodes[iB].bannerPath+'" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></iframe>'
						}
		
						if (this.bNodes[iB].hyperlink != ""){
								str = str + '</a>';
						}
		
						str += '</span>';
						i++; continue;
					}
					else{
						//str = str + 'i: e '+i;	
					}
				}
				// End iB for loop
                str = str + '<span name="'+this.aNodes[iCtr].name+'" '
                str = str + 'id="'+this.aNodes[iCtr].name+'" ';
                //str = str + 'class="m_banner_hide" ';
                str = str + 'bgcolor="#FFFCDA" ';        // CHANGE BANNER COLOR HERE
                str = str + 'class="d_banner2_show" ';
                // str = str + 'align="center" ';
                // str = str + 'valign="top" >\n';
				str = str + 'style="padding:0px;padding-bottom:5px;margin:0px;width:100%;" >\n';
                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '<a href="'+this.aNodes[iCtr].hyperlink+'" target="_blank">';
                }
                       
                if ( this.aNodes[iCtr].bannerType == "FLASH" ){
                        str  += fw24h_getFlash( this.aNodes[iCtr]);
                }else if ( this.aNodes[iCtr].bannerType == "IMAGE" ){
                        str = str + '<img src="'+this.aNodes[iCtr].bannerPath+'" ';
                        str = str + 'border="0" ';
                        str = str + 'height="'+this.aNodes[iCtr].height+'" ';
                        str = str + 'width="'+this.aNodes[iCtr].width+'">';
                }
				if( this.aNodes[iCtr].bannerType == "TEXT") {
					str = str + '<iframe width="'+this.aNodes[iCtr].width+'" height="'+this.aNodes[iCtr].height+'" src="'+this.aNodes[iCtr].bannerPath+'" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></iframe>'
				}

                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '</a>';
                }
                str += '</span>';
				i++;
        }
		for(x = 0; x < this.bNodes.length; x++) {
			
			if(this.bNodes[x].position >= i) {
				str = str + '<span name="'+this.bNodes[x].name+'" '
				str = str + 'id="'+this.bNodes[x].name+'" ';
				str = str + 'class="d_banner2_show" ';
				// str = str + 'bgcolor="#FFFCDA" ';        // CHANGE BANNER COLOR HERE
				// str = str + 'align="center" ';
				// str = str + 'valign="top" >\n';
				str = str + 'style="padding:0px;padding-bottom:5px;margin:0px;width:100%;" >\n';
				if (this.bNodes[x].hyperlink != ""){
					str = str + '<a href="'+this.bNodes[x].hyperlink+'" target="_blank">';
				}
							   
				if ( this.bNodes[x].bannerType == "FLASH" ){
					str  += fw24h_getFlash( this.bNodes[x]);
				}else if ( this.bNodes[x].bannerType == "IMAGE" ){
					str = str + '<img src="'+this.bNodes[x].bannerPath+'" ';
					str = str + 'border="0" ';
					str = str + 'height="'+this.bNodes[x].height+'" ';
					str = str + 'width="'+this.bNodes[x].width+'">';
				}
				if( this.bNodes[x].bannerType == "TEXT") {
					str = str + '<iframe width="'+this.bNodes[x].width+'" height="'+this.bNodes[x].height+'" src="'+this.bNodes[x].bannerPath+'" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></iframe>'
				}
		
				if (this.bNodes[x].hyperlink != ""){
					str = str + '</a>';
				}
		
				str += '</span>';	
			}
		}
		document.write( str);
        str = '';
        return str;
};

// d_Banner
// Written by Dungpt
function dFloat_Banner(objName){
        this.obj = objName;
        this.aNodes = [];
        this.currentBanner = 0;
       
};
// ADD NEW BANNER
dFloat_Banner.prototype.add = function(bannerType, bannerPath, height, width, hyperlink) {
		var bannerDuration = 0;
        this.aNodes[this.aNodes.length] = new Node(this.obj +"_"+ this.aNodes.length, bannerType, bannerPath, bannerDuration, height, width, hyperlink);
};
// Outputs the banner to the page
dFloat_Banner.prototype.toString = function() {
        var str = "";
		var BannerPostion = Math.floor(Math.random()*12321) % this.aNodes.length;
        for (var iCtr=BannerPostion; iCtr < this.aNodes.length; iCtr++){
                str = str + '<span name="'+this.aNodes[iCtr].name+'" '
                str = str + 'id="'+this.aNodes[iCtr].name+'" ';
                //str = str + 'class="m_banner_hide" ';
                str = str + 'bgcolor="#FFFCDA" ';        // CHANGE BANNER COLOR HERE
                str = str + 'align="center" ';
                str = str + 'valign="top" >\n';
                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '<a  href="'+this.aNodes[iCtr].hyperlink+'" target="_blank">';
                }
                       
                if ( this.aNodes[iCtr].bannerType == "FLASH" ){
                        str = str + '<OBJECT '
                        str = str + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
                        str = str + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'id="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="" '
                        str = str + 'VIEWASTEXT>'
                        str = str + '<PARAM NAME=movie VALUE="'+ this.aNodes[iCtr].bannerPath + '">'
                        str = str + '<PARAM NAME=quality VALUE=high>'
                        str = str + '<PARAM NAME=bgcolor VALUE=#FFFCDA>'
						str = str + '<PARAM NAME=wmode VALUE="transparent">'
                        str = str + '<EMBED ';
                        str = str + 'src="'+this.aNodes[iCtr].bannerPath+'" '
                        str = str + 'quality=high '
//                        str = str + 'bgcolor=#FFFCDA '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'NAME="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="center" wmode="transparent" '
                        str = str + 'TYPE="application/x-shockwave-flash" '
                        str = str + 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'
                        str = str + '</EMBED>'
                        str = str + '</OBJECT>'
                }else if ( this.aNodes[iCtr].bannerType == "IMAGE" ){
                        str = str + '<img  src="'+this.aNodes[iCtr].bannerPath+'" ';
                        str = str + 'border="0" ';
                        str = str + 'height="'+this.aNodes[iCtr].height+'" ';
                        str = str + 'width="'+this.aNodes[iCtr].width+'">';
                }
				if( this.aNodes[iCtr].bannerType == "TEXT") {
					str = str + '<iframe width="'+this.aNodes[iCtr].width+'" height="'+this.aNodes[iCtr].height+'" src="'+this.aNodes[iCtr].bannerPath+'" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></iframe>'
				}

                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '</a>';
                }

                str += '</span>';
        }
		for (var iCtr=0; iCtr < BannerPostion; iCtr++){
                str = str + '<span name="'+this.aNodes[iCtr].name+'" '
                str = str + 'id="'+this.aNodes[iCtr].name+'" ';
                //str = str + 'class="m_banner_hide" ';
                str = str + 'bgcolor="#FFFCDA" ';        // CHANGE BANNER COLOR HERE
                str = str + 'align="center" ';
                str = str + 'valign="top" >\n';
                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '<a  href="'+this.aNodes[iCtr].hyperlink+'" target="_blank">';
                }
                       
                if ( this.aNodes[iCtr].bannerType == "FLASH" ){
                        str = str + '<OBJECT '
                        str = str + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
                        str = str + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'id="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="" '
                        str = str + 'VIEWASTEXT>'
                        str = str + '<PARAM NAME=movie VALUE="'+ this.aNodes[iCtr].bannerPath + '">'
                        str = str + '<PARAM NAME=quality VALUE=high>'
                        str = str + '<PARAM NAME=bgcolor VALUE=#FFFCDA>'
						str = str + '<PARAM NAME=wmode VALUE="transparent">'
                        str = str + '<EMBED ';
                        str = str + 'src="'+this.aNodes[iCtr].bannerPath+'" '
                        str = str + 'quality=high '
//                        str = str + 'bgcolor=#FFFCDA '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'NAME="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="center" wmode="transparent" '
                        str = str + 'TYPE="application/x-shockwave-flash" '
                        str = str + 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'
                        str = str + '</EMBED>'
                        str = str + '</OBJECT>'
                }else if ( this.aNodes[iCtr].bannerType == "IMAGE" ){
                        str = str + '<img src="'+this.aNodes[iCtr].bannerPath+'" ';
                        str = str + 'border="0" ';
                        str = str + 'height="'+this.aNodes[iCtr].height+'" ';
                        str = str + 'width="'+this.aNodes[iCtr].width+'">';
                }
				if( this.aNodes[iCtr].bannerType == "TEXT") {
					str = str + '<iframe width="'+this.aNodes[iCtr].width+'" height="'+this.aNodes[iCtr].height+'" src="'+this.aNodes[iCtr].bannerPath+'" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></iframe>'
				}

                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '</a>';
                }

                str += '</span>';
        }
        return str;
};

function flashWrite(url,w,h,id,bg,vars){

     var flashStr=
    "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
    "<param name='allowScriptAccess' value='always' />"+
    "<param name='movie' value='"+url+"' />"+
    "<param name='FlashVars' value='"+vars+"' />"+
    "<param name='wmode' value='transparent' />"+
    "<param name='menu' value='false' />"+
    "<param name='quality' value='high' />"+
    "<embed src='"+url+"' FlashVars='"+vars+"' wmode='transparent' menu='false' quality='high' width='"+w+"' height='"+h+"' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
    "</object>";
    document.write(flashStr);
}

