var RowHoverBackgroundColor = "lightgreen";
var RowHoverForgroundColor = "black";

function ConfirmDelete(sMgs){
var v;

	v = confirm("Er du sikker på at du vil slette den valgte post, den kan ikke genskabes bagefter?");
	return v;
}

function ConfirmDeleteImageFile(){
var v;

	v = confirm("Er du sikker på at du vil slette de tilknyttede billeder?\n\nHandlingen kan ikke fortrydes.");
	return v;
}

/**
 * Sets a Cookie with the given name and value.
 *
 * name       Name of the cookie
 * value      Value of the cookie
 * [expires]  Expiration date of the cookie (default: end of current session)
 * [path]     Path where the cookie is valid (default: path of calling document)
 * [domain]   Domain where the cookie is valid
 *              (default: domain of calling document)
 * [secure]   Boolean value indicating if the cookie transmission requires a
 *              secure transmission
 */
function setCookie(name, value, expires, path, domain, secure) {
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

/**
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
function getCookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

/**
 * Deletes the specified cookie.
 *
 * name      name of the cookie
 * [path]    path of the cookie (must be same as path used to create cookie)
 * [domain]  domain of the cookie (must be same as domain used to create cookie)
 */
function deleteCookie(name, path, domain) {
    if (getCookie(name)) {
        document.cookie = name + "=" +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}

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_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

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();
}

function P7_setScroller(a,b,x,y) { //v2.9 by PVII
 var g,d,dd,w,ww,pa="";
 if((parseInt(navigator.appVersion)>4 || navigator.userAgent.indexOf("MSIE")>-1)&& navigator.userAgent.indexOf("Opera")==-1){pa="px";}
 if((g=MM_findObj(a))!=null && (d=MM_findObj(b))!=null){
  if(g.p7Scroll){if((w=MM_findObj(g.p7Scroll))!=null){
   ww=(document.layers)?w:w.style;ww.visibility="hidden";}}
 g.p7Scroll=b;dd=(document.layers)?d:d.style;dd.left=parseInt(x)+pa;
 dd.top=parseInt(y)+pa;dd.visibility="visible";g.p7sCycle=0;
 if(document.layers){g.p7sTop=g.clip.top;g.p7sBot=g.clip.bottom;
  g.p7sRight=g.clip.right;g.p7sLeft=g.clip.left;g.p7sStartTop=parseInt(y);g.p7sStartLeft=parseInt(x);
 }else if(g.style.clip){var tc=g.style.clip;var j=tc.indexOf("(");
  tc=tc.substring(j+1,tc.length-1);var tr=tc.split(" ");
  if(tc.length < 1){tr[0]=0;tr[3]=0;tr[2]=g.style.pixelHeight;tr[1]=g.style.pixelWidth;}
  g.p7sTop=parseInt(tr[0]);g.p7sRight=parseInt(tr[1]);g.p7sBot=parseInt(tr[2]);
  g.p7sLeft=parseInt(tr[3]);g.p7sStartTop=parseInt(y);g.p7sStartLeft=parseInt(x);
 }else{g.p7sTop=0;g.p7sRight=g.offsetWidth;g.p7sBot=g.offsetHeight;
  g.p7sLeft=0;g.p7sStartTop=parseInt(y);g.p7sStartLeft=parseInt(x);}}
  g.toMove=true;
	eval("P7_setGWcontrols('"+a+"')");
}

function P7_moveScroll(co,md,op,dy,cy) { //v2.9 by PVII
 var g,d,dd,x,y,h,w,tt,ff,m=false,pa="";
 op=parseInt(op);cy=parseInt(cy);dy=parseInt(dy);
 if((parseInt(navigator.appVersion)>4 || navigator.userAgent.indexOf("MSIE")>-1)&& navigator.userAgent.indexOf("Opera")==-1){pa="px";}
 if((g=MM_findObj(co))==null){return;}
 if((d=MM_findObj(g.p7Scroll))==null){return;}
 var sp=parseInt(sp=g.P7Ssp),fr=parseInt(g.P7Sfr),ff=fr;
 if(op==2){g.p7sCycle=0;g.p7sCycDy=(dy>0)?dy:g.p7sCycDy;dy=0;op=3;}
 if(op==3){g.p7sCycle+=sp;ff=fr;if(parseInt(g.p7sCycle)>cy){
  op=2;g.p7sCycle=0;ff=g.p7sCycDy;}}g.P7Sop=op;if(dy>0){ff=dy;}
 var ti="g.p7Magic=setTimeout(\"P7_moveScroll('"+co+"','"+md+"',"+op+",0,"+cy+")\","+ff+")";
 if(op==2 || dy>0){clearTimeout(g.p7Magic);eval(ti);return;}
 dd=(document.layers)?d:d.style;x=parseInt(dd.left);y=parseInt(dd.top);
 if(document.all || document.getElementById){
  h=parseInt(d.offsetHeight);w=parseInt(d.offsetWidth);
  if(!h){h=parseInt(d.style.pixelHeight);w=parseInt(d.style.pixelWidth);}
 }else if(document.layers){h=parseInt(d.clip.height);w=parseInt(d.clip.width);}
 var st=0,rStart=parseInt(g.p7sStartLeft),tStart=parseInt(g.p7sStartTop);g.p7sH=h;g.p7sW=w;
 if(md=="Down"){tt=y-sp;st=parseInt(g.p7sBot)-h-tStart;
  if(tStart<0 && tt<tStart){dd.top=tStart+pa;
  }else if(tStart>=0 && tt<st){dd.top=st+pa;}else{dd.top=tt+pa;m=true;}}
 if(md=="Up"){tt=sp+y;var rEnd=tStart+h;if(tStart<0 && tt>rEnd){dd.top=rEnd+pa;
  }else if(tStart>=0 && tt>tStart){dd.top=tStart+pa;}else{dd.top=tt+pa;m=true;}}
 if(md=="Right"){tt=x-sp;st=parseInt(g.p7sRight)-w-rStart;
  if(rStart<0 && tt<rStart){dd.left=rStart+pa;
  }else if (rStart>=0 && tt<st){dd.left=st+pa;}else{dd.left=tt+pa;m=true;}}
 if(md=="Left"){tt=x+sp;var rEnd=rStart+w;if(rStart<0 && tt>rEnd){dd.left=rEnd+pa;
  }else if (rStart>=0 && tt>rStart){dd.left=rStart+pa;}else{dd.left=tt+pa;m=true;}}
 if(m && g.toMove){eval(ti);}else{if(g.P7Sflip==1){clearTimeout(g.p7Magic);var tj=0;
  eval("g.p7Magic=setTimeout(\"P7_runScroller('"+co+"','Reverse','Medium',0,0,0,1)\","+tj+")");
 }else{if(op>0 && g.toMove){
  g.p7sCycle=0;dd.top=g.p7sStartTop+pa;dd.left=g.p7sStartLeft+pa;eval(ti);}}}
}

function P7_runScroller(co,md,spd,op,dy,cy,flp) { //v2.9 by PVII
 var g,d,dd,rl=0;rt=0;pa='',sp=2,fr=10,slw=true,kl=true;
 if((parseInt(navigator.appVersion)>4 || navigator.userAgent.indexOf("MSIE")>-1)&& navigator.userAgent.indexOf("Opera")==-1){pa="px";}
 if(navigator.userAgent.indexOf("NT")>-1 || navigator.userAgent.indexOf("Windows 2000")>-1 ){slw=false;}
 if((g=MM_findObj(co))!=null){if(g.p7Scroll){
 if((d=MM_findObj(g.p7Scroll))!=null){dd=(document.layers)?d:d.style;
 if(md=="Resume" && g.P7Sspd){spd=g.P7Sspd;md=g.P7Smd;op=g.P7Sop;dy=0;cy=g.P7Scy;flp=g.P7Sflip;kl=false;}
 if(md=="Reverse" && g.P7Sspd){spd=g.P7Sspd;md=g.P7Smd;op=g.P7Sop;flp=g.P7Sflip;dy=0;cy=g.P7Scy;kl=false;g.p7sCycle=0;
  if(g.P7Smd == "Down"){md="Up";if(g.P7Sop>0){g.p7sStartTop=g.p7sStartTop-g.p7sH;}}
  if(g.P7Smd == "Up"){md="Down";if(g.P7Sop>0){g.p7sStartTop=g.p7sStartTop+g.p7sH;}}
  if(g.P7Smd == "Left"){md="Right";if(g.P7Sop>0){g.p7sStartLeft=g.p7sStartLeft+g.p7sW;}}
  if(g.P7Smd == "Right"){md="Left";if(g.P7Sop>0){g.p7sStartLeft=g.p7sStartLeft-g.p7sW;}}}
 if(spd=="Slow"){sp=(slw)?2:1;fr=(slw)?40:30;
 }else if(spd=="Medium"){sp=(slw)?4:1;fr=(slw)?40:10;
 }else{sp=(slw)?8:4;fr=(slw)?40:10;}
 if(md=="Stop"){g.toMove=false;clearTimeout(g.p7Magic);}else if(md=="Reset"){
  g.toMove=false;dd.top=g.p7sStartTop+pa;dd.left=g.p7sStartLeft+pa;
 }else{if(kl){g.P7Ssp=sp;g.P7Sfr=fr;}if(md=="Speed"){return;}
  g.toMove=true;clearTimeout(g.p7Magic);
  g.P7Smd=md;g.P7Sspd=spd;g.P7Sop=op;g.P7Sdy=dy;g.P7Scy=cy;g.P7Sflip=flp;
  eval("P7_moveScroll('"+co+"','"+md+"',"+op+","+dy+","+cy+")");}}}}
}

function P7_setGWcontrols(co){ //v1.0 GW add-on by PVII
  var g,d,dd,h,hh,mt="visible";
  var theCont = new Array();
  //declare the list of control divs to be hidden
  theCont[0] = 'p7sc1Up';
  theCont[1] = 'p7sc1UpBG';
  theCont[2] = 'p7sc1Down';
  theCont[3] = 'p7sc1DownBG';
  theCont[4] = 'p7sc1Reset';
  theCont[5] = 'p7sc1ResetBG';
  if((g=MM_findObj(co))!=null){if(g.p7Scroll){if((d=MM_findObj(g.p7Scroll))!=null){
  if(document.all || document.getElementById){
  h=parseInt(d.offsetHeight);w=parseInt(d.offsetWidth);if(!h){
  h=parseInt(d.style.pixelHeight);w=parseInt(d.style.pixelWidth);}
  }else if(document.layers){h=parseInt(d.clip.height);w=parseInt(d.clip.width);}
  hh=parseInt(g.p7sBot)-parseInt(g.p7sTop);if(h<=hh){mt="hidden";}
  for(i=0;i<theCont.length;i++){if((d=MM_findObj(theCont[i]))!=null){
  dd=(document.layers)?d:d.style;eval("dd.visibility='"+mt+"'");}}}}}
}
	
function P7_autoLayers() { //v1.4 by PVII
 var g,b,k,f,args=P7_autoLayers.arguments;a=parseInt(args[0]);if(isNaN(a))a=0;
 if(!document.p7setc){p7c=new Array();document.p7setc=true;for(var u=0;u<10;u++){
 p7c[u]=new Array();}}for(k=0;k<p7c[a].length;k++){if((g=MM_findObj(p7c[a][k]))!=null){
 b=(document.layers)?g:g.style;b.visibility="hidden";}}for(k=1;k<args.length;k++){
 if((g=MM_findObj(args[k]))!=null){b=(document.layers)?g:g.style;b.visibility="visible";f=false;
 for(var j=0;j<p7c[a].length;j++){if(args[k]==p7c[a][j]) {f=true;}}
 if(!f){p7c[a][p7c[a].length++]=args[k];}}}
}

function doEnter(t) {
	t.style.backgroundColor='#FFFF00'; 
	t.style.color='#000000';
	t.style.textAlign = "left";
}

function doExit(t,n) {
	t.style.backgroundColor='#FFFFFF';
	t.style.color='#000000';
	if (n==true){
		t.style.textAlign = "right";
	}
	else
	{
		t.style.textAlign = "left";
	}
}

function printIt(){
window.open("output.asp", "PrinterVenlig", "width=600,height=600,status=1,scrollbars=1");
}

function setPageImage(s) {
	var	o = document.getElementById('ImageOnPage');
	if (o)o.src = s;
}

var defPageImage
function definedefaultPageImage(s) {
	defPageImage = s;
}
function setdefaultPageImage() {
	setPageImage(defPageImage);
}

function viewImageFiles() {
	GP_AdvOpenWindow('viewimagefiles.asp?shop=0','Filer','fullscreen=no,toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=no,channelmode=no,directories=no',790,585,'center','ignoreLink','',0,'',0,1,5,'');
}

function viewShopImageFiles() {
	GP_AdvOpenWindow('viewimagefiles.asp?shop=1','Filer','fullscreen=no,toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=no,channelmode=no,directories=no',790,585,'center','ignoreLink','',0,'',0,1,5,'');
}

function viewBinFiles() {
	GP_AdvOpenWindow('viewbinaryfiles.asp?fn=10','Filer','fullscreen=no,toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=no,channelmode=no,directories=no',800,415,'center','ignoreLink','',0,'',0,1,5,'');
}

function viewPDFFiles() {
	GP_AdvOpenWindow('viewpdffiles.asp','Filer','fullscreen=no,toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=no,channelmode=no,directories=no',800,415,'center','ignoreLink','',0,'',0,1,5,'');
}

function uploadBinaryFiles() {
	GP_AdvOpenWindow('uploadbinary.asp?autotm=0&shop=0','Upload','fullscreen=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,channelmode=no,directories=no',614,325,'center','ignoreLink','',0,'',0,1,5,'');
}

function uploadImageFiles() {
	GP_AdvOpenWindow('uploadimage.asp?autotm=0&shop=0','Upload','fullscreen=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,channelmode=no,directories=no',614,345,'center','ignoreLink','',0,'',0,1,5,'');
}

function uploadShopImageFiles() {
	GP_AdvOpenWindow('uploadimage.asp?autotm=0&shop=1','Upload','fullscreen=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,channelmode=no,directories=no',614,360,'center','ignoreLink','',0,'',0,1,5,'');
}

function uploadPDFFiles() {
	GP_AdvOpenWindow('uploadpdf.asp','Upload','fullscreen=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,channelmode=no,directories=no',610,340,'center','ignoreLink','',0,'',0,1,5,'');
}

function uploadShopPDFFiles() {
	GP_AdvOpenWindow('uploadpdf.asp?shop=1','Upload','fullscreen=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,channelmode=no,directories=no',610,340,'center','ignoreLink','',0,'',0,1,5,'');
}

function CommaToDot(StrToValidate, AddDecimals, nNumOfDecimals) {
	var d,r,v=StrToValidate.value;
	d=(AddDecimals)?nNumOfDecimals:0;
	if (v==""){
		v="0";
	}
	v=parseFloat(replaceCommaWithDot(v));
	v=v.toFixed(nNumOfDecimals);
	return v;
}

function replaceCommaWithDot(s) {
	return s.replace(",", ".");
}

function replaceDotWithComma(s) {
	return s.replace(".", ",");
}

function fileexists(s) {
	var fso = new ActiveXObject("Scripting.FileSystemObject");
	return fso.FileExists(s);
}

function setHoverRow(a,f,b) {
	a.style.color = f;
	a.style.backgroundColor = b;
}

function resetHoverRow(a,f,b) {
	a.style.color = f;
	a.style.backgroundColor = b;
}

function FormatMultiSelectOptions(n) {
var s, ss;
	s = "";
	ss = "";
	for (var i = 0; i < n.options.length; i++) {
		if (s != "") {
				s = s + ",";
		}
		s = s + n.options[i].value;
	}
	return s;
}

function moveOptions(objSourceElement, objTargetElement) {

var aryTempSourceOptions = new Array();
var x = 0;
	//looping through source element to find selected options
  for (var i = 0; i < objSourceElement.length; i++) {
	  if (objSourceElement.options[i].selected) {
			//need to move this option to target element
			var intTargetLen = objTargetElement.length++;
			objTargetElement.options[intTargetLen].text = objSourceElement.options[i].text;
			objTargetElement.options[intTargetLen].value = objSourceElement.options[i].value;
		}
	  else 
		{
			//storing options that stay to recreate select element
			var objTempValues = new Object();
			objTempValues.text = objSourceElement.options[i].text;
			objTempValues.value = objSourceElement.options[i].value;
			aryTempSourceOptions[x] = objTempValues;
			x++;
		}
	}
	//resetting length of source
	objSourceElement.length = aryTempSourceOptions.length;
	//looping through temp array to recreate source select element
	for (var i = 0; i < aryTempSourceOptions.length; i++) {
		objSourceElement.options[i].text = aryTempSourceOptions[i].text;
		objSourceElement.options[i].value = aryTempSourceOptions[i].value;
		objSourceElement.options[i].selected = false;
  }
}

function compareText (option1, option2) {
  return option1.text < option2.text ? -1 :
    option1.text > option2.text ? 1 : 0;
}
function compareValue (option1, option2) {
  return option1.value < option2.value ? -1 :
    option1.value > option2.value ? 1 : 0;
}
function compareTextAsFloat (option1, option2) {
  var value1 = parseFloat(option1.text);
  var value2 = parseFloat(option2.text);
  return value1 < value2 ? -1 :
    value1 > value2 ? 1 : 0;
}
function compareValueAsFloat (option1, option2) {
  var value1 = parseFloat(option1.value);
  var value2 = parseFloat(option2.value);
  return value1 < value2 ? -1 :
    value1 > value2 ? 1 : 0;
}
// sortere en liste
function sortSelect (select, compareFunction) {
  if (!compareFunction)
    compareFunction = compareText;
  var options = new Array (select.options.length);
  for (var i = 0; i < options.length; i++)
    options[i] = 
      new Option (
        select.options[i].text,
        select.options[i].value,
        select.options[i].defaultSelected,
        select.options[i].selected
      );
  options.sort(compareFunction);
  select.options.length = 0;
  for (var i = 0; i < options.length; i++)
    select.options[i] = options[i];
}

// løber en liste igennem og hvis value er = med s, så sættes index til dennne option
function setSelectedItem(select,s) {
	for (var i = 0; i < select.options.length; i++) {
		if (select.options[i].value==s)select.options[i].selected=true;
	}
	return false;
} 

// -------------------------------------------------------------------
// hasOptions(obj)
//  Utility function to determine if a select object has an options array
// -------------------------------------------------------------------
function hasOptions(obj) {
if (obj!=null && obj.options!=null) { return true; }
	return false;
}

// -------------------------------------------------------------------
// swapOptions(select_object,option1,option2)
//  Swap positions of two options in a select list
// -------------------------------------------------------------------
function swapOptions(obj,i,j) {
	var o = obj.options;
	var i_selected = o[i].selected;
	var j_selected = o[j].selected;
	var temp = new Option(o[i].text, o[i].value, o[i].defaultSelected, o[i].selected);
	var temp2= new Option(o[j].text, o[j].value, o[j].defaultSelected, o[j].selected);
	o[i] = temp2;
	o[j] = temp;
	o[i].selected = j_selected;
	o[j].selected = i_selected;
}

// -------------------------------------------------------------------
// moveOptionUp(select_object)
//  Move selected option in a select list up one
// -------------------------------------------------------------------
function moveOptionUp(obj) {
if (!hasOptions(obj)) { return; }
for (i=0; i<obj.options.length; i++) {
	if (obj.options[i].selected) {
		if (i != 0 && !obj.options[i-1].selected) {
			swapOptions(obj,i,i-1);
			obj.options[i-1].selected = true;
			}
		}
	}
}

// -------------------------------------------------------------------
// moveOptionDown(select_object)
//  Move selected option in a select list down one
// -------------------------------------------------------------------
function moveOptionDown(obj) {
if (!hasOptions(obj)) { return; }
for (i=obj.options.length-1; i>=0; i--) {
	if (obj.options[i].selected) {
		if (i != (obj.options.length-1) && ! obj.options[i+1].selected) {
			swapOptions(obj,i,i+1);
			obj.options[i+1].selected = true;
			}
		}
	}
}

function popcolorwindow(){
	// the output as an ASP is 28KB
	// the output as an HTM is 1.4KB
	// netscape renderer for HTM takes approx 4 seconds...
	// sooooo.... the answer is, if you're targeting netscape in a LAN/intranet	
	// then do your processing on the server... otherwise do it on the client.
	var nW = window.open("/webcms/includes/colorpicker.asp","farvevælger",
		"toolbar=no,menubar=no,location=no,directories=no,width=550,height=480,resizeable=no");
	// if you want to see the alternative technique, comment the previous call,
	// and uncomment the following lines...
	
	//var nW = window.open("popcolor.htm","foo",
	//	"toolbar=no,menubar=no,location=no,directories=no,width=460,height=120,resizeable=no");
}
function getFile(n) {
	var W = window.open("webcms/downloadfile.asp?fileID="+n, "Download");
}

function numOnly(e, i, maxValue, Limit) {
	var vv,keynum,keychar,keyCode,numcheck;
	if (window.event) {keynum = e.keyCode;} else if (e.which) {keynum = e.which;}
	keychar=String.fromCharCode(keynum);

	// Allow Backspace, Delete and Arrowkeys
	if (keynum==8||keynum==9||keynum==13||keynum==37||keynum==38||keynum==39||keynum==40||keynum==46||((keynum>=46)&&(keynum<=57))||
		((keynum>=96)&&(keynum<=105))){
		if ((keynum>=96)&&(keynum<=105)) {
			switch(keynum) {
				case 96: vv=0;break;
				case 97: vv=1;break;
				case 98: vv=2;break;
				case 99: vv=3;break;
				case 100: vv=4;break;
				case 101: vv=5;break;
				case 102: vv=6;break;
				case 103: vv=7;break;
				case 104: vv=8;break;
				case 105: vv=9;break;
			}
		}
		if (Limit) {if (i.value+vv > maxValue){return false;}
		}
		if ((keynum==38)||(keynum==40)) {
			var v=i.value;
			if (v.length==0)v=0;
			if (keynum==38)v++;
			if ((keynum==40)&&(v>0))v--;
			if (Limit) {
				if (keynum!=40) {
					if (v > maxValue) {return false;}else{i.value = v;return false;}
				}else{i.value = v;return false;}				
			}else{i.value = v;return false;}
		}
	}else{return false;}
}

