addLoadEvent(assignNifty);

function addLoadEvent(func) {
	var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = func;
		} else {
			window.onload = function() {
			oldonload();
			func();
		}
	}
}



function assignNifty()
{
  if(!NiftyCheck())
      return;
  var i=0;
  $$('.squareFiller').each(function(elementFound, i)
  {
    elementFound.id += i;
    RoundedTop("div#squareFiller"+i,"#000","#666", "small");
    RoundedBottom("div#squareFiller"+i,"#000","#666", "small");
    i++;
  });

  $$('.squareFillerBlack').each(function(elementFound, i)
  {
    elementFound.id += i;
    RoundedTop("div#squareFillerBlack"+i,"#000","#666", "small");
    RoundedBottom("div#squareFillerBlack"+i,"#000","#666", "small");
    i++;
  });

   $$('.x').each(function(element, i)
   {
    element.id += i;
    RoundedTop("div#roundCorners"+i,"#000","#666", "small");
    RoundedBottom("div#roundCorners"+i,"#000","#666", "small");
    i++;
   });

   $$('.squareFillerTop').each(function(element, i)
   {
    element.id += i;
    RoundedTop("div#squareFillerTop"+i,"#000","#666", "small");
    RoundedBottom("div#squareFillerTop"+i,"#000","#666", "small");
    i++;
   });

   $$('.squareFillerTopEmne').each(function(element, i)
   {
    element.id += i;
    RoundedTop("div#squareFillerTopEmne"+i,"#000","#666", "small");
    RoundedBottom("div#squareFillerTopEmne"+i,"#000","#666", "small");
    i++;
   });

   $$('.emneImgContainer').each(function(element, i)
   {
    element.id += i;
    RoundedTop("div#emneImgContainer"+i,"#000","#666", "small");
    RoundedBottom("div#emneImgContainer"+i,"#000","#666", "small");
    i++;
   });

   $$('.squareFillerTopBlack').each(function(element, i)
   {
    element.id += i;
    RoundedTop("div#squareFillerTopBlack"+i,"#000","#666", "small");
    RoundedBottom("div#squareFillerTopBlack"+i,"#000","#666", "small");
    i++;
   });
}

function manualAssignNifty(containerDiv)
{
  $$('.'+containerDiv).each(function(element, i)
   {
    element.id += i;
    RoundedTop("div#emneImgContainer"+i,"#000","#666", "small");
    RoundedBottom("div#emneImgContainer"+i,"#000","#666", "small");
    i++;
   });
}