function checkBrowser(){
	this.ver=navigator.appVersion;
	this.dom=document.getElementById?true:false;
	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom)?true:false;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?true:false;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?true:false;
	this.ie4=(document.all && !this.dom)?true:false;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?true:false;
	this.ns4=(document.layers && !this.dom)?true:false;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5);
	return this;
}
var bw=new checkBrowser();var varPageX=varPageY=0;
if (document.captureEvents && (Event.MOUSEMOVE)) {document.captureEvents(Event.MOUSEMOVE);}
window.onmousemove=readPosMouse;

function setOpacity(obj,opacity){
	opacity=(opacity==100) ? 99.999 : opacity;
	obj.style.filter = "alpha(opacity:"+opacity+")";
	obj.style.KHTMLOpacity = opacity/100;
	obj.style.MozOpacity = opacity/100;
	obj.style.opacity = opacity/100;
} 
function sizeDiv100() {
  var myHeight = 0;
  if( typeof( window.top.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.top.innerHeight;
  } else if( window.top.document.documentElement && ( window.top.document.documentElement.clientWidth || window.top.document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = window.top.document.documentElement.clientHeight;
  } else if( window.top.document.body && ( window.top.document.body.clientWidth || window.top.document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = window.top.document.body.clientHeight;
  }
  return myHeight.toString()+"px";
}
function centerDiv(w,h) {
	this.x = Math.round(screen.width/2) - Math.round(parseInt(w)/2); 
	this.y = Math.round(screen.height/2) - Math.round(h);
	return this;
}
function readPosMouse(e) {
	if (bw.ie5 || bw.ie4 || bw.ie6 || bw.ie7) {	} else {
		varPageX=e.pageX;varPageY=e.pageY;
	}  
	if (varPageX < 0){varPageX = 0;}
	if (varPageY < 0){varPageY = 0;}  
}
function createDivPers(intWidth,intHeight,strName) {
	var divAlready=document.getElementById(strName);
	if(divAlready){document.body.removeChild(divAlready);hideShowSelect("visible")}
	hideShowSelect("hidden");
	if (bw.ie5 || bw.ie4 || bw.ie6 || bw.ie7) {
		varPageX=window.event.clientX+document.body.scrollLeft;varPageY=window.event.clientY+document.body.scrollTop;
	}
	var topD=parseInt(varPageY)-(parseInt(intHeight)/2);
	var leftD=parseInt(varPageX)-(parseInt(intWidth));
	var tagDIVp=document.createElement("div");
	tagDIVp.setAttribute("id",strName);
	tagDIVp.style.width=intWidth.toString()+"px";
	tagDIVp.style.height=intHeight.toString()+"px";
	tagDIVp.style.position="absolute";
	tagDIVp.style.zIndex="2000";
	tagDIVp.style.backgroundColor="#EEEEEE";
	tagDIVp.style.color="#000000";
	tagDIVp.style.border="1px solid #006600";
	tagDIVp.style.top=topD.toString()+"px";
	tagDIVp.style.left=leftD.toString()+"px";
	tagDIVp.innerHTML="<form id=\"moreURLForm\" name=\"moreURLForm\" method=\"post\" action=\"\"><br /><label><strong>Inserisci i tuoi URL uno sotto l'altro<br />oppure copaili dal tuo .TXT o .DOC</strong><br /><textarea name=\"nKeyOnLine\" cols=\"46\" rows=\"15\" class=\"textInputNoWidth\" id=\"nKeyOnLine\"></textarea></label><br /><label><input type=\"checkbox\" name=\"delOldKey\" id\"delOldKey\" value=\"checkbox\" checked=\"checked\" />Cancella vecchie keywords</label><br /><br /><input name=\"addKeyToList\" type=\"button\" id=\"addKeyToList\" class=\"botton\" value=\"     Add URL     \" onclick=\"checkMoreURLForm();\" />&nbsp;<input name=\"closeThis\" type=\"button\" id=\"closeThis\" class=\"botton\" value=\"     Close     \" onclick=\"delDiv('multiKey');\" /></form>";
	var bodyTagP=document.getElementsByTagName("body").item(0);
	bodyTagP.appendChild(tagDIVp);
}
function createDiv100(strTextInner) {
	var altezzaDiv100=sizeDiv100();
	var divAlready=window.top.document.getElementById("div100Perc");
	if(divAlready){window.top.document.body.removeChild(divAlready);hideShowSelect("visible")}
	var divAlreadyInter=window.top.document.getElementById("div100PercInterno");
	if(divAlreadyInter){window.top.document.body.removeChild(divAlreadyInter);hideShowSelect("visible")}
	hideShowSelect("hidden");
	// div todo
	var tagDIV=window.top.document.createElement("div");
	tagDIV.setAttribute("id","div100Perc");
	tagDIV.style.backgroundColor="#006600";
	tagDIV.style.color="#FFFFFF";
	tagDIV.style.width="100%";
	tagDIV.style.position="absolute";
	tagDIV.style.height=altezzaDiv100;
	tagDIV.style.top="0px";
	tagDIV.style.left="0px";
	tagDIV.style.zIndex="5000";
	//div interno
	var tagDIVintern=window.top.document.createElement("div");
	tagDIVintern.setAttribute("id", "div100PercInterno");
	tagDIVintern.style.zIndex="6000";
	tagDIVintern.style.backgroundColor="#006600";
	tagDIVintern.style.color="#FFFFFF";
	tagDIVintern.style.width="400px";
	tagDIVintern.style.height="180px";
//	tagDIVintern.style.lineHeight="180px";
	tagDIVintern.style.position="absolute";
	tagDIVintern.style.border="3px solid #FFFFFF";
	tagDIVintern.style.fontWeight="bold";
	tagDIVintern.style.fontSize="12px";
	var posDivIntern=centerDiv(400,180);
	tagDIVintern.style.top=posDivIntern.y.toString()+"px";
	tagDIVintern.style.left=posDivIntern.x.toString()+"px";
	tagDIVintern.innerHTML="<div style=\"width: 100%; background-color: #FFFFFF; color: #000000; text-align: left; padding-top: 4px; padding-bottom: 8px;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Elaborazione URL in Corso ...</div><div style=\"width: 100%; color: #FFFFFF; text-align: center; line-height: 180px;\">"+strTextInner+"</div>";
	
	var bodyTag=window.top.document.getElementsByTagName("body").item(0);
	bodyTag.appendChild(tagDIV);
	setOpacity(window.top.document.getElementById("div100Perc"),'50');
	bodyTag.appendChild(tagDIVintern);
	setOpacity(window.top.document.getElementById("div100PercInterno"),'100');
}
function hideShowSelect(strValue) {
	var objSelect=document.getElementsByTagName("select");
	for (var ikp=0;ikp<=objSelect.length-1;ikp++) {
		objSelect[ikp].style.visibility=strValue;
	}
}
function delDiv(strValue) {
	var divAlready=document.getElementById(strValue);
	if(divAlready){document.body.removeChild(divAlready);hideShowSelect("visible")}
}