(function()
{
  var out = "";
	// for prod
	var url_base = "http://www.twistedfactory.com/adsbb/adsbb_gen.php";
	var default_wmid = 100000;
	var bd = "";
	// border color
	if(undefined != this.adsbb_bd_color && typeof this.adsbb_bd_color != 'undefined' 
		&& this.adsbb_bd_color != null){
		bd = "border:2px solid #"+this.adsbb_bd_color+";";
	}
	// timer (rotate frequency)
	if(undefined != this.adsbb_rotate_freq && typeof this.adsbb_rotate_freq != 'undefined'
		&& this.adsbb_rotate_freq != null && this.adsbb_rotate_freq > 9){
		reload_freq(this.adsbb_rotate_freq);
	}
	
	out += start_iframe(bd);
	out += base_iframe(adsbb_template, adsbb_type);

	switch(adsbb_type){
		case "shoot":
			out += add_param("id", this.adsbb_wmid, default_wmid);
			out += add_param("site", this.adsbb_site, "chantasbitches");
			out += add_param("get_logo_type", this.adsbb_logotype, "v");
			out += add_param("shoot", this.adsbb_shoot, "Her Willing Cunt");
			out += add_param("get_bg", this.adsbb_bg, 4);
			out += add_param("bg_color", this.adsbb_bg_color, "000000");
			out += add_param("title_color", this.adsbb_title_color, "000000");
			out += add_param("text_color", this.adsbb_text_color, "000000");
			out += add_param("picborder_color", this.adsbb_picborder_color, "000000");
			out += add_param("link_color", this.adsbb_link_color, "000000");
			out += add_param("get_thumbs", this.adsbb_thumbs, "tn02;tn04;tn08;tn10;tn13");
			out += add_param("get_link", this.adsbb_link, "updates");
			out += add_param("get_title", this.adsbb_title, "true");
			out += add_param("get_desc", this.adsbb_desc, "true");
			out += add_param("model", this.adsbb_model, "Adrianna Nicole");
      out += add_param("campaign", this.adsbb_campaign, "none");
			out += add_param("rotate_group", this.adsbb_rotate_group, "all");
			out += add_param("promotext1", this.adsbb_promotext1, "Enter Here");
			out += add_param("promotext2", this.adsbb_promotext2, "Enter Here");
		break;
		case "model":
			out += add_param("id", this.adsbb_wmid, default_wmid);
			out += add_param("site", this.adsbb_site, "chantasbitches");
			out += add_param("get_bg", this.adsbb_bg, 1);
			out += add_param("bg_color", this.adsbb_bg_color, "000000");
			out += add_param("title_color", this.adsbb_title_color, "000000");
			out += add_param("text_color", this.adsbb_text_color, "000000");
			out += add_param("picborder_color", this.adsbb_picborder_color, "000000");
			out += add_param("link_color", this.adsbb_link_color, "000000");
			out += add_param("get_thumbs", this.adsbb_thumbs, "ArielX;Berlin;Bobbi Starr");
			out += add_param("get_link", this.adsbb_link, "updates");
			out += add_param("get_logo_type", this.adsbb_logotype, "h");
      out += add_param("campaign", this.adsbb_campaign, "none");
			out += add_param("rnd_picnum", this.adsbb_rnd_picnum, 3);
			out += add_param("promotext1", this.adsbb_promotext1, "Enter Here");
			out += add_param("promotext2", this.adsbb_promotext2, "Enter Here");
		break;
		case "portrait":
			out += add_param("id", this.adsbb_wmid, default_wmid);
			out += add_param("site", this.adsbb_site, "chantasbitches");
			out += add_param("shoot", this.adsbb_shoot, "Her Willing Cunt");
			out += add_param("get_bg", this.adsbb_bg, 1);
			out += add_param("bg_color", this.adsbb_bg_color, "000000");
			out += add_param("title_color", this.adsbb_title_color, "000000");
			out += add_param("text_color", this.adsbb_text_color, "000000");
			out += add_param("picborder_color", this.adsbb_picborder_color, "000000");
			out += add_param("link_color", this.adsbb_link_color, "000000");
			out += add_param("get_link", this.adsbb_link, "updates");
			out += add_param("get_logo_type", this.adsbb_logotype, "h");
			out += add_param("get_title", this.adsbb_title, "true");
			out += add_param("get_thumbs", this.adsbb_thumbs, "tn01");
			out += add_param("model", this.adsbb_model, "Adrianna Nicole");
      out += add_param("campaign", this.adsbb_campaign, "none");
			out += add_param("rotate_group", this.adsbb_rotate_group, "all");
			out += add_param("promotext1", this.adsbb_promotext1, "Enter Here");
			out += add_param("promotext2", this.adsbb_promotext2, "Enter Here");
		break;
		default:
			out += add_param("id", this.adsbb_wmid, default_wmid);
			out += add_param("site", this.adsbb_site, "chantasbitches");
			out += add_param("get_logo_type", this.adsbb_logotype, "v");
			out += add_param("shoot", this.adsbb_shoot, "Her Willing Cunt");
			out += add_param("get_bg", this.adsbb_bg, 4);
			out += add_param("bg_color", this.adsbb_bg_color, "000000");
			out += add_param("title_color", this.adsbb_title_color, "000000");
			out += add_param("text_color", this.adsbb_text_color, "000000");
			out += add_param("picborder_color", this.adsbb_picborder_color, "000000");
			out += add_param("link_color", this.adsbb_link_color, "000000");
			out += add_param("get_thumbs", this.adsbb_thumbs, "tn02;tn04;tn08;tn10;tn13");
			out += add_param("get_link", this.adsbb_link, "updates");
			out += add_param("get_title", this.adsbb_title, "true");
			out += add_param("get_desc", this.adsbb_desc, "true");
			out += add_param("model", this.adsbb_model, "Adrianna Nicole");
      out += add_param("campaign", this.adsbb_campaign, "none");
			out += add_param("rotate_group", this.adsbb_rotate_group, "all");
			out += add_param("promotext1", this.adsbb_promotext1, "Enter Here");
			out += add_param("promotext2", this.adsbb_promotext2, "Enter Here");
	}
	
	out += close_iframe();
	document.write(out);
	
	function start_iframe(style){
		return "<iframe style='"+style+"' scrolling='no'"+
		" marginwidth='0' marginheight='0' align='MIDDLE' frameborder='0'";
	}
	
	function base_iframe(template, type){
		if(template != 'undefined'){
			var xpos = template.indexOf("x");
			var _pos = template.indexOf("_");
			var w = template.substr(0, xpos);
			var h = template.substr(xpos+1, _pos-(xpos+1));
			return " width='"+w+"px' height='"+h+"px' src='"+url_base+
				"?type="+type+"&template="+template;
		}
		else{
			return " width='450' height='300' src='"+url_base+
				"?type="+type+"&template=450x300_1";
		}
	}
	
	function add_param(name, var_name, defval){
		if(undefined != var_name && typeof var_name != 'undefined' && var_name != null){
			return "&"+name+"="+var_name;
		}
		else{
			return "&"+name+"="+defval;
		}
	}
	
	function close_iframe(){
		return "'></iframe>";
	}
	
})()
	// reload function
	function reload_freq(sec){
		setTimeout("parent.frames[0].location.reload()", sec * 1000);
		t = setTimeout("reload_freq("+sec+")", sec * 1000);
	}
