/**
 * body 태그의 onload 이벤트에 들어갈 이벤트 핸들러
 */
function documentprocess_onload() {
	classprocess_ext();
	classprocess_imageframeclick();
	classprocess_imageframeclickdialog();
	classprocess_imageresizemobile();
}

/**
 * ext 클래스를 가진 a 태그에 대해 target을 blank 를 지정해줌. XHTML 1.1 을 위함
 * JQuery 용 스크립트
 */
function classprocess_ext() {
	$('a.ext').filter(function (index) {
		return this.target == "";
	}).attr('target', '_blank');
/*
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i = 0; i < anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("class") == "ext") {
			anchor.target = "_blank";
		}
	}
*/
}

/**
 * imageframeclick 클래스를 가진 img 태그에 대해 클릭시 새 창으로 해당 이미지를 보여주는 스크립트를 넣어줌.
 * JQuery 용 스크립트
 */
function classprocess_imageframeclick() {
	$('img.imageframeclick').filter(function (index) {
		return this.title.length == 0;
	}).attr('title', '클릭하시면 큰 이미지를 보실 수 있습니다.')

	$('img.imageframeclick').click(function(){ window.open(this.src); return false;});
}

function classprocess_imageframeclickdialog() {
	$('img.imageframeclickdialog').filter(function (index) {
		return this.title.length == 0;
	}).attr('title', '클릭하시면 대화창에서 큰 이미지를 보실 수 있습니다.')

	$('img.imageframeclickdialog').click(function(){
		click_imageframeclickdialog(this);
		return false;
	});
}



/**
 * m.solanara.net 으로 접속한 경우 imageresizemobile 클래스를 가진 img 태그에 대해 이미지 크기를 줄이고, 클릭시 새 창으로 해당 이미지를 보여주는 스크립트를 넣어줌.
 * JQuery 용 스크립트
 */
function classprocess_imageresizemobile() {
	if (window.location.hostname.indexOf("m.solanara.net") >= 0) {
		$('img.imageresizemobile').filter(function (index) {
			return this.title.length == 0;
		}).attr({
			title: "클릭하시면 큰 이미지를 보실 수 있습니다.",
			width: "100"
		});

		$('img.imageresizemobile').click(function(){ window.open(this.src); return false;});
	}
}
