var randomNumber = parseInt((2 * Math.random() + 1), 4);
if(!randomNumber) randomNumber = 1;

// Browser detection
var ie = (navigator.appName == "Microsoft Internet Explorer") ? true : false;
if(navigator.appName == "Netscape") {
	var nn = (parseInt(navigator.appVersion) >= 5) ? 6 : 4;
}
var dom = (ie || nn == 6) ? true : false;


function startReturn() {
	if(window.name == 'issue') {
		window.opener.location = "../";
		window.close();
	}
	else window.location = "";
}

function openIssue(url) {
	if(!arguments[1] && !arguments[2]) {
		width = 500;
		height = 550;
	}
	else {
		width = arguments[1];
		height = arguments[2];
	}
	if(window.name != 'issue') {
		issue = window.open(url, 'issue', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+width+',height='+height+'');
		issue.focus();
	}
	else {
		window.opener.location = url;
		window.close();
	}
}

function hihglightIssue(obj) {
	var objTitles = new Array("title", "dotCorner", "dotHor", "dotVert", "arrow");
	var issue = obj.id.substr(0, obj.id.indexOf('_'));
	for(i=0; i<objTitles.length; i++) {	
		object = document.getElementById([issue + "_" + objTitles[i]]); 
		if(object.tagName == "IMG") {
			var extension = object.src.substr(object.src.indexOf('.'));
			var swaped = (object.src.search('_over') == -1) ? false : true;
			if(swaped) object.src = object.src.substr(0, object.src.length - 9) + extension;
			else object.src = object.src.substr(0, object.src.length - 4) + '_over' + extension;
		}
		else {
			var swaped = (object.className.search('_over') == -1) ? false : true;
			if(swaped) object.className = object.className.substr(0, object.className.indexOf('_'));
			else object.className += "_over";
		}
	}
}