var myrules = {			
	/*'*' : function(element) {
		element.onclick = function() {
try{
			txtBusca.focus();
} catch(ex) {
 kkk = 1
}
		}
	},
	'.url' : function(element) {
		element.onclick = function() {		
			
		}
	},*/
	'.selClose' : function(element) {
		/*element.onmouseover = function() {this.src = "./img/closeSelO.png";	}
		element.onmouseout = function() {this.src = "./img/closeSel.png";	}*/
	},
	/*Links*/
	'a' : function(element) {
		element.style.color = CorLinO[ic];
		element.style.fontSize = "12px";
	},
	/*Lista e Textbox da janela de selecao */
	'.selObj' : function(element) {
		element.style.borderColor = CorLin[ic];
	},
	/*Item de sele��o de sites favoritos*/			
	'.item' : function(element) {
		element.style.backgroundColor = CorI[ic];			
		element.onmouseover = function() {this.style.backgroundColor = CorIO[ic];	}
		element.onmouseout = function() {this.style.backgroundColor = CorI[ic];	}
		element.onclick = function() {txtUrl.value = this._url;	}
		element.ondblclick = function() {
			txtUrl.value = this._url;
			_selOKClick();
try{
			txtBusca.focus();
} catch(ex) {
 kkk = 1
}

		}			
	},
	/*Janela com o site*/
	'.site' : function(element){					
		//Mouse Over
		element.onmouseover = function(event){						
			this.style.borderColor = CorLinO[ic];
			this.style.backgroundColor = CorPreenO[ic];
			this._filho.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=100)";
			this._filho.style.opacity = "1";
		}
		//Mouse Out
		element.onmouseout = function(){						
			this.style.borderColor = CorLin[ic];
			this.style.backgroundColor = CorPreen[ic];
			this._filho.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=80)";
			this._filho.style.opacity = "0.8";
		}
		if (element._isnew != false) {		
			element._nro = sites++;
			element._site = "";
		}		

		element.style.top = MARGIN + Math.floor(element._nro / 4) * (height + V_ESP);
		element.style.left = CENTER + (element._nro % 4) * (width + H_ESP);
		element.style.borderColor = CorLin[ic];
		element.style.backgroundColor = CorPreen[ic];
		element.style.width = width;
		element.style.height = height;	

		if (element._isnew != false) {		
			imgBack[element._nro] = document.createElement("img");
			imgBack[element._nro]._pai = element;
			element._back = imgBack[element._nro];
			imgBack[element._nro].onload = function() {
							
				this._pai._filho.innerHTML = "";
				i = document.createElement("img");				
				if (this.width == 1) {
					i.src = "./img/none.png";
				}else {
					i.src = this.src;
				}
				//opera.postError(">>>" + i.src);
				i.width = (width - PAD*2) ;
				i.height = (height - PAD*2);
				this._pai._filho.appendChild(i);
			}
			var c = document.createElement("img");
			c.src = "./img/close.png";		
			c.className = "close";
			c.style.left =  (parseInt(width) - 13) + "px";
			c.style.top = 0;
			c._pai = element;
			element._close = c;
			c.onclick = function() {			
				_limpaLink(c._pai);
try{
			txtBusca.focus();
} catch(ex) {
 kkk = 1
}

			}
			/*c.onmouseover = function() {this.src = "./img/closeO.png";	}
			c.onmouseout = function() {this.src = "./img/close.png";	}	*/		
			element.appendChild(c);
			
			
			var d = document.createElement("div");
			d.className = "int";						
			d.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=80)";
			d.style.opacity = "0.8";
			d.style.width = width - PAD*2;
			d.style.height = height - PAD*2;	
			d.style.top = PAD;
			d.style.left = PAD;		
			element.appendChild(d);
			d._pai = element;
			element._filho = d;
			_criaOpt(element);

			d = document.createElement("div");
			d.className = "leg";		
			d.innerHTML = "";
			d.style.top = height - 16;
			d._pai = element;
			element._title = d;
			element.appendChild(d);
			
			if ((Get_Cookie("u" + element._nro) != null)
			&&(Get_Cookie("u" + element._nro) != "")) {
				
				element._filho.innerHTML = "<img style='position:relative;top:" + 
													((height - PAD*2 - 31)/2)+ "px;left:" + 
													((width - PAD*2 - 31)/2) + "px' src='./img/load.gif' />";
				element._site = Get_Cookie("u" + element._nro);
				if (element._site.length > Math.round((width - PAD) / 6)) {
					element._title.innerHTML = element._site.substr(0,Math.round((width - PAD) / 6)-3) + "...";
				} else {
					element._title.innerHTML = Get_Cookie("u" + element._nro);	
				}
				//element._back.src = "http://images.websnapr.com/?url=" + Get_Cookie("u" + element._nro);				
			}		

		} else {
			element._close.style.left =  (parseInt(width) - 13) + "px";
			element._close.style.top = 0;
			
			element._filho.style.width = width - PAD*2;
			element._filho.style.height = height - PAD*2;	
			element._filho.style.top = PAD;
			element._filho.style.left = PAD;		
			
			element._title.style.top = height - 16;
		}
		element._isnew = false;
	},
	/*Div com foto do site*/
	'.int' : function(element){					
		//Mouse Over
		element.onmouseover = function(event){						
			this._pai.onmouseover();
		}
		//Mouse Out
		element.onmouseout = function(){						
			this._pai.onmouseout();
		}	
		element.onclick = function() {	
try{
			txtBusca.focus();
} catch(ex) {
 kkk = 1
}

			if (this._pai._site == "") {
				_escLink(this._pai);
			} else {
				if (Get_Cookie("l") == "N") {
					if (this._pai._site.substr(0,4) != "http"){
						window.open(c("http://" + this._pai._site, "_blank"));
					} else {
						window.open(c(this._pai._site, "_blank"));
					}
				} else {
					if (this._pai._site.substr(0,4) != "http"){
						location.href = c("http://" + this._pai._site);
					} else {
						location.href = c(this._pai._site);
					}
				}
			}
		}
		element.style.borderColor = CorLin[ic];		
	}	
};



