
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function divIn(opacity, id) { 
    opacity+=20;

    var os = document.getElementById(id).style; 
    
    os.opacity = (opacity / 101); 
    os.MozOpacity = (opacity / 101); 
    os.KhtmlOpacity = (opacity / 101); 
    os.filter = "alpha(opacity=" + opacity + ")";
    os.display="inline";
    
    clearTimeout(fadeinto);
    if(opacity<100)
    	{
	fadeinto=setTimeout("divIn(" + opacity + ",'" + id + "')",10);
    	}
}

function divOut(opacity, id) { 
    opacity-=20;

    var os = document.getElementById(id).style; 
    os.opacity = (opacity / 101); 
    os.MozOpacity = (opacity / 101); 
    os.KhtmlOpacity = (opacity / 101); 
    os.filter = "alpha(opacity=" + opacity + ")";
    
    clearTimeout(fadeoutto);
    if(opacity>0)
    	{
	fadeoutto=setTimeout("divOut(" + opacity + ",'" + id + "')",10);
    	}
    else
    	{
	os.display="none";
    	}
} 


function getScrollTop(){ 
    if(typeof pageYOffset!= 'undefined'){ 
        //most browsers 
        return pageYOffset; 
    } 
    else{ 
        var B= document.body; //IE 'quirks' 
        var D= document.documentElement; //IE with doctype 
        D= (D.clientHeight)? D: B; 
        return D.scrollTop; 
    } 
} 


function MM_showHideLayers() { //v6.0

  var y,p,v,obj,args=MM_showHideLayers.arguments;
  for (y=0; y<(args.length-2); y+=3) if ((obj=MM_findObj(args[y]))!=null) { v=args[y+2];
    if (obj.style) 
{ 

if (v=='show')
{
//alert(getScrollTop());
var listobj=MM_findObj("productlist");
listobj.style.visibility = 'hidden';
}

if (v=='hide')
{
var listobj=MM_findObj("productlist");
listobj.style.visibility = 'visible';
}

obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; 
}
var scrolltopVal =getScrollTop();
if (scrolltopVal<100)
obj.top = (getScrollTop()+50) + "px";
else
obj.top = (getScrollTop()-120) + "px";
obj.visibility=v; 
}
}

function detect()
{
framesetpage="http://www.wordfinder.net/";
thispage=window.location.href;
if (thispage.indexOf('://')<0) {thispage="://"+thispage;};
prefix=thispage.substring(0,thispage.lastIndexOf('://'));
suffix=thispage.substring(thispage.lastIndexOf('://')+3,thispage.length);
// alert('the subpage is:['+prefix+']['+suffix+']');
if (parent.location.href==window.location.href) 
{
parent.location.href=framesetpage+"?"+prefix+"&&&"+suffix
//alert(framesetpage+"?"+prefix+"&&&"+suffix);
}
}


		function keyhandler(e) {
			if(navigator.appName.substring(0,3) == "Net")
				Key = e.which;
			else 
				Key = window.event.keyCode;
			if (Key == 13) document.forms.formlogin.submit();
			}

			


if (document.all)    {n=0;ie=1;ns6=0;fShow="visible";fHide="hidden";}
if (document.getElementById&&!document.all)    {n=0;ie=0;ns6=1;fShow="visible";fHide="hidden";}
if (document.layers) {n=1;ie=0;ns6=0;fShow="show";fHide="hide";}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateFormStart() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateFormStart.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' krävs.\n'; }
  } if (errors) alert('Var vänlig fyll i alla uppgifter.');
  document.MM_returnValue = (errors == '');
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function setFocus()
{
document.form1.username.focus();
}

function changeScroll(){
var sHeight
if (ie)
   { 
   sHeight = parent.document.body.clientHeight - Layer3.offsetTop;
   if (sHeight >= 0)
sHeight  =sHeight - 35;
    Layer3.style.height = sHeight + "px";
   }
}

 
var space = " ";
var speed = "100";
var pos = 0;
var msg = "";
function Scroll()
{
window.status = msg.substring(pos, msg.length) + space + msg.substring(0,pos);
pos++;
if (pos > msg.length) pos = 0;
window.setTimeout("Scroll()", speed);
}
Scroll();

function submitForm_loginform2()
{
 document.formlogin.submit();
}

function submitForm_loginform()
{
//alert(document.MM_returnValue);
if (document.MM_returnValue == true)
 document.formlogin.submit();
 
 
 
}

function submitForm_form1()
{
if (document.MM_returnValue)
 document.form1.submit();
}





