/*
	Lightbox JS: Fullsize Image Overlays 
	by Lokesh Dhakar - http://www.huddletogether.com

	For more information on this script, visit:
	http://huddletogether.com/projects/lightbox/

	Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
	(basically, do anything you want, just leave my name and link)

*/


function initPopupbox()
{
	
	if (!document.getElementsByTagName){ return; }
	var anchors = document.getElementsByTagName("a");

	// loop through all anchor tags
	for (var i=0; i<anchors.length; i++){
		var anchor = anchors[i];

		if (anchor.getAttribute("href") && (anchor.getAttribute("rel") == "popup")){
			anchor.onclick = function () {showPopupbox(this); return false;}
		}
	}

}

function showPopupbox(img) {
	var URL = "http://www.alquilermardelplata.com/condiciones.php";
	window.open(URL, '', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=417,height=500');
}

//
// addLoadEvent()
// Adds event to window.onload without overwriting currently assigned onload functions.
// Function found at Simon Willison's weblog - http://simon.incutio.com/
//
function addLoadEvent(func)
{	
	var oldonload = window.onload;
	if (typeof window.onload != 'function'){
    	window.onload = func;
	} else {
		window.onload = function(){
		oldonload();
		func();
		}
	}

}

//Esto es para el Firefox, para que cargue antes.

if (document.addEventListener) { 
    document.addEventListener("DOMContentLoaded", initPopupbox, false); 
} else {
	addLoadEvent(initPopupbox);
}

/*
var foobar = new domFunction(function()
{
	initPopupbox();

}, { 'a' : 'tag' });
*/