// JavaScript Document

function setColor( elements, id, type, color){
	var errCount = 0;
	if( color.length == 6){
		for( i=0; i <= elements; i++){
			var ojb = window.opener.document.getElementById( id+"_"+i);
			if(ojb != null){
				//alert(id+"_"+i);
				if( type == "0"){
					ojb.style.backgroundColor="#"+color;	// ?w?i?F
				}else if( type == "1"){
					ojb.style.color="#"+color;	// ?????F
				}
				errCount=0;
			}else{
				// ??????null?????G???[?J?E???g??+1????
				errCount++;
				if( errCount==10){
					return;
				}
			}
		}
	}
}

function setInitColor( elements, id, type, color){
	var errCount = 0;
	for( index=0; index < id.length; index++){
		for( i=0; i <= elements; i++){
			var ojb = document.getElementById( id[index]+"_"+i);
			if(ojb != null){
//				alert(id[index]+"_"+type[index]+"_"+color[index]);
				if( type[index] == "0"){
					if( +color[index] != ""){
						ojb.style.backgroundColor="#"+color[index];	// ?w?i?F
					}
				}else if( type[index] == "1"){
					if( +color[index] != ""){
						ojb.style.color="#"+color[index];	// ?????F
					}
				}else if( type[index] == "2"){
					if( document.getElementById("A_TT") != null){
						if(color[index] != "0"){
							document.getElementById("A_TT").style.display='';
						}else{
							document.getElementById("A_TT").style.display='none';
						}
					}
				}
				errCount=0;
			}else{
				errCount++;
				if( errCount==10){
					break;
				}
			}
		}
	}
}

// ??????????????
function setInitColor2( flg, elements, id, type, color ){
	var errCount = 0;
	for( index=0; index < id.length; index++){
		for( i=0; i <= elements; i++){
			var ojb = document.getElementById( id[index]+"_"+i);
			if(ojb != null){
				if( type[index] == "0"){
					if( +color[index] != ""){
						ojb.style.backgroundColor="#"+color[index];
					}
				}else if( type[index] == "1"){
					if( +color[index] != ""){
						ojb.style.color="#"+color[index];
					}
				}else if( type[index] == "2"){
					if( document.getElementById("A_TT") != null){
						if(color[index] != "0"){
							document.getElementById("A_TT").style.display='';
						}else{
							if( flg != "1" ){
								document.getElementById("A_TT").style.display='none';
							}
							else{
								document.getElementById("A_TT").style.display='';
							}							
						}
					}
				}
				errCount=0;
			}else{
				errCount++;
				if( errCount==10){
					break;
				}
			}
		}
	}
}

function c007PlanNameBorder(){
	// ?K??C_TH_0???F???K?p??????
	var ojb = window.opener.document.getElementById( "C_TT");
	ojb.style.borderColor=window.opener.document.getElementById( "C_TH_0").style.backgroundColor;
}


function a003PlanNameBorder(){
	// ?K??C_TH_0???F???K?p??????
	var ojb = document.getElementById( "C_TT");
	ojb.style.borderColor=document.getElementById( "C_TH_0").style.backgroundColor;
}


