new domFunction(initPopup, { 'a' : 'tag'} );

function initPopup(){
	 var buy_now_links = document.getElementsByTagName('a');
		max_links = buy_now_links.length;
		for (var i=0;i<max_links;i++ ){

		if (buy_now_links[i].className =='buy_nowPopUp'){
			buy_now_links[i].onclick = function(){
    var buy_now = makePopup(this.href, 800, 480, 'scroll');
    return false;
  };//-- end onclick
		}

		}//-- end for

  return true;
}

function makePopup(url, width, height, overflow){
  if (width > 640) { width = 640; }
  if (height > 480) { height = 480; }

  if (overflow == '' || !/^(scroll|resize|both)$/.test(overflow)){
    overflow = 'both';
  }

  var win = window.open(url, '',
      'width=' + width + ',height=' + height
      + ',scrollbars=' + (/^(scroll|both)$/.test(overflow) ? 'yes' : 'no')
      + ',resizable=' + (/^(resize|both)$/.test(overflow) ? 'yes' : 'no')
      + ',status=yes,toolbar=no,menubar=no,location=no'
  );

  return win;
}


/*************************************************************************************
* DOM scripting by brothercake -- http://www.brothercake.com/
* GNU Lesser General Public License -- http://www.gnu.org/licenses/lgpl.html
* allows other DOM scripting to run before window.onload;
**************************************************************************************/
function domFunction(f, a)	{
	var n = 0;
	var t = setInterval(function() {
		var c = true;
		n++;
		if(typeof document.getElementsByTagName != 'undefined' && (document.getElementsByTagName('body')[0] != null || document.body != null)) {
			c = false;
			if(typeof a == 'object') {
				for(var i in a) {
					if((a[i] == 'id' && document.getElementById(i) == null) || (a[i] == 'tag' && document.getElementsByTagName(i).length < 1))	{ 
						c = true; 
						break; 
					}
				}
			}
			if(!c) { f(); clearInterval(t); }
		}
		if(n >= 60) { clearInterval(t);}
	}, 250);
};