
function changeMainNews(id) {
	for(var i=0;i<4;i++) {
		$("#mNewsContent"+i).fadeOut("slow");
		$("#mNewsCur"+i).html("");
		$("#mNewsTd"+i).css("background-color", "#ffffff");
	}
	$("#mNewsContent"+id).fadeIn("slow");
	$("#mNewsCur"+id).html("<img src=\"images/main.cursor.gif\">");
	$("#mNewsTd"+id).css("background-color", "#356da0");
}

function changeafisha(id) {
	for(var i=0;i<3;i++) {
		$("#afishaTd"+i).css("background-image", "url(images/grad4.png)");
		$("#afishaLink"+i).removeClass("white");
		$("#afishaLink"+i).addClass("main");
		$("#afishaCursor"+i).html("");
		$("#afishaContent"+i).slideUp("slow");
	}
	
	$("#afishaTd"+id).css("background-image", "url(images/grad3.png)");
	$("#afishaLink"+id).addClass("white");
	$("#afishaCursor"+id).html("<img src=\"images/media.cursor.gif\">");
	$("#afishaContent"+id).slideDown("slow");
}

function changeMedia(id) {
	for(var i=0;i<3;i++) {
		$("#mediaTd"+i).css("background-image", "url(images/grad4.png)");
		$("#mediaLink"+i).removeClass("white");
		$("#mediaLink"+i).addClass("main");
		$("#mediaCursor"+i).html("");
		$("#mediaContent"+i).slideUp("slow");
	}
	
	$("#mediaTd"+id).css("background-image", "url(images/grad3.png)");
	$("#mediaLink"+id).addClass("white");
	$("#mediaCursor"+id).html("<img src=\"images/media.cursor.gif\">");
	$("#mediaContent"+id).slideDown("slow");
}

function changeMediaInside(type, num, id, pic, title) {
/*
	for(var i=0;i<3;i++) {
		$("#media"+type+"Td"+i).css("background-color", "#ebebeb");
	}
	$("#media"+type+"Td"+num).css("background-color", "#356da0");
*/
	
	$("#media"+type+"Link").attr("href", "readnews/"+id);
	$("#media"+type+"Img").attr({
		src:pic,
		title:title
	});
	$("#media"+type+"Text").html(title);
}

function changeTopnews(id) {
	var old=id?0:1;
	
	$("#topnewsTd"+old).css("background-image", "url(images/grad4.png)");
	$("#topnewsLink"+old).removeClass("white");
	$("#topnewsLink"+old).addClass("main");
	$("#topnewsCursor"+old).html("");
	$("#topnewsContent"+old).slideUp("slow");
	
	$("#topnewsTd"+id).css("background-image", "url(images/grad3.png)");
	$("#topnewsLink"+id).addClass("white");
	$("#topnewsCursor"+id).html("<img src=\"images/topnews.cursor.gif\">");
	$("#topnewsContent"+id).slideDown("slow");
}

function changeCB(id) {

	for(var i=0;i<4;i++) {
		$("#cbTd"+i).css("background-image", "url(images/grad4.png)");
		$("#cbLink"+i).removeClass("white");
		$("#cbLink"+i).addClass("main");
		$("#cbCursor"+i).html("");
		$("#cbContent"+i).slideUp("slow");
	}
	
	$("#cbTd"+id).css("background-image", "url(images/grad3.png)");
	$("#cbLink"+id).addClass("white");
	if (id == 0){
		$("#cbCursor0").html("<img src=\"images/topnews.cursor0.gif\">");
	}
	if (id == 1){
		$("#cbCursor1").html("<img src=\"images/topnews.cursor0.gif\">");
	}
	if (id == 2){
		$("#cbCursor0").html("<img src=\"images/topnews.cursor1.gif\">");
	}
	if (id == 3){
		$("#cbCursor1").html("<img src=\"images/topnews.cursor1.gif\">");
	}
	
	$("#cbContent"+id).slideDown("slow");
}

function changebase(id) {

	for(var i=0;i<4;i++) {
		$("#baseTd"+i).css("background-image", "url(images/grad4.png)");
		$("#baseLink"+i).removeClass("white");
		$("#baseLink"+i).addClass("main");
		$("#baseCursor"+i).html("");
		$("#baseContent"+i).slideUp("slow");
	}
	
	$("#baseTd"+id).css("background-image", "url(images/grad3.png)");
	$("#baseLink"+id).addClass("white");
	if (id == 0){
		$("#baseCursor0").html("<img src=\"images/topnews.cursor0.gif\">");
	}
	if (id == 1){
		$("#baseCursor1").html("<img src=\"images/topnews.cursor0.gif\">");
	}
	if (id == 2){
		$("#baseCursor0").html("<img src=\"images/topnews.cursor1.gif\">");
	}
	if (id == 3){
		$("#baseCursor1").html("<img src=\"images/topnews.cursor1.gif\">");
	}
	
	$("#baseContent"+id).slideDown("slow");
}

function changeTopblogs(id) {
	var old=id?0:1;
	
	$("#topblogsTd"+old).css("background-image", "url(images/grad4.png)");
	$("#topblogsLink"+old).removeClass("white");
	$("#topblogsLink"+old).addClass("main");
	$("#topblogsCursor"+old).html("");
	$("#topblogsContent"+old).slideUp("slow");
	
	$("#topblogsTd"+id).css("background-image", "url(images/grad3.png)");
	$("#topblogsLink"+id).addClass("white");
	$("#topblogsCursor"+id).html("<img src=\"images/topnews.cursor.gif\">");
	$("#topblogsContent"+id).slideDown("slow");
}

var grad = ["red","grn","org","pnk"];
function changePrj(id) {
	for(var i=0;i<4;i++) {
		$("#pl"+i).css('background-image', 'url(images/grad.'+grad[i]+'.png)');
		$("#cpl"+i).removeClass('black');
		$("#cpl"+i).addClass('white');
	}

	$("#pl"+id).css('background-image', 'url(images/grad.white.png)');
	$("#cpl"+id).removeClass('white');
	$("#cpl"+id).addClass('black');
	$("#prjContainer").css("height", $("#prjContent"+id).height());
	
	for(var i=0;i<4;i++) {
		$("#prjContent"+i).fadeOut("slow");
		$("#prjCursor"+i).html("");
	}
	
	$("#prjContent"+id).fadeIn("slow");
	$("#prjCursor"+id).html("<img src=\"images/prj.cursor.gif\">");
	
	if(id == 0){
		$("#autoshop").show();
	}else{
		$("#autoshop").hide();
	}
}

function changeDayBlock(id) {
	var old=id?0:1;
	
	$("#dayBlockTd"+old).css("background-image", "url(images/grad4.png)");
	$("#dayBlockLink"+old).removeClass("white");
	$("#dayBlockLink"+old).addClass("main");
	$("#dayBlockCursor"+old).html("");
	$("#dayBlockContent"+old).slideUp("slow");
	
	$("#dayBlockTd"+id).css("background-image", "url(images/grad3.png)");
	$("#dayBlockLink"+id).addClass("white");
	$("#dayBlockCursor"+id).html("<img src=\"images/topnews.cursor.gif\">");
	$("#dayBlockContent"+id).slideDown("slow");
}

function changeTopblogs(id) {
	var old=id?0:1;
	
	$("#topblogsTd"+old).css("background-image", "url(images/grad4.png)");
	$("#topblogsLink"+old).removeClass("white");
	$("#topblogsLink"+old).addClass("main");
	$("#topblogsCursor"+old).html("");
	$("#topblogsContent"+old).slideUp("slow");
	
	$("#topblogsTd"+id).css("background-image", "url(images/grad3.png)");
	$("#topblogsLink"+id).addClass("white");
	$("#topblogsCursor"+id).html("<img src=\"images/topnews.cursor.gif\">");
	$("#topblogsContent"+id).slideDown("slow");
}
