

function pop_isClass(obj, className) {
	return new RegExp('\\b'+className+'\\b').test(obj.className);
}

function pop_init() {
	var as = document.getElementsByTagName('a');
	
	for(var x=as.length - 1; x>=0; x--) {
		if(pop_isClass(as[x], 'smallpop')) {
			as[x].onclick = pop_click;
		} else if (pop_isClass(as[x], 'pop')) {
			as[x].onclick = pop_bigclick;
		} else {
			if(as[x].getAttribute('target') == '_blank')
				as[x].className == 'pop';
		}
	}
}

function pop_click() {
	var pop = window.open(this.getAttribute('href'), 'popup', 'width=640,height=600,status=yes,scrollbars=yes,resizable=1');
	if (pop == null || typeof(pop)=="undefined") {
		return true;
	} else {
		return false;
	}
}

function pop_bigclick() {
	var pop = window.open(this.getAttribute('href'));
	if (pop == null || typeof(pop)=="undefined") {
		return true;
	} else {
		return false;
	}
}

pop_init();


