$j(document).ready(function($){
	$(".internal-link-overlay").each(function(){
		if($(this).attr("target"))
			$(this).removeAttr("target");

		width = "665px";
		height = "600px";
		if($(this).attr("onclick")){
			attrOnClick = $(this).attr("onclick").toString();
			width = attrOnClick.match(/width\=[0-9]+/g);
			if(typeof width == "object"){
				width = width+"px";
				width = width.replace(/width=/g, "");
			}
			height = attrOnClick.match(/height\=[0-9]+/g);
			if(typeof height == "object"){
				height = height+"px";
				height = height.replace(/height=/g, "");
			}
			$(this).removeAttr("onclick");
		}

		$(this).colorbox({ "width": width, "height": height, "iframe": true });
	});
	
	$(".external-link-overlay").each(function(){
		if($(this).attr("target"))
			$(this).removeAttr("target");

		width = "800px";
		height = "600px";
		if($(this).attr("onclick")){
			attrOnClick = $(this).attr("onclick").toString();
			width = attrOnClick.match(/width\=[0-9]+/g);
			if(typeof width == "object"){
				width = width+"px";
				width = width.replace(/width=/g, "");
			}
			height = attrOnClick.match(/height\=[0-9]+/g);
			if(typeof height == "object"){
				height = height+"px";
				height = height.replace(/height=/g, "");
			}
			$(this).removeAttr("onclick");
		}

		$(this).colorbox({ "width": width, "height": height, "iframe": true });
	});	
});