/*
 * THIS FILE HAS TO BE COMPLETELY SELF CONTAINED WITH NO EXTERNAL DEPENDENCIES
 * IT INCLUDES SOME COMPONENETS THAT EXIST ON THE SITE BUT THE ONES IN THIS FILE
 * DO NOT HAVE EXTERNAL LIBRARY DEPENDECIES
 */

var OT = OT || {};

OT.BookingBox = OT.BookingBox || function(_tracking, _bookingOptions, _displayOptions, _mediaPartnerTracking){
	// internal shorthand
	var _b = _bookingOptions, _d = _displayOptions, _t = _tracking, _mpt = _mediaPartnerTracking;
	var UNDF = "undefined";
	var OBJ = "object";
	
	this.apiversion = 3;
	this._host = "http://www.onetime.com"; // TODO : externalize this into a build or something
	this.box = null;
	this.frame = null;
	
	// make sure property set is complete no matter what user provides
	this.b = this.bookingOptions = {
		sid: typeof _t != OBJ ? _t : (_t.sid || null),
		kwid: typeof _t != OBJ ? null : (_t.kwid || null),
		hotel: typeof _b.hotel != UNDF ? {
			id: _b.hotel.id || null,
			name: _b.hotel.name || null,
			locationId: _b.hotel.locationId || null,
			locationName: _b.hotel.locationName || null,
			checkInDate: _b.hotel.checkInDate || null,
			checkOutDate: _b.hotel.checkOutDate || null,
			guests: _b.hotel.guests || 1,
			rooms: _b.hotel.rooms || 1,
			target: _b.hotel.target || null
		} : null,
		location: typeof _b.location != UNDF ? {
			id: _b.location.id || null,
			name: _b.location.name || null,
			checkInDate: _b.location.checkInDate || null,
			checkOutDate: _b.location.checkOutDate || null,
			guests: _b.location.guests || 1,
			rooms: _b.location.rooms || 1,
			target: _b.location.target || null
		} : null,
		flight: typeof _b.flight != UNDF ? {
			fromId: _b.flight.fromId || null,
			toId: _b.flight.toId || null,
			fromName: _b.flight.fromName || null,
			toName: _b.flight.toName || null,
			departureDate: _b.flight.departureDate || null,
			returnDate: _b.flight.returnDate || null,
			oneWay: _b.flight.oneWay === true,
			passengers: _b.flight.passengers || 1,
			target: _b.flight.target || null
		} : null
	};
	if (typeof _d == UNDF) _d = {};
	this.d = this.displayOptions = {
		boxClassName: _d.boxClassName || null,
		frameClassName: _d.frameClassName || null,
		cssURL: _d.cssURL || null,
		cache: _d.cache || false,
		popup: _d.popup || false,
		shadow: _d.shadow || false,
		overlay: _d.overlay || false,
		position: typeof _d.position != UNDF ? {
			x: _d.position.x || 0,
			y: _d.position.y || 0
		} : {
			x: 0,
			y: 0
		},
		dimensions: typeof _d.dimensions != UNDF ? {
			width: _d.dimensions.width || 570,
			height: _d.dimensions.height || 350
		} : {
			width: 570,
			height: 350
		},
		anchorElement: typeof _d.anchorElement != UNDF ? OT.dom.get(_d.anchorElement) : null,
		center: _d.center || false,
		visible: typeof _d.popup!=UNDF &&  _d.popup==false && typeof _d.visible!=UNDF ? _d.visible :  true
	};
	
	if (typeof _mpt == UNDF) _mpt = {};
	this.mpt = {
		tags: _mpt.tags || null
	};
	
	if (this.d.anchorElement != null) {
		this.d.position.x = OT.dom.getX(this.d.anchorElement);
		this.d.position.y = OT.dom.getY(this.d.anchorElement);
		this.d.position.x = isNaN(this.d.position.x) ? 0 : this.d.position.x;
		this.d.position.y = isNaN(this.d.position.y) ? 0 : this.d.position.y;
	}
	
	if (this.d.popup && this.d.center) {
		dim = OT.dom.getPageDimensions();
		this.d.position = {
			x: Math.round((dim.viewport.width - this.d.dimensions.width) / 2),
			y: Math.round((dim.viewport.height - this.d.dimensions.height) / 2 + OT.dom.getYPageScroll())
		};
	}
	
	// shorthand
	this.w = this.d.dimensions.width;
	this.h = this.d.dimensions.height;
	
	this._initialize = function(){
		var d = this.d, b = this.b;
		
		// need code to construct params and cache properly
		var opened;
		var fr;
		if (d.cache && (opened = this._getCached()) != null) {
			this._host = opened._host;
			this.w = opened.width;
			this.h = opened.height;
			this.box = opened.box;
			this.frame = opened.frame;
			if (this.box != null) {
				this.box.setPosition(d.position);
				if (this.box.visible) 
					this.box.c();
				else 
					this.box.o();
			}
			return;
		} else {
			fr = this.frame = document.createElement("iframe");
			fr.setAttribute("scrolling", "no");
			fr.setAttribute("frameBorder", "0");
			fr.name = fr.id = "fr" + this.getHashKey();
			if (d.frameClassName != null) {
				fr.className = d.frameClassName;
			}
			this._setFrameStyle(this.frame);
			if (d.popup || (!d.popup && d.anchorElement == null)) {
				this.box = new OT.PopUp(fr, d.position, {
					shadow: d.shadow,
					overlay: d.overlay,
					iframe: false
				});
				if (d.boxClassName != null) {
					this.box.main.className += " " + d.boxClassName;
				}
				d.popup = true;
			} else if (d.anchorElement != null) {
				d.anchorElement.appendChild(fr);
			}
			
			if (d.popup) {
				if (d.overlay) this._setOverlayStyle(this.box.getOverlay());
				if (d.shadow) this._setShadowStyle(this.box.getShadow());
				this._setBoxStyle(this.box.getPopUpMain());
				this._setCloseStyle(this.box.getX(), this.box.getClose());
			}
			
			fr.src = this.constructURL();
			
			if (d.cache) {
				this._setCached();
			}
			
			if(d.visible) {
				this.show();
			} else {
				this.hide();
			}
		}
	};
	
	this.constructURL = function(){
		var url = this._host + "/bookingbox.php?";
		var nil = this.nullToEscapedEmptyString;
		var h = this.b.hotel, l = this.b.location, f = this.b.flight;
		url += "sid=" + nil(this.b.sid) + "&kwid=" + nil(this.b.kwid) + "&apiversion=" + nil(this.apiversion);
		if (this.b.hotel != null) {
			url += "&type=hs";
			url += "&hid=" + nil(h.id);
			url += "&hotel=" + nil(h.name);
			url += "&lid=" + nil(h.locationId);
			url += "&city=" + nil(h.locationName);
			url += "&inDate=" + nil(h.checkInDate);
			url += "&outDate=" + nil(h.checkOutDate);
			url += "&travelers=" + nil(h.guests);
			url += "&rooms=" + nil(h.rooms);
			url += "&target=" + nil(h.target);
		} else if (this.b.location != null) {
			url += "&type=hl";
			url += "&lid=" + nil(l.id);
			url += "&city=" + nil(l.name);
			url += "&inDate=" + nil(l.checkInDate);
			url += "&outDate=" + nil(l.checkOutDate);
			url += "&travelers=" + nil(l.guests);
			url += "&rooms=" + nil(l.rooms);
			url += "&target=" + nil(l.target);
		} else if (this.b.flight != null) {
			url += "&type=fl";
			url += "&fid=" + nil(f.fromId);
			url += "&tid=" + nil(f.toId);
			url += "&from=" + nil(f.fromName);
			url += "&to=" + nil(f.toName);
			url += "&inDate=" + nil(f.departureDate);
			url += "&outDate=" + nil(f.returnDate);
			url += "&oneWay=" + (f.oneWay ? '1' : '');
			url += "&travelers=" + nil(f.passengers);
			url += "&target=" + nil(f.target);
		} else {
		
		}
		if (this.d.cssURL != null) {
			url += "&css=" + nil(this.d.cssURL);
		}
		if (this.mpt.tags != null) {
			if (typeof this.mpt.tags == "string") 
				url += "&ttags=" + nil(this.mpt.tags);
			else if (typeof this.mpt.tags == "object") {
				var tagstr = "";
				for (var i = 0; i < this.mpt.tags.length; i++) {
					tagstr += this.mpt.tags[i].replace(";", "") + ";";
				}
				url += "&ttags=" + nil(tagstr);
			}
		}
		return url;
	};
	
	this.nullToEscapedEmptyString = function(str){
		return str == null ? '' : escape(str);
	};
	
	this.center = function(){
		var main = null;
		if (this.box != null) {
			dim = OT.dom.getPageDimensions();
			main = this.box.getPopUpMain();
			this.box.setPosition({
				x: Math.round((dim.viewport.width - OT.dom.getW(main)) / 2),
				y: Math.round((dim.viewport.height - OT.dom.getH(main)) / 2 + OT.dom.getYPageScroll())
			});
		}
	};
	
	this.show = function() {
		OT.dom.displayOn(this.frame);
	};
	
	this.hide = function() {
		OT.dom.displayOff(this.frame);
	};
	
	this._getCached = function(){
		if (null != OT.BookingBoxCache[this.getHashKey()]) 
			return OT.BookingBoxCache[this.getHashKey()];
		else 
			return null;
	};
	
	this._setCached = function(){
		OT.BookingBoxCache[this.getHashKey()] = this;
	};
	
	this.getHashKey = function(){
		var key = '';
		if (this.b.hotel != null) 
			key += 'h' + this.b.hotel.id + this.b.hotel.name + this.b.hotel.locationId + this.b.hotel.locationName;
		else if (this.b.location != null) 
			key += 'l' + this.b.location.id + this.b.location.name;
		else if (this.b.flight != null) key += 'f' + this.b.flight.fromId + this.b.flight.toId + this.b.flight.fromName + this.b.flight.toName
		return key;
	};
	
	this._setBoxStyle = function(box, coords){
		var s = box.style;
		s.border = "2px solid #376cae";
		s.width = this.w + "px";
		s.height = this.h + "px";
		s.background = "white";
		s.position = "absolute";
		s.padding = "0px";
		s.margin = "0px";
		s.display = "block";
		s.zIndex = 9010;
	};
	
	this._setOverlayStyle = function(overlay){
		var s = overlay.style;
		s.opacity = 0.3;
		s.background = "black";
		s.filter = "alpha(opacity=30)";
		s.zIndex = 9009;
	};
	
	this._setShadowStyle = function(shadow){
		var s = shadow.style;
		s.width = this.w + "px";
		s.height = this.h + "px";
		s.background = "black";
		s.position = "absolute";
		s.padding = "0px";
		s.margin = "0px";
		s.display = "block";
		s.opacity = "0.3";
		s.filter = "alpha(opacity=30)";
		s.zIndex = 9009;
	};
	
	this._setFrameStyle = function(fr){
		var s = fr.style;
		s.width = this.w + "px";
		s.height = this.h + "px";
		s.border = "0px";
		s.overflow = "hidden";
		s.position = this.d.popup ? "absolute" : "relative";
		s.top = "0px";
		s.left = "0px";
		s.background = "white";
		if (!this.d.visible) {
			s.display = "none";
		}
	};
	
	this._setCloseStyle = function(x, close){
		var r = x.style, s = close.style;
		r.position = s.position = "absolute";
		r.display = s.display = "block";
		
		r.border = "0px";
		r.width = "10px";
		r.height = "10px";
		r.padding = r.margin = "0px";
		r.lineHeight = "15px";
		
		r.textDecoration = s.textDecoration = "none";
		r.fontFamily = s.fontFamily = "arial,sans-serif";
		s.fontSize = "12px";
		
		r.fontSize = "20px";
		r.color = s.color = "#3556a6";
		r.top = 0 + "px";
		r.left = (this.w - 14) + "px";
		s.top = (this.h - 15) + "px";
		s.left = (this.w - 33) + "px";
		s.zIndex = r.zIndex = 9011;
	};
	
	this._initialize(); // initialize object basically run a constructor
};

if ("undefined" == OT.BookingBoxCache || null == OT.BookingBoxCache) {
	OT.BookingBoxCache = [];
}

/* NEW POPUP BLOCKER OBJECT  */
/* USE: 
 * var myPopup = OT.PopUp(contents,coords,options); -
 * contents : array dom elements created but not added to
 */
var OT = OT ||
{};
OT.uid = function(){
	if (!OT._uid) {
		OT._uid = 0;
	}
	return OT._uid++;
};

OT.PopUp = function(contents, coords, options){
	var that = this;
	this.elements = [];
	this.options = {
		shadow: false,
		overlay: false,
		iframe: false
	};
	this.coords = {
		x: 0,
		y: 0
	};
	this.visible = false;
	this.overlay = null;
	this.shadow = null;
	this.x = null;
	this.close = null;
	this.main = null;
	this.iframe = null;
	
	this.show = function(contents){
		return this.create(contents);
	};
	
	this.create = function(){
		this.options = null == options ? this.options : options;
		if (null != coords && coords.x != null && coords.y != null) {
			this.coords.x = coords.x;
			this.coords.y = coords.y;
		} else {
			this.coords = null;
		}
		this.addMainContent(contents);
		return this;
	};
	
	this.addMainContent = function(contents){
		this._initialize();
		var el = this.elements[0].appendChild(contents);
		this.elements[this.elements.length] = el;
		for (var i = 0; i < el.childNodes.length; i++) {
			this.elements[this.elements.length] = el.childNodes[i];
		}
		
		
	};
	
	this.c = function(){
		OT.effect.showBleeders();
		for (var i = 0; i < this.elements.length; i++) {
			OT.dom.displayOff(this.elements[i]);
			OT.dom.hide(this.elements[i]);
		}
		this.visible = false;
	};
	
	this.o = function(){
		OT.effect.hideBleeders();
		for (var i = 0; i < this.elements.length; i++) {
			OT.dom.displayOn(this.elements[i]);
			OT.dom.show(this.elements[i]);
		}
		this.visible = true;
	};
	
	this.getOverlay = function(){
		return this.overlay;
	};
	
	this.getShadow = function(){
		return this.shadow;
	};
	
	this.getPopUpMain = function(){
		return this.main;
	};
	
	this.getX = function(){
		return this.x;
	};
	
	this.getClose = function(){
		return this.close;
	};
	
	this.setPosition = function(coords){
		this.main.style.top = coords.y + "px";
		this.main.style.left = coords.x + "px";
		if (this.shadow != null) {
			this.shadow.style.top = (coords.y + 10) + "px";
			this.shadow.style.left = (coords.x + 10) + "px";
		}
		if (this.iframe != null) {
			this.iframe.style.top = coords.y + "px";
			this.iframe.style.left = coords.x + "px";
		}
	};
	
	this._initialize = function(){
		// place to keep references for popups so onclick handlers can reference somehow 
		var id = "popup" + OT.uid();
		
		OT.effect.hideBleeders();
		
		var main, x, close;
		this.main = main = this.elements[0] = OT.dom.addBodyElement("div");
		main.id = id;
		main.className = "popupMain";
		
		this.x = x = OT.dom.addChildElement(main, "a");
		this.close = close = OT.dom.addChildElement(main, "a");
		x.className = "popupX";
		x.innerHTML = "&#215;"; // this is a multiplication sign 
		close.innerHTML = "close";
		close.className = "popupClose";
		
		close.onclick = function(){
			that.c();
		};
		x.onclick = function(){
			that.c();
		};
		
		x.setAttribute("href", "javascript:void(0);");
		close.setAttribute("href", "javascript:void(0);");
		
		main.style.position = x.style.position = close.style.position = "absolute";
		
		if (null != this.coords) {
			this.setPosition(this.coords);
		}
		
		if (this.options.overlay) {
			this.overlay = this.elements[this.elements.length] = OT.effect.addScreenOverlay(main, "popupOverlay");
		}
		
		if (this.options.shadow) {
			this.shadow = this.elements[this.elements.length] = OT.effect.addShadow(main, "popupShadow");
		}
		
		if (this.options.iframe) {
			this.iframe = this.elements[this.elements.length] = OT.effect.addBackgroundIframe(main);
		}
		
		x.style.display = close.style.display = "block";
		var zIndex = OT.dom.getZIndex(main);
		if(zIndex && !isNaN(parseInt(zIndex))) {
			x.style.zIndex = close.style.zIndex = zIndex + 1;
		}
//		x.style.zIndex = close.style.zIndex = OT.dom.getZIndex(main) + 1;
		x.style.top = (0 - 3) + "px";
		x.style.left = (OT.dom.getW(main) - OT.dom.getW(x) - 2) + "px";
		close.style.top = (OT.dom.getH(main) - OT.dom.getH(close) - 1) + "px";
		close.style.left = (OT.dom.getW(main) - OT.dom.getW(close) - 4) + "px";
		this.visible = true;
	};
	
	this.create();
};

/* 
 * Some methods in this object can be deprecated when YUI is used
 */
OT.dom = OT.dom ||
{};
OT.Dom = OT.dom;

OT.dom.get = function(_te){
	if (typeof _te == "string") {
		if (document.all) 
			return document.all[_te];
		else if (document.getElementById) 
			return document.getElementById(_te);
		else 
			return document[_te];
	} else if (_te) {
		return _te;
	} else {
		return null;
	}
};

OT.dom.getX = function(o){
	if (document.layers) return o.left;
	return o.offsetLeft + (o.offsetParent ? OT.dom.getX(o.offsetParent) : 0);
};

OT.dom.getY = function(o){
	if (document.layers) return o.top;
	return o.offsetTop + (o.offsetParent ? OT.dom.getY(o.offsetParent) : 0);
};

OT.dom.getW = function(o){
	if (document.layers) return o.clip.width;
	return o.offsetWidth;
};

OT.dom.getH = function(o){
	if (document.layers) return o.clip.height;
	return o.offsetHeight;
};

OT.dom.displayOff = function(element){
	element.style.display = "none";
};

OT.dom.displayOn = function(element){
	element.style.display = "block";
};

OT.dom.hide = function(element){
	element.style.visibility = "hidden";
};

OT.dom.show = function(element){
	element.style.visibility = "visible";
};

OT.dom.hideElementsByTag = function(name){
	var elements = document.getElementsByTagName(name);
	for (var i = 0; i < elements.length; i++) {
		if (OT.dom.getComputedStyle(elements[i], "visibility") != "hidden") {
			OT.dom.hide(elements[i]);
			elements[i].bleeder = true;
		}
	}
};

OT.dom.showElementsByTag = function(name){
	var elements = document.getElementsByTagName(name);
	for (var i = 0; i < elements.length; i++) {
		if (elements[i].bleeder) OT.dom.show(elements[i]);
	}
};

OT.dom.getYPageScroll = function(){
	var yS, de = document.documentElement, db = document.body;
	
	if (self.pageYOffset) {
		yS = self.pageYOffset;
	} else if (de && de.scrollTop) { // Explorer 6 Strict
		yS = de.scrollTop;
	} else if (db) {// all other Explorers
		yS = db.scrollTop;
	}
	
	return yS;
};

OT.dom.getPageDimensions = function(){ // deprecate this once YUI is used
	// returns { page: { width: #, height: #}, viewport: {width: #, height: #}}
	var dx, dy, wW, wH, pgH, pgW, w = window, db = document.body, de = document.documentElement;
	
	if (w.innerHeight && w.scrollMaxY) {
		dx = db.scrollWidth;
		dy = w.innerHeight + w.scrollMaxY;
	} else if (db.scrollHeight > db.offsetHeight) { // all but Explorer Mac
		dx = db.scrollWidth;
		dy = db.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		dx = db.offsetWidth;
		dy = db.offsetHeight;
	}
	
	if (self.innerHeight) { // all except Explorer
		wW = self.innerWidth;
		wH = self.innerHeight;
	} else if (de && de.clientHeight) { // Explorer 6 Strict Mode
		wW = de.clientWidth;
		wH = de.clientHeight;
	} else if (db) { // other Explorers
		wW = de.clientWidth;
		wH = db.clientHeight;
	}
	
	// for small pages with total height / width less then height/width of the viewport
	pgH = dy < wH ? wH : dy;
	pgW = dx < wW ? wW : dx;
	
	//pgH=pgH + 24;
	return {
		page: {
			width: pgW,
			height: pgH
		},
		viewport: {
			width: wW,
			height: wH
		}
	};
};

OT.dom.addBodyElement = function(tag){
	return document.body.appendChild(document.createElement(tag));
};

OT.dom.addChildElement = function(parent, tag){
	return parent.appendChild(document.createElement(tag));
};

/* need a better name for this function */
OT.dom.addElementsToDom = function(mainComponents){
	var root = document.createElement("div");
	for (var i = 0; i < mainComponents.length; i++) {
		el = OT.dom.addChildElement(root, mainComponents[i][0]);
		el.className = mainComponents[i][1];
		el.innerHTML = mainComponents[i][2];
	}
	return root;
};

OT.dom.getZIndex = function(element){
	return OT.dom.getComputedStyle(element, 'zIndex');
};

OT.dom.getComputedStyle = function(element, style){ // deprecate when YUI is used
	var value;
	if (document.defaultView && document.defaultView.getComputedStyle) { // W3C DOM method
		var computed = document.defaultView.getComputedStyle(element, '');
		if (computed) { // test computed before touching for safari
			value = computed[style];
		}
		return element.style[style] || value;
	} else if (document.documentElement.currentStyle/* && isIE*/) { // IE method
		value = element.currentStyle ? element.currentStyle[style] : null;
		return (element.style[style] || value);
	} else { // default to inline only
		return element.style[style];
	}
};

OT.dom.addEvent = function(obj, type, fn){
	if (obj.attachEvent) {
		obj['e' + type + fn] = fn;
		obj[type + fn] = function(){
			obj['e' + type + fn](window.event);
		}
		obj.attachEvent('on' + type, obj[type + fn]);
	} else {
		obj.addEventListener(type, fn, false);
	}
};

OT.dom.removeEvent = function(obj, type, fn){
	if (obj.detachEvent) {
		obj.detachEvent('on' + type, obj[type + fn]);
		obj[type + fn] = null;
		obj['e' + type + fn] = null;
	} else {
		obj.removeEventListener(type, fn, false);
	}
};

OT.dom.form = OT.dom.form ||
{};

OT.dom.form.getRadioValue = function(radioField){
	var val = null;
	if ("object" == typeof radioField) {
		if ("undefined" == typeof radioField.length) {
			val = radioField.checked ? radioField.value : null;
		} else {
			for (i = 0; i < radioField.length; i++) {
				if (radioField[i].checked) {
					val = radioField[i].value;
					break;
				}
			}
		}
	}
	return val;
};


OT.effect = OT.effect ||
{};
OT.Effect = OT.effect;
OT.effect.addShadow = function(element, className){
	var shadow = OT.dom.addBodyElement("div");
	shadow.className = null != className ? className : shadow.className;
	shadow.style.position = "absolute";
	var zIndex = OT.dom.getZIndex(element);
	if(zIndex && !isNaN(parseInt(zIndex))) {
		shadow.style.zIndex = zIndex - 1;
	}
	shadow.style.width = OT.dom.getW(element);
	shadow.style.height = OT.dom.getH(element);
	shadow.style.top = (OT.dom.getY(element) + 10) + "px";
	shadow.style.left = (OT.dom.getX(element) + 10) + "px";
	return shadow;
};

OT.effect.addScreenOverlay = function(element, className){
	var overlay = OT.dom.addBodyElement("div");
	overlay.className = null != className ? className : overlay.className;
	overlay.style.position = "absolute";
	var zIndex = OT.dom.getZIndex(element);
	if(zIndex && !isNaN(parseInt(zIndex))) {
		overlay.style.zIndex = zIndex - 1;
	}
	var dim = OT.dom.getPageDimensions();
	overlay.style.top = overlay.style.left = "0px";
	overlay.style.width = (dim.viewport.width > dim.page.width ? dim.viewport.width : dim.page.width) + "px";
	overlay.style.height = (dim.viewport.height > dim.page.height ? dim.viewport.height : dim.page.height) + "px";
	//window.onresize = function() {}; @TODO
	return overlay;
};

OT.effect.addBackgroundIframe = function(element){
	var iframe = OT.dom.addBodyElement("iframe");
	iframe.style.position = "absolute";
	var zIndex = OT.dom.getZIndex(element);
	if(zIndex && !isNaN(parseInt(zIndex))) {
		iframe.style.zIndex = zIndex - 1;
	}
	iframe.style.background = "white";
	/* known issue: borders in IE are factored into width not in firefox */
	iframe.style.width = (OT.dom.getW(element) - 4) + "px";
	iframe.style.height = (OT.dom.getH(element) - 4) + "px";
	iframe.style.top = OT.dom.getY(element) + "px";
	iframe.style.left = OT.dom.getX(element) + "px";
	iframe.setAttribute("frameBorder", "0");
	return iframe;
};

OT.effect.showBleeders = function(){
	OT.dom.showElementsByTag("select");
	OT.dom.showElementsByTag("embed");
	OT.dom.showElementsByTag("object");
	OT.dom.showElementsByTag("iframe");
};

OT.effect.hideBleeders = function(){
	OT.dom.hideElementsByTag("select");
	OT.dom.hideElementsByTag("embed");
	OT.dom.hideElementsByTag("object");
	OT.dom.hideElementsByTag("iframe");
};


