function focus_on1(str) {
	(str).style.border='1px solid #7D7D7D';
	(str).style.background='#ffffff';
}

function focus_off1(str) {
	(str).style.border='1px solid #cdcdcd';
	(str).style.background='#ffffff';
}



function add() {
	var change = false;
	for (var i = 1; i < 5; i++) {
		var obj = document.getElementById("filediv" + i);
		if (obj != null) {
			if (obj.style.display == "none") {
				obj.style.display = "block";
				change = true;
				break;
			}
		}
	}
	if (change == false) {
		alert("파일을 더 이상 추가 할 수 없습니다.");
	}
}
function del(index) {
	var fileobj = document.getElementById("upload" + index);
	var divobj = document.getElementById("filediv" + index);
	fileobj.outerHTML = fileobj.outerHTML;
	divobj.style.display = "none";
}


//PNG 투명
var clear="/content/board/nninc_simple/img/clear.gif" //path to clear.gif

pngfix=function(){var els=document.getElementsByTagName('*');var ip=/\.png/i;var i=els.length;while(i-- >0){var el=els[i];var es=el.style;if(el.src&&el.src.match(ip)&&!es.filter){es.height=el.height;es.width=el.width;es.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+el.src+"',sizingMethod='crop')";el.src=clear;}else{var elb=el.currentStyle.backgroundImage;if(elb.match(ip)){var path=elb.split('"');var rep=(el.currentStyle.backgroundRepeat=='no-repeat')?'crop':'scale';es.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+path[1]+"',sizingMethod='"+rep+"')";es.height=el.clientHeight+'px';es.backgroundImage='none';var elkids=el.getElementsByTagName('*');if (elkids){var j=elkids.length;if(el.currentStyle.position!="absolute")es.position='static';while (j-- >0)if(!elkids[j].style.position)elkids[j].style.position="relative";}}}}}
window.attachEvent('onload',pngfix);


//새창
function win_popup2(sun,idx,vscrollbars,vtoolbar,vmenubar,vlocation,vwidth,vheight){	
	alert("aaa");
	window.open('/content/poll/view.php?sun='+sun+'&poq_idx='+idx,'','scrollbars='+vscrollbars+',toolbar='+vtoolbar+',menubar='+vmenubar+',location='+vlocation+',width='+vwidth+',height='+vheight+',location=no');
}
