// winsizer maximum
function WinSizer() {
windowWidth = window.screen.availWidth;
windowHeight = window.screen.availHeight;
window.moveTo(0,0);
window.resizeTo(windowWidth,windowHeight);
}

// open and clouse group
function OpenDivGroup(div){
	if (document.getElementById(div).style.display == "none")
	{
		document.getElementById(div).style.display = "block";
	}
	else
	{
		document.getElementById(div).style.display = "none";
    }
}

// only numbers in textbox
function isNumberKey(evt)
{
   var charCode = (evt.which) ? evt.which : event.keyCode
   if (charCode > 31 && (charCode < 48 || charCode > 57))
      return false;
    return true;
}

// only tiny words
function UCase()
{
 if ((event.keyCode > 96 && event.keyCode < 123)||(event.keyCode > 223 && event.keyCode< 254))
  {
   event.keyCode = event.keyCode - 32;
  }
}

// print
function selfprint() {
self.print();
}

// button without form
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]+"'");
}

// define number characters in textbox
function CounterUpdate(opt_countedTextBox, opt_countBody, opt_maxSize) {
  var countedTextBox = opt_countedTextBox ?
    opt_countedTextBox : "countedTextBox";
  var countBody = opt_countBody ? opt_countBody : "countBody";
  var maxSize = opt_maxSize ? opt_maxSize : 1800;
    
  var field = document.getElementById(countedTextBox);
  if (field && field.value.length >= maxSize) {
    field.value = field.value.substring(0, maxSize);
  }
  var txtField = document.getElementById(countBody);
  if (txtField) {  
    txtField.innerHTML = field.value.length;
  }
}

// popups
function popupmail(URL) {
window.open(URL,'','width=385, height=235, top=100, left=150, scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}
function popupproduct(URL) {
window.open(URL,'','width=530, height=350, top=150, left=100, scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}
function popupprint(URL) {
window.open(URL,'','width=720, height=400, top=100, left=80, scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}
