// Javascript code from J. Edwards, The Javascript Anthology, Sitepoint
document.onclick = function(e) {

var target = e ? e.target : window.event.srcElement;
while (target && !/^(a|body)$/i.test(target.nodeName)) {
	target = target.parentNode;
}

if (target && target.getAttribute('rel') && target.rel == 'external') {
	var external = window.open(target.href);
	return external.closed;
}
if (target && target.getAttribute('rel') && target.rel == 'popup') {

	var external = window.open(target.href, '', 'width=800, height=520, scrollbars=no, resizable=yes, status=yes, toolbar=no, menubar=no, location=no');
	return external.closed;
}

if (target && target.getAttribute('rel') && target.rel == 'popup_scroll') {

	var external = window.open(target.href, '', 'width=820, height=520, scrollbars=yes, resizable=yes, status=yes, toolbar=no, menubar=no, location=no');
	return external.closed;
}

if (target && target.getAttribute('rel') && target.rel == 'popup_small') {

	var external = window.open(target.href, '', 'width=800, height=400, scrollbars=no, resizable=yes, status=yes, toolbar=no, menubar=no, location=no');
	return external.closed;
}

if (target && target.getAttribute('rel') && target.rel == 'popup_big') {

	//var external = window.open(target.href, '', 'width=1010, height=804, scrollbars=yes, resizable=yes, status=yes, toolbar=no, menubar=no, location=no');
	var external = window.open(target.href, '', 'width=1010, height=780, scrollbars=no, resizable=yes, status=yes, toolbar=no, menubar=no, location=no');
	return external.closed;
}

if (target && target.getAttribute('rel') && target.rel == 'popup_bigi') {

	//var external = window.open(target.href, '', 'width=1010, height=804, scrollbars=yes, resizable=yes, status=yes, toolbar=no, menubar=no, location=no');
	//var external = window.open(target.href, '', 'width=1000, height=793, scrollbars=no, resizable=yes, status=yes, toolbar=no, menubar=no, location=no');
	var external = window.open(target.href, '', 'width=1000, height=780, scrollbars=no, resizable=yes, status=yes, toolbar=no, menubar=no, location=no');
	return external.closed;
}

if (target && target.getAttribute('rel') && target.rel == 'popup_about') {

	var external = window.open(target.href, '', 'width=800, height=620, scrollbars=no, resizable=yes, status=yes, toolbar=no, menubar=no, location=no');
	return external.closed;
}

}

function allowZoom()
{
    document.getElementById("viewport").setAttribute('content','device-width = 320, width = 320, minimum-scale = 1, maximum-scale = 10');
}
function disableZoom()
{
    document.getElementById("viewport").setAttribute('content','device-width = 320, width = 320, minimum-scale = 1, maximum-scale = 1');
}



