function bannermain(type,img_source,bgcolor,alt,name,width,height,url,urlend,chance) {
   this.type = type;
   this.img_source = img_source;
   this.bgcolor = bgcolor;
   this.alt = alt;
   this.name = name;
   this.width = width;
   this.height = height;
   this.url = url;
   this.urlend = urlend;
   this.chance = chance;
}
function displaymain() {
with (this) document.write(url + "<" + type + " SRC='" + img_source + "' bgcolor='" + bgcolor + "' width='" + width + "'  height='" + height + "' border=0 quality=best wmode=opaque alt='" + alt + "' name='" + name + "'>" + urlend);
}
bannermain.prototype. displaymain =  displaymain;
bannersmain = new Array();
bannersmain[0] = new bannermain("img",
			"/gourmetsettings/content/images/pagebuilder/banner_ifeelgood.jpg",
            "ffffff", 
            "Gourmet Setting Main Banner",
            "Gourmet Setting Main Banner",
			"690",
			"367",	
            "",
		    "",
             20);
bannersmain[1] = new bannermain("img",
			"/gourmetsettings/content/images/pagebuilder/mainbanner_loft.jpg",
            "ffffff", 
            "Gourmet Setting Loft",
            "Gourmet Setting Loft",
			"690",
			"367",	
            "<a href=/loft>",
			"</a>",
			20);
bannersmain[2] = new bannermain("img",
			"/gourmetsettings/content/images/pagebuilder/mainbanner_rule.jpg",
            "ffffff", 
            "Gourmet Setting Rule",
            "Gourmet Setting Rule",
			"690",
			"367",	
            "<a href=/rule>",
			"</a>",
			20);
bannersmain[3] = new bannermain("img",
			"/gourmetsettings/content/images/pagebuilder/mainbanner_flow.jpg",
            "ffffff", 
            "Gourmet Setting Flow",
            "Gourmet Setting Flow",
			"690",
			"367",	
            "<a href=/flow>",
			"</a>",
			20);
bannersmain[4] = new bannermain("img",
			"/gourmetsettings/content/images/pagebuilder/mainbanner_earthangel.jpg",
            "ffffff", 
            "Gourmet Setting Windermere",
            "Gourmet Setting Windermere",
			"690",
			"367",	
            "<a href=/windermere>",
			"</a>",
			20);
sum_of_all_chances = 0;
for (i = 0; i < bannersmain.length; i++) {
   sum_of_all_chances += bannersmain[i].chance;
}
function main_banner() {
   chance_limit = 0;
   randomly_selected_chance = Math.round((sum_of_all_chances - 1) * Math.random()) + 1;
   for (i = 0; i < bannersmain.length; i++) {
      chance_limit += bannersmain[i].chance;
      if (randomly_selected_chance <= chance_limit) {
         document.write(bannersmain[i].url  + "<" + bannersmain[i].type + " SRC='" + bannersmain[i].img_source + "' bgcolor='" + bannersmain[i].bgcolor + "' name='" + bannersmain[i].name + "' width='" + bannersmain[i].width + "' height='" + bannersmain[i].height +  "' border=0 quality=best wmode=opaque alt='" + bannersmain[i].alt + "'>" + bannersmain[i].urlend);
         return bannersmain[i];
         break;
      }
   }
}
//-->
