//
// common.js
// COPYRIGHT(C) ALL RIGHTS RESERVED.
//

function entryOver(entryId) {
	document.body.style.cursor = "pointer";
	if (document.layers){
		document.layers[entryId].backgroundColor = "#d9d9d9";
		document.layers[entryId].borderColor     = "#0066cc";
	} else {
		document.getElementById(entryId).style.backgroundColor = "#d9d9d9";
		document.getElementById(entryId).style.borderColor     = "#0066cc";
	}
}

function entryOut(entryId) {
	document.body.style.cursor = "auto";
	if (document.layers){
		document.layers[entryId].backgroundColor = "#ffffff";
		if (entryId != "article-0" && entryId != "article-1" && entryId != "article-2" && entryId != "article-3" && entryId != "article-4" && entryId != "article-5" && entryId != "article-6" && entryId != "article-7" && entryId != "article-8" && entryId != "article-9") {
			document.layers[entryId].borderColor   = "#cccccc";
		}
	} else {
		document.getElementById(entryId).style.backgroundColor = "#ffffff";
		if (entryId != "article-0" && entryId != "article-1" && entryId != "article-2" && entryId != "article-3" && entryId != "article-4" && entryId != "article-5" && entryId != "article-6" && entryId != "article-7" && entryId != "article-8" && entryId != "article-9") {
			document.getElementById(entryId).style.borderColor   = "#cccccc";
		}
	}
}

function gotoArticle(uri) {
	location.href = uri;
}

function altContent(altPath,altWidth,altHeight,altText) {
	document.write('<img src="'+altPath+'" width="'+altWidth+'" height="'+altHeight+'" alt="'+altText+'" />');
}

function swfContent(swfPath,swfWidth,swfHeight,swfVersion,swfBG){
	var so = new SWFObject(swfPath, "ad", swfWidth, swfHeight, swfVersion, swfBG, false);
	so.write("advertContent");
}

function ratingOver(ratingId) {
	if (ratingId == "point-10") {
		var max = 1;
		showLayer("point-10-text");
		hideLayer("point-20-text");
		hideLayer("point-30-text");
		hideLayer("point-40-text");
		hideLayer("point-50-text");
	}
	if (ratingId == "point-20") {
		var max = 2;
		hideLayer("point-10-text");
		showLayer("point-20-text");
		hideLayer("point-30-text");
		hideLayer("point-40-text");
		hideLayer("point-50-text");
	}
	if (ratingId == "point-30") {
		var max = 3;
		hideLayer("point-10-text");
		hideLayer("point-20-text");
		showLayer("point-30-text");
		hideLayer("point-40-text");
		hideLayer("point-50-text");
	}
	if (ratingId == "point-40") {
		var max = 4;
		hideLayer("point-10-text");
		hideLayer("point-20-text");
		hideLayer("point-30-text");
		showLayer("point-40-text");
		hideLayer("point-50-text");
	}
	if (ratingId == "point-50") {
		var max = 5;
		hideLayer("point-10-text");
		hideLayer("point-20-text");
		hideLayer("point-30-text");
		hideLayer("point-40-text");
		showLayer("point-50-text");
	}
		
	for (i=1; i < max+1; i++) {
		if (document.layers){
			document.layers["point-"+i+"0"].background.src = "/img/marker-rating-o.gif";
		} else {
			document.getElementById("point-"+i+"0").style.backgroundImage = "url(/img/marker-rating-o.gif)";
		}
	}
}

function ratingOut(ratingId) {
	for (var i=1; i < 6; i++){
		if (document.layers){
			document.layers["point-"+i+"0"].background.src = "/img/marker-rating-n.gif";
		} else {
			document.getElementById("point-"+i+"0").style.backgroundImage = "url(/img/marker-rating-n.gif)";
		}
	}
	hideLayer("point-10-text");
	hideLayer("point-20-text");
	hideLayer("point-30-text");
	hideLayer("point-40-text");
	hideLayer("point-50-text");
}

function showLayer(layerId){
	if(document.getElementById) {
		document.getElementById(layerId).style.visibility='visible'
	} else if(document.all){
		document.all(layerId).style.visibility='visible'
	} else if(document.layers) {
		document.layers[layerId].visibility='show'
	}
}

function hideLayer(layerId){
	if(document.getElementById){
		document.getElementById(layerId).style.visibility='hidden'
	} else if(document.all) {
		document.all(layerId).style.visibility='hidden'
	} else if(document.layers) {
		document.layers[layerId].visibility='hide'
	}
}

function dropOpen(navigationId){
	showLayer("dropdown-"+navigationId);
		if (document.layers){
			document.layers["navigation-"+navigationId].background.src = "/img/base-global-o.gif";
		} else {
			document.getElementById("navigation-"+navigationId).style.backgroundImage = "url(/img/base-global-o.gif)";
		}
}

function dropClose(navigationId){
	hideLayer("dropdown-"+navigationId);
		if (document.layers){
			document.layers["navigation-"+navigationId].background.src = "/img/base-global-n.gif";
		} else {
			document.getElementById("navigation-"+navigationId).style.backgroundImage = "url(/img/base-global-n.gif)";
		}
}

