var popUp

function ArtPict(artid,krj) 
{
    open('katRysunki.aspx?artid=' + artid + '&krjkod=' + krj, 'popupcal','width=450,height=500,left=200,top=150,scrollbars');
}


function vile(ilosc){
	
    if (isInteger(ilosc.value)==false)
    {
        alert("Niepoprawna wartosc !")
        ilosc.value = "1"
        ilosc.focus()
        return false
    }
    return true
 }
 
 function vsel(ilosc){
	
    if (isInteger(ilosc.value)==true)
    {
        ilosc.value++
    }
    ilosc.focus()
    ilosc.select()
    return true
 }
 
function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) 
        return false;
    }
    // All characters are numbers.
    return true;
}

function FitPicture() 
{
	var iWidth = alertWidth();
	var iHeight = alertHeight();
	var iWidthNew = document.images[0].width - iWidth + 35;
	var iHeightNew = document.images[0].height - iHeight + 40;
	window.resizeBy(iWidthNew, iHeightNew);
	self.focus();
};	


function alertHeight() {
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) 
  {
    //Non-IE
    myHeight = window.innerHeight;
  } 
  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
  {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Height = ' + myHeight );
  return myHeight;
}
		
function alertWidth() {
      var myWidth = 0;
      if( typeof( window.innerWidth ) == 'number' ) 
      {
        //Non-IE
        myWidth = window.innerWidth;
      } 
      else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
      {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
      } 
      else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
      {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
      }
      //window.alert( 'Width = ' + myWidth );
      //window.alert( 'Width = ' + myWidth );
      return myWidth;
}
		

function chkDiv(id, display) 
{
    var div, style;

    if(document.getElementById) 
    {
        div = document.getElementById(id);
    }
    if(div && (style = div.style)) 
    {
        if(div.filters) 
        {
	        style.filter = 'blendTrans(duration=0)';
	        div.filters.blendTrans.Apply();
	        div.filters.blendTrans.Play();
        }
		
        style.display = display;
    }
}


