﻿// JavaScript Document

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

var old_dispTime = new Array()
function dispTime(a){
	if( old_dispTime[a] == 'open' ) {
		document.all(a).style.display='none';
		old_dispTime[a] = ''
	}else{
		document.all(a).style.display='inline';
		old_dispTime[a] = 'open'
	}
}

function delPost(a,b,c){
	delpostconfirm = confirm ("Are you sure?")
	if (delpostconfirm) {
		location.href = 'postDelExe.asp?p_idx='+a+'&page='+b+'&postFrom='+c
	}
}
function checkkeycode(a){
	if((a.keyCode > 32 && a.keyCode < 48) || (a.keyCode > 57 && a.keyCode < 65)||(a.keyCode > 90 && a.keyCode < 97)){
		a.returnValue = false;
		alert("You can't use special character!");
	}
}

// Mail Check
function ValidateEmail(theinput){
	s = theinput
	if(s.search){
		return (s.search(new RegExp("^([-!#$%&'*+./0-9=?A-Z^_`a-z{|}~])+@([-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+\\.)+[a-zA-Z]{2,4}$","gi"))>=0)
	}
	if(s.indexOf){
		at_character=s.indexOf('@')
		if(at_character<=0 || at_character+4>s.length)
			return false
	}
	if(s.length<6)
		return false
	else
		return true
}


// Expand Post
function postExpand(a,b){
	document.all(a).style.display='inline';
	document.all(b).style.display='none';
}
function hiddenMenu(a,b,c){
	if (b == 'over'){
			document.all(a).style.display='inline';
			document.all(c).GotoFrame(1);
	}else{
			document.all(a).style.display='none';
			document.all(c).GotoFrame(0);
	}
}
function delReply(a,b){
	if (b == 'over'){
			document.all(a).style.display='inline';
	}else{
			document.all(a).style.display='none';
	}
}

function showDelForm(a,b,c){
	for(i=1;i<=c;i++){
		document.all("delForm"+i).style.display='none';
		document.all("formDelCmt"+i).c_pwd.value = "";
		document.all("commentDelExe"+i).style.display="none"
	}
	document.all(a).style.display='inline';
	resizeFrame(b)
}

function categoryChange(targ,selObj,restore,a,b,c){ //v3.0if 
	if (a == "new"){
		if (selObj.options[selObj.selectedIndex].value == 2) {
			parent.location.href = "composePhoto.asp?composeType=new"
		}
	}
	if (a == "modify"){
		if (selObj.options[selObj.selectedIndex].value == 2) {
			parent.location.href = "composePhoto.asp?composeType=modify&p_idx="+b+"&page="+c
		}
	}
}
function categoryChange2(targ,selObj,restore,a,b,c){ //v3.0if 
	if (a == "new"){
			parent.location.href = "compose.asp?composeType=new&selectedCategoty="+selObj.options[selObj.selectedIndex].value
	}
	if (a == "modify"){
			parent.location.href = "compose.asp?composeType=modify&p_idx="+b+"&selectedCategoty="+selObj.options[selObj.selectedIndex].value+"&page="+c
	}
}
function delCmtAdm(){
	alert('d')
}