<!--
function spelarinfo(url)
{
	
	if (window.searchWin && !window.searchWin.closed) {
		window.searchWin.parent.location=url;
	}
	else {
		window.searchWin = window.open(url,'_blank','toolbar=0,titlebar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,width=520,height=250');
			
	}
	if (window.focus) {
		window.searchWin.focus();
	}
}



function numeriskKoll(a){
  nr1=a.value
  flg=0;
  str="";
  arw="";
  for (var i=0;i<nr1.length;i++){
   cmp="0123456789"
   tst=nr1.substring(i,i+1)
	   if (cmp.indexOf(tst)<0){
	    flg++;
	    str+=" "+tst;
	    arw;
		
	   }else{
	   arw+="_";
	   }
  }
  


 }

function doDateCheck1(from, to) {
		if (from.value == "Välj datum" || to.value == "Välj datum") 
			return false;
		else
			return true;
	   }
	   
function doDateCheck2(from, to) {
		if (from.value > to.value) 
			return false;
		else
			return true;
	   }
	

function isNumberFloat(inputString)
{ 
  var langd   = inputString.length;
  if (langd > 0) 
  	  if (isNaN(parseFloat(inputString)))
	  	return false;
	  else
	  	return true;
  else 
	  return true;
}

function isNumberInt(inputString)
{
  var langd   = inputString.length;
  if (langd > 0) 
  	  if (isNaN(inputString))
	  	return false;
	  else
	  	return true;
  else 
	  return true;
  
}

function IsEmailValid(a)
{

var AtSym    = a.value.indexOf('@')
var Period   = a.value.lastIndexOf('.')
var Space    = a.value.indexOf(' ')
var Length   = a.value.length - 1   // Array is from 0 to length-1

if ((AtSym < 1) ||                     // '@' cannot be in first position
    (Period <= AtSym+1) ||             // Must be atleast one valid char btwn '@' and '.'
    (Period == Length ) ||             // Must be atleast one valid char after '.'
    (Space  != -1))                    // No empty spaces permitted
   {  
      return true; 
   }
return false;
}

function backa()
{
   if (navigator.appName == "Netscape")
   {
      history.back()
   }
   else
   {
      parent.history.back()
   }
}

function fixUglyIE()
{
for (a in document.links) document.links[a].onfocus = document.links[a].blur;
}
if (document.all)
{
document.onmousedown = fixUglyIE;
}

function helpdok(url)
{
	
	if (window.searchWin && !window.searchWin.closed) {
		window.searchWin.parent.location=url;
	}
	else {
		window.searchWin = window.open(url,'_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=480,height=150');
			
	}
	if (window.focus) {
		window.searchWin.focus();
	}
}

function definition(url)
{
	
	if (window.searchWin && !window.searchWin.closed) {
		window.searchWin.parent.location=url;
	}
	else {
		window.searchWin = window.open(url,'_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=640,height=445');
			
	}
	if (window.focus) {
		window.searchWin.focus();
	}
}

function rapportexempel(url)
{
	        
	    if (window.searchWin && !window.searchWin.closed) {
		    window.searchWin.parent.location=url;
	    }
	    else {
		    window.searchWin = window.open(url,'_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=850,height=625');
			
	    }
	    if (window.focus) {
		    window.searchWin.focus();
	    }
	    
}

function efterbehandling2(url)
{
		    window.open(url,'_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=620,height=650');  
}

function organisationsnummer(nr){
	this.valid=false;
	if(!nr.match(/^(\d{1})(\d{5})(\d{4})$/)){ return false; }
	this.group=RegExp.$1;
	this.controldigits=RegExp.$3;
	this.alldigits=this.group+RegExp.$2+this.controldigits;
	if(this.alldigits.substring(2,3)<2){ return false }
	var nn="";
	for(var n=0;n<this.alldigits.length;n++){ nn+=((((n+1)%2)+1)*this.alldigits.substring(n,n+1)); }
	this.checksum=0;
	for(var n=0;n<nn.length;n++){ this.checksum+=nn.substring(n,n+1)*1; }
	this.valid=(this.checksum%10==0)?true:false;
}

function nyanvandare(url) {	
	var url;
	window.open(url,'_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=420,height=485');
}

function glomtlosenord(url) {	
	var url;
	window.open(url,'_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=450,height=250');
}

function closeform(url)
  {
    var url;
    btn = confirm("Vill du stänga formuläret?");
    if (btn == true)
    {
      location=url;
    }
  }


function checklength(a, fieldname, howlong,cap){
		var p=a.value
		if (p.length > 0){
		  if (!  (p.length < howlong)){
		  return true;
		  }else{
		  
		  return false;
		            }
		}else{
		return true;
		}
}

function inteTom(a,fieldname){
		if (a.value==''){
		alert('Du måste fylla i '+fieldname);
		a.focus();
		a.select();
		return false;
		}else{
		return true;
		}
}

	
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 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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function utskrift(dokument) {	
	var url;
	url = dokument;
	window.open(url,'_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=600,height=500');
}

function utskriftpdf(dokument) {	
	var url;
	url = dokument;
	window.open(url,'_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=800,height=600');
}



function replaceChars(entry,falt) {
alert('nisse');
out = ","; // replace this
add = "."; // with this
temp = "" + entry; // temporary holder

while (temp.indexOf(out)>-1) {
pos= temp.indexOf(out);
temp = "" + (temp.substring(0, pos) + add + 
temp.substring((pos + out.length), temp.length));
}
falt.value = temp;
}

// This script supports an unlimited number of linked combo boxed
// Their id must be "combo_0", "combo_1", "combo_2" etc.
// Here you have to put the data that will fill the combo boxes
// ie. data_2_1 will be the first option in the second combo box
// when the first combo box has the second option selected


// first combo box

	data_1 = new Option("1", "$");
	data_2 = new Option("2", "$$");

// second combo box

	data_1_1 = new Option("Adresserad direktreklam", "-");
	data_1_2 = new Option("Allers tr&auml;g&aring;rd", "-");
	data_1_3 = new Option("Coop medlemsutskick", "-");
	data_1_4 = new Option("Dr milko karlstad", "-");
	data_1_5 = new Option("Filmtidningen", "-");
	data_1_6 = new Option("Gymnasiekalender", "-");
	data_1_7 = new Option("Hej konsument 1", "-");
	data_1_8 = new Option("Hej konsument 2", "-");
	data_1_9 = new Option("Hej konsument 3", "-");
	data_1_10 = new Option("Hej konsument 4", "-");
	data_1_11 = new Option("Hemk&ouml;p kundkort", "-");
	data_1_12 = new Option("Ica e-kupong", "-");
	data_1_13 = new Option("Ica kvantum terminal- e-kupong", "-");
	data_1_14 = new Option("Ica maxi ksm", "-");
	data_1_15 = new Option("Ica maxi terminal - e-kupong", "-");
	data_1_16 = new Option("Ica n&auml;ra terminal e-kupong", "-");
	data_1_17 = new Option("Ica sommarfolder", "-");
	data_1_18 = new Option("Ladda skafferiet/r&ouml;jning & co", "-");
	data_1_19 = new Option("Lotter", "-");
	data_1_20 = new Option("Media expo", "-");
	data_1_21 = new Option("Medlemsutskick", "-");
	data_1_22 = new Option("Ptb dr", "-");
	data_1_23 = new Option("Sa/va coop", "-");
	data_1_24 = new Option("Saldobesked", "-");
	data_1_25 = new Option("Salt & peppar", "-");
	data_1_26 = new Option("Sampling", "-");
	data_1_27 = new Option("Special v&auml;xj&ouml;", "-");
	data_1_28 = new Option("Studentkortet", "-");
	data_1_29 = new Option("Utdelning s&auml;ljk&aring;r 1", "-");
	data_1_30 = new Option("Utdelning s&auml;ljk&aring;r 2", "-");
	data_1_31 = new Option("Vi-miniklubben", "-");
	data_1_32 = new Option("Vivo kundkort", "-");
	data_1_33 = new Option("V&aring;rruset", "-");
	data_1_34 = new Option("&ouml;vrigt", "-");
	data_2_1 = new Option("BABY BOX", "--");
	data_2_2 = new Option("BUTIK", "--");
	data_2_3 = new Option("COOP RECEPTH&auml;FTE", "--");
	data_2_4 = new Option("FOLDER I BUTIK", "--");
	data_2_5 = new Option("ICA", "--");


// other parameters

    displaywhenempty=""
    valuewhenempty=-1

    displaywhennotempty="-v&auml;lj mediakod-"
    valuewhennotempty=0


function change(currentbox) {
	numb = currentbox.id.split("_");
	currentbox = numb[1];
    
    i=parseInt(currentbox)+1

// I empty all combo boxes following the current one

    while ((eval("typeof(document.getElementById(\"combo_"+i+"\"))!='undefined'")) &&
           (document.getElementById("combo_"+i)!=null)) {
         son = document.getElementById("combo_"+i);
	     // I empty all options except the first one (it isn't allowed)
	     for (m=son.options.length-1;m>0;m--) son.options[m]=null;
	     // I reset the first option
	     son.options[0]=new Option(displaywhenempty,valuewhenempty)
	     i=i+1
    }


// now I create the string with the "base" name ("stringa"), ie. "data_1_0"
// to which I'll add _0,_1,_2,_3 etc to obtain the name of the combo box to fill

    stringa='data'
    i=0
    while ((eval("typeof(document.getElementById(\"combo_"+i+"\"))!='undefined'")) &&
           (document.getElementById("combo_"+i)!=null)) {
           eval("stringa=stringa+'_'+document.getElementById(\"combo_"+i+"\").selectedIndex")
           
           if (i==currentbox) break;
           i=i+1
    }


// filling the "son" combo (if exists)

    following=parseInt(currentbox)+1

    if ((eval("typeof(document.getElementById(\"combo_"+following+"\"))!='undefined'")) &&
       (document.getElementById("combo_"+following)!=null)) {
       son = document.getElementById("combo_"+following);
       stringa=stringa+"_"
       i=0
       while ((eval("typeof("+stringa+i+")!='undefined'")) || (i==0)) {

       // if there are no options, I empty the first option of the "son" combo
	   // otherwise I put "-select-" in it

	   	  if ((i==0) && eval("typeof("+stringa+"0)=='undefined'"))
	   	      if (eval("typeof("+stringa+"1)=='undefined'"))
	   	         eval("son.options[0]=new Option(displaywhenempty,valuewhenempty)")
	   	      else
	             eval("son.options[0]=new Option(displaywhennotempty,valuewhennotempty)")
	      else
              eval("son.options["+i+"]=new Option("+stringa+i+".text,"+stringa+i+".value)")
	      i=i+1
	   }
       //son.focus()
       i=1
       combostatus=''
       cstatus=stringa.split("_")
       while (cstatus[i]!=null) {
          combostatus=combostatus+cstatus[i]
          i=i+1
          }
       return combostatus;
    }
}

//-->
