// JavaScript Document

<!--
/*function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function del_content() {
	//document.dfrm.submit();
	chk_len = document.dfrm.chk.length;
	chkVal = "";
	for(i=0;i<chk_len;i++) {
		if(document.dfrm.chk[i].checked==true) {
			chkVal = chkVal + document.dfrm.chk[i].value+",";
		}
	}
	
	if(chkVal=="") {
		alert("Please select any one to delete.");
	} else {
		if(confirm("Do you really want to delete it?")) {
			document.dfrm.chk_value.value = chkVal;
			document.dfrm.action='controller/del_ctl.php';
			document.dfrm.submit();
		}
	}
}

function publish_content() {
	chk_len = document.dfrm.chk.length;
	chkVal = "";
	for(i=0;i<chk_len;i++) {
		if(document.dfrm.chk[i].checked==true) {
			chkVal = chkVal + document.dfrm.chk[i].value+",";
		}
	}
	
	if(chkVal=="") {
		alert("Please select any one to publish.");
	} else {
		if(confirm("Do you really want to publish it?")) {
			document.dfrm.chk_value.value = chkVal;
			document.dfrm.action='controller/tstatus.php';
			document.dfrm.submit();
		}
	}
}

function unpublish_content() {
	chk_len = document.dfrm.chk.length;
	chkVal = "";
	for(i=0;i<chk_len;i++) {
		if(document.dfrm.chk[i].checked==true) {
			chkVal = chkVal + document.dfrm.chk[i].value+",";
		}
	}
	
	if(chkVal=="") {
		alert("Please select any one to unpublish.");
	} else {
		if(confirm("Do you really want to unpublish it?")) {
			document.dfrm.chk_value.value = chkVal;
			document.dfrm.action='controller/tstatus2.php';
			document.dfrm.submit();
		}
	}
}*/
//-->
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function del_rcd(pid) {
		if(confirm("Do you really want to delete it?")) {
			window.location = 'controller/del_cat.php?pid='+pid
		}
	}
function del_content() {
	

	
	chk_len = document.dfrm.chk.length;
	if(chk_len==undefined) {
		chk_len=1;
		chkVal = "";
		if(document.dfrm.chk.checked==true) {
			chkVal = chkVal + document.dfrm.chk.value+",";
		}
	} else {
		chkVal = "";
		for(i=0;i<chk_len;i++) {
			if(document.dfrm.chk[i].checked==true) {
				chkVal = chkVal + document.dfrm.chk[i].value+",";
			}
		}
	}
	
	if(chkVal=="") {
		alert("Please select an item to delete.");
	} else {
		if(confirm("Do you really want to delete it?")) {
			document.dfrm.chk_value.value = chkVal;
			document.dfrm.action='controller/del_ctl.php';
			document.dfrm.submit();
		}
	}
}
function publish_content() {
	chk_len = document.dfrm.chk.length;
	if(chk_len==undefined) {
		chk_len=1;
		chkVal = "";
		if(document.dfrm.chk.checked==true) {
			chkVal = chkVal + document.dfrm.chk.value+",";
		}
	} else {
		chkVal = "";
		for(i=0;i<chk_len;i++) {
			if(document.dfrm.chk[i].checked==true) {
				chkVal = chkVal + document.dfrm.chk[i].value+",";
			}
		}
	}
	if(chkVal=="") {
		alert("Please select an item to publish.");
	} else {
		if(confirm("Do you really want to publish it?")) {
			document.dfrm.chk_value.value = chkVal;
			document.dfrm.action='controller/tstatus.php';
			document.dfrm.submit();
		}
	}
}

function terminate_content() {
	chk_len = document.dfrm.chk.length;
	if(chk_len==undefined) {
		chk_len=1;
		chkVal = "";
		if(document.dfrm.chk.checked==true) {
			chkVal = chkVal + document.dfrm.chk.value+",";
		}
	} else {
		chkVal = "";
		for(i=0;i<chk_len;i++) {
			if(document.dfrm.chk[i].checked==true) {
				chkVal = chkVal + document.dfrm.chk[i].value+",";
			}
		}
	}
		if(chkVal=="") {
			alert("Please select an item to Terminate");
		} else {
			if(confirm("Do you really want to Terminate it?")) {
				document.dfrm.chk_value.value = chkVal;
				document.dfrm.action='controller/tstatus2.php';
				document.dfrm.submit();
			}
		}
}

function suspend_content() {
	chk_len = document.dfrm.chk.length;
	if(chk_len==undefined) {
		chk_len=1;
		chkVal = "";
		if(document.dfrm.chk.checked==true) {
			chkVal = chkVal + document.dfrm.chk.value+",";
		}
	} else {
		chkVal = "";
		for(i=0;i<chk_len;i++) {
			if(document.dfrm.chk[i].checked==true) {
				chkVal = chkVal + document.dfrm.chk[i].value+",";
			}
		}
	}
		if(chkVal=="") {
			alert("Please select an item to Suspend");
		} else {
			if(confirm("Do you really want to suspend it?")) {
				document.dfrm.chk_value.value = chkVal;
				document.dfrm.action='controller/tstatus4.php';
				document.dfrm.submit();
			}
		}
}
//-->


	function checkAll() {
	
		if(document.getElementById("chkall").checked==true) {
			
			flag = true;
			
		} else {
			
			flag = false;
			
		} 
		
		//alert(flag);
		
		chk_len = document.dfrm.chk.length;
		
		if(chk_len==undefined) {
		
			document.dfrm.chk.checked=flag
			
		} else {
			
			chkVal = "";
			for(i=0;i<chk_len;i++) {
				
				
				document.dfrm.chk[i].checked=flag;
				
			} //for
		}  //else
		
		
		
		
	} //function