﻿
function showImg(id, width, height)
{
    width += 50;
    height+= 50;
    
    if(height + 50 > screen.height)
        height= screen.height- 200;

    if(width + 50 > screen.width)
        width = screen.width - 100;
        
    x = (screen.width  -  width) / 2;
    y = (screen.height - height) / 2;
    
    var a = window.open("imgDetail.aspx?imgid=" + id,"imgDialog","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,left="+x+",top="+y+",resizable=yes,width="+(width)+",height="+(height));
}

function initFilter()
{
    try
    {
	if($('madv').value == "0")
	{
        $('filtrAdvance').style.display = "none";
        $('fArrow').innerHTML = ">>";
    }
    }
    catch(e)
    {}
}


function toggleFilter()
{
    try {
    s = $("madv");
    fa= $("filtrAdvance");
    a = $('fArrow');
    
	if	(s.value == "1") {
		fa.style.display = "none";
		s.value = "0";
		a.innerHTML = ">>";
	}
	else
	{
		fa.style.display = "block";
		s.value = "1";
		a.innerHTML = "<<";
	}
	} catch(e){}
}

function $() {
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1)
      return element;

    elements.push(element);
  }

  return elements;
}