<!-- 
/*
 Pleas leave this notice.
 DHTML tip message version 1.2 copyright Essam Gamal 2003 (http://migoicons.tripod.com, migoicons@hotmail.com)
 All modifications are done in the style.js you should not modify this file.  Created on : 06/03/2003
 Script featured on and can be found at Dynamic Drive (http://www.dynamicdrive.com)
*/ 

var ua = navigator.userAgent
var ps = navigator.productSub 
var dom = (document.getElementById)? 1:0
var ie4 = (document.all&&!dom)? 1:0
var ie5 = (document.all&&dom)? 1:0
var nn4 =(navigator.appName.toLowerCase() == "netscape" && parseInt(navigator.appVersion) == 4)
var nn6 = (dom&&!ie5)? 1:0
var sNav = (nn4||nn6||ie4||ie5)? 1:0
var cssFilters = ((ua.indexOf("MSIE 5.5")>=0||ua.indexOf("MSIE 6")>=0)&&ua.indexOf("Opera")<0)? 1:0
var Style=[],Text=[],Count=0,sbw=0,move=0,hs="",mx,my,scl,sct,ww,wh,obj,sl,st,ih,iw,vl,hl,sv,evlh,evlw,tbody
var HideTip = "eval(obj+sv+hl+';'+obj+sl+'=0;'+obj+st+'=-800')"
var doc_root = ((ie5&&ua.indexOf("Opera")<0||ie4)&&document.compatMode=="CSS1Compat")? "document.documentElement":"document.body"
//var PX = (nn6)? "px" :"" 
var PX = "px"
var xcoord = 1
var ycoord = 1
 
if(sNav) {
	window.onresize = ReloadTip
	document.onmousemove = MoveTip
	if(nn4) document.captureEvents(Event.MOUSEMOVE) 
}	
if(nn4||nn6) {
	mx = "e.pageX"
	my = "e.pageY"
	scl = "window.pageXOffset"
	sct = "window.pageYOffset"	
	if(nn4) {
		obj = "document.TipLayer."
		sl = "left"
		st = "top"
		ih = "clip.height"
		iw = "clip.width"
		vl = "'show'"
		hl = "'hide'"
		sv = "visibility="
	}
	else obj = "document.getElementById('TipLayer')."
} 
if(ie4||ie5) {
	obj = "TipLayer."
	mx = "event.x"
	my = "event.y"
	scl = "eval(doc_root).scrollLeft"
	sct = "eval(doc_root).scrollTop"
	if(ie5) {
		mx = mx+"+"+scl 
		my = my+"+"+sct
	}
}
if(ie4||dom){
	sl = "style.left"
	st = "style.top"
	ih = "offsetHeight"
	iw = "offsetWidth"
	vl = "'visible'"
	hl = "'hidden'"
	sv = "style.visibility="
}
if(ie4||ie5||ps>=20020823) {
	ww = "eval(doc_root).clientWidth"
	wh = "eval(doc_root).clientHeight"
}	 
else { 
	ww = "window.innerWidth"
	wh = "window.innerHeight"
	evlh = eval(wh)
	evlw = eval(ww)
	sbw=15
}	

function applyCssFilter(){
	if(cssFilters&&FiltersEnabled) { 
		var dx = " progid:DXImageTransform.Microsoft."
		TipLayer.style.filter = "revealTrans()"+dx+"Fade(Overlap=1.00 enabled=0)"+dx+"Inset(enabled=0)"+dx+"Iris(irisstyle=PLUS,motion=in enabled=0)"+dx+"Iris(irisstyle=PLUS,motion=out enabled=0)"+dx+"Iris(irisstyle=DIAMOND,motion=in enabled=0)"+dx+"Iris(irisstyle=DIAMOND,motion=out enabled=0)"+dx+"Iris(irisstyle=CROSS,motion=in enabled=0)"+dx+"Iris(irisstyle=CROSS,motion=out enabled=0)"+dx+"Iris(irisstyle=STAR,motion=in enabled=0)"+dx+"Iris(irisstyle=STAR,motion=out enabled=0)"+dx+"RadialWipe(wipestyle=CLOCK enabled=0)"+dx+"RadialWipe(wipestyle=WEDGE enabled=0)"+dx+"RadialWipe(wipestyle=RADIAL enabled=0)"+dx+"Pixelate(MaxSquare=35,enabled=0)"+dx+"Slide(slidestyle=HIDE,Bands=25 enabled=0)"+dx+"Slide(slidestyle=PUSH,Bands=25 enabled=0)"+dx+"Slide(slidestyle=SWAP,Bands=25 enabled=0)"+dx+"Spiral(GridSizeX=16,GridSizeY=16 enabled=0)"+dx+"Stretch(stretchstyle=HIDE enabled=0)"+dx+"Stretch(stretchstyle=PUSH enabled=0)"+dx+"Stretch(stretchstyle=SPIN enabled=0)"+dx+"Wheel(spokes=16 enabled=0)"+dx+"GradientWipe(GradientSize=1.00,wipestyle=0,motion=forward enabled=0)"+dx+"GradientWipe(GradientSize=1.00,wipestyle=0,motion=reverse enabled=0)"+dx+"GradientWipe(GradientSize=1.00,wipestyle=1,motion=forward enabled=0)"+dx+"GradientWipe(GradientSize=1.00,wipestyle=1,motion=reverse enabled=0)"+dx+"Zigzag(GridSizeX=8,GridSizeY=8 enabled=0)"+dx+"Alpha(enabled=0)"+dx+"Dropshadow(OffX=3,OffY=3,Positive=true,enabled=0)"+dx+"Shadow(strength=3,direction=135,enabled=0)"
	}
}

function stm(t,s) {
  if(sNav) {
  	if(t.length<2||s.length<25) {
		var ErrorNotice = "DHTML TIP MESSAGE VERSION 1.2 ERROR NOTICE.\n"
		if(t.length<2&&s.length<25) alert(ErrorNotice+"It looks like you removed an entry or more from the Style Array and Text Array of this tip.\nTheir should be 25 entries in every Style Array even though empty and 2 in every Text Array. You defined only "+s.length+" entries in the Style Array and "+t.length+" entry in the Text Array. This tip won't be viewed to avoid errors")
		else if(t.length<2) alert(ErrorNotice+"It looks like you removed an entry or more from the Text Array of this tip.\nTheir should be 2 entries in every Text Array. You defined only "+t.length+" entry. This tip won't be viewed to avoid errors.")
		else if(s.length<25) alert(ErrorNotice+"It looks like you removed an entry or more from the Style Array of this tip.\nTheir should be 25 entries in every Style Array even though empty. You defined only "+s.length+" entries. This tip won't be viewed to avoid errors.")
 	}
  	else {
		var ab = "" ;var ap = ""
		var titCol = (s[0])? "color:"+s[0]+"" : ""
		var txtCol = (s[1])? "color:"+s[1]+"" : ""
		var titBgCol = (s[2])? "background-color:"+s[2]+"" : ""
		var txtBgCol = (s[3])? "background-color:"+s[3]+"" : ""
		var titBgImg = (s[4])? "background='"+s[4]+"'" : ""	
		var txtBgImg = (s[5])? "background='"+s[5]+"'" : ""
		var titTxtAli = (s[6] && s[6].toLowerCase()!="left")? "align:"+s[6]+"" : ""
		var txtTxtAli = (s[7] && s[7].toLowerCase()!="left")? "align:"+s[7]+"" : ""   
		var add_height = (s[15])? "height:"+s[15]+"" : ""
		if(!s[8])  s[8] = "Verdana,Arial,Helvetica"
		if(!s[9])  s[9] = "Verdana,Arial,Helvetica"					
		if(!s[12]) s[12] = 1
		if(!s[13]) s[13] = 1
		if(!s[14]) s[14] = 200
		if(!s[16]) s[16] = 2
		if(!s[17]) s[17] = 0
		if(!s[18]) s[18] = 10
		if(!s[19]) s[19] = 10
		hs = s[11].toLowerCase()
		ab="style='width:"+s[14]+"px;border:"+s[16]+"px;border-style:solid;"+titBgCol+";margin:10px;'" 
		if(ps==20001108){		
		ap="style='padding:"+s[17]+"px "+s[17]+"px "+s[17]+"px "+s[17]+"px;'"}
		var closeLink=(hs=="sticky")? "<div style='text-align:right;font-size:"+s[12]+";font-family:'"+s[8]+";'><a href='javascript:void(0)' onclick='stickyhide()' style='text-decoration:none;color:"+s[0]+";'>St&auml;ng</a></div>":""
		var title=(t[0]||hs=="sticky")? "<div width='100%' style='font-size:0.85em;font-family:"+s[8]+";"+titCol+";padding:1px;'>"+t[0]+""+closeLink+"</div>" : ""
		var txt="<div "+ab+"><strong>"+title+"</strong><div style='width:100%;"+add_height+";"+txtBgCol+";"+txtBgImg+";'><div style='padding:4px;font-size:0.75em;font-family:"+s[9]+";"+txtCol +";'>"+t[1]+"</div></div></div>"

		if(nn4) {
			with(eval(obj+"document")) {
				open()
				write(txt)
				close()			
			}
		}
		else eval(obj+"innerHTML=txt")
		tbody = {
			Pos:s[10].toLowerCase(), 
			Xpos:s[18],
			Ypos:s[19], 
			Transition:s[20],
			Duration:s[21], 
			Alpha:s[22],
			ShadowType:s[23].toLowerCase(),
			ShadowColor:s[24],
			Width:parseInt(eval(obj+iw)+3+sbw)
		}
		if(ie4) { 
			TipLayer.style.width = s[14]
	 		tbody.Width = s[14]
		}
		Count=0	
		move=1
 	 }
  }
}

function MoveTip(e) {

	if(move) {
   // Get mousepos
	  if( !e ) {
      //if the browser did not pass the event information to the
      //function, we will have to obtain it from the event register
      if( window.event ) {
        //Internet Explorer 8-
        e = window.event;
      } else {
        //total failure, we have no way of referencing the event
      }
  	}
    else if( typeof( e.pageX ) == 'number' ) {
      //most browsers
      xcoord = e.pageX;
      ycoord = e.pageY;
    } else if( typeof( e.clientX ) == 'number' ) {
      //Internet Explorer 8- and older browsers
      //other browsers provide this, but follow the pageX/Y branch
      xcoord = e.clientX;
      ycoord = e.clientY;			
      var badOldBrowser = ( window.navigator.userAgent.indexOf( 'Opera' ) + 1 ) ||
       ( window.ScriptEngine && ScriptEngine().indexOf( 'InScript' ) + 1 ) ||
       ( navigator.vendor == 'KDE' );
      if( !badOldBrowser ) {
        if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
          //IE 4, 5 & 6 (in non-standards compliant mode)
          xcoord += document.body.scrollLeft;
          ycoord += document.body.scrollTop;
        } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
          //IE 6 (in standards compliant mode)
          xcoord += document.documentElement.scrollLeft;
          ycoord += document.documentElement.scrollTop;
        }
      }
    } else {
      //total failure, we have no way of obtaining the mouse coordinates
    }
//		var X,Y,xcoord = eval(mx),ycoord = eval(my); tbody.Height = parseInt(eval(obj+ih)+3)
		var X,Y = eval(mx); tbody.Height = parseInt(eval(obj+ih)+3)

// alert("3xcoord:"+xcoord+" ycoord:"+ycoord)			
		tbody.wiw = parseInt(eval(ww+"+"+scl)); tbody.wih = parseInt(eval(wh+"+"+sct))
		switch(tbody.Pos) {
			case "left" : X=xcoord-tbody.Width-tbody.Xpos; Y=ycoord+tbody.Ypos; break
			case "center": X=xcoord-(tbody.Width/2); Y=ycoord+tbody.Ypos; break
			case "float": X=tbody.Xpos+eval(scl); Y=tbody.Ypos+eval(sct); break	
			case "fixed": X=tbody.Xpos; Y=tbody.Ypos; break		
			default: X=xcoord+tbody.Xpos; Y=ycoord+tbody.Ypos
		}

		if(tbody.wiw<tbody.Width+X) X = tbody.wiw-tbody.Width
		if(tbody.wih<tbody.Height+Y+sbw) {
			if(tbody.Pos=="float"||tbody.Pos=="fixed") Y = tbody.wih-tbody.Height-sbw
			else Y = ycoord-tbody.Height
		}
// alert("x:"+X+" y:"+Y+" px:"+PX+" xcoord:"+xcoord+" ycoord:"+ycoord)		
		if(X<0) X=0 
		eval(obj+sl+"=X+PX;")
		eval(obj+st+"=Y+PX;")		
		ViewTip()
	}
}

function ViewTip() {
  	Count++
	if(Count == 1) {
		if(cssFilters&&FiltersEnabled) {	
			for(Index=28; Index<31; Index++) { TipLayer.filters[Index].enabled = 0 }
			for(s=0; s<28; s++) { if(TipLayer.filters[s].status == 2) TipLayer.filters[s].stop() }
			if(tbody.Transition == 51) tbody.Transition = parseInt(Math.random()*50)
			var applyTrans = (tbody.Transition>-1&&tbody.Transition<24&&tbody.Duration>0)? 1:0
			var advFilters = (tbody.Transition>23&&tbody.Transition<51&&tbody.Duration>0)? 1:0
			var which = (applyTrans)?0:(advFilters)? tbody.Transition-23:0 
			if(tbody.Alpha>0&&tbody.Alpha<100) {
	  			TipLayer.filters[28].enabled = 1
	  			TipLayer.filters[28].opacity = tbody.Alpha
			}
			if(tbody.ShadowColor&&tbody.ShadowType == "simple") {
	  			TipLayer.filters[29].enabled = 1
	  			TipLayer.filters[29].color = tbody.ShadowColor
			}
			else if(tbody.ShadowColor&&tbody.ShadowType == "complex") {
	  			TipLayer.filters[30].enabled = 1
	  			TipLayer.filters[30].color = tbody.ShadowColor
			}
			if(applyTrans||advFilters) {
				eval(obj+sv+hl)
	  			if(applyTrans) TipLayer.filters[0].transition = tbody.Transition
	  			TipLayer.filters[which].duration = tbody.Duration 
	  			TipLayer.filters[which].apply()
			}
		}
 		eval(obj+sv+vl)
		if(cssFilters&&FiltersEnabled&&(applyTrans||advFilters)) TipLayer.filters[which].play()
		if(hs == "sticky") move=0
  	}
}

function stickyhide() {
	eval(HideTip)
}

function ReloadTip() {
	 if(nn4&&(evlw!=eval(ww)||evlh!=eval(wh))) location.reload()
	 else if(hs == "sticky") eval(HideTip)
}

function htm() {
	if(sNav) {
		if(hs!="keep") {
			move=0; 
			if(hs!="sticky") eval(HideTip)
		}	
	} 
}

  // Get the HTTP Object
  function getHTTPObject()
  {
    if (window.ActiveXObject) 
      return new ActiveXObject("Microsoft.XMLHTTP");
    else if (window.XMLHttpRequest) 
      return new XMLHttpRequest();
    else {
      alert("Din webbl&auml;sare st&ouml;der inte AJAX.");
      return null;
    }
  }

  // Implement business logic    
  function doWork()
  {    
    httpObject = getHTTPObject();
    if (httpObject != null) 
    {	
      httpObject.onreadystatechange = setOutput;

      httpObject.open("GET", "access_motor.php?uurl="
        +document.getElementById('uurl').value.replace("&", " AND ")
        + "&levels="
	+document.getElementById('levels').selectedIndex
	+ "&raport="
        +document.getElementById('raport').checked
	+ "&valid="
        +document.getElementById('valid').checked
	+ "&stamp="
        +document.getElementById('stamp').value , true);						
				
      httpObject.send(null); 				
				
      if (document.getElementById) 
      { // DOM3 = IE5, NS6 
			  document.getElementById('newsearch').style.visibility = 'visible'; 
				document.getElementById('searchform').style.visibility = 'hidden'; 
      } 
      else 
      { 
        if (document.layers) 
        { // Netscape 4 
	  		  document.newsearch.visibility = 'visible'; 
	  			document.searchform.visibility = 'hidden'; 
				} 
				else 
        { // IE 4 
	  		  document.all.newsearch.style.visibility = 'visible'; 
	 				document.all.searchform.style.visibility = 'hidden'; 
				}
      } 
      forma.uurl.disabled=true;
      forma.starta.disabled=true;
      forma.levels.disabled=true;
      forma.valid.disabled=true;
      forma.raport.disabled=true;

    }
  }

  // Change the value of the outputText field
  function setOutput()
  {
    if(httpObject.readyState == 4)
    {
      op = httpObject.responseText;
// alert(httpObject.status);
      if(op != "ok") 
      {
        if(op.indexOf("Fatal error") == -1)
        {
// alert(httpObject.responseText);
           document.getElementById('outputText').innerHTML = httpObject.responseText;
           var t=setTimeout("doWork()",1);
	}
	else
	{
          alert(op);
          var t=setTimeout("doWork()",1);
	}
      }

    }
  }

  var httpObject = null;


function gotofield() 
{

      if (document.getElementById) 
      { // DOM3 = IE5, NS6 
	document.getElementById('uurl').focus();
      } 
      else 
      { 
        if (document.layers) 
        { // Netscape 4 
	  document.forma.uurl.focus();
	} 
	else 
        { // IE 4 
	  document.all.uurl.focus();
	}
      } 
}

function doKey($key) {

  if ($key == 13) 
  {
  	  dowork();
  } 
}

function noenter() 
{
  return !(window.event && window.event.keyCode == 13); 
//	if (window.event && window.event.keyCode == 13)
//	{
//	  doWork();
//	}
}



//-->



