<!--//

function PopUpWindow(URL, N, W, H, S) { // name, width, height, scrollbars
	var winleft	=	(screen.width - W) / 2;
	var winup	=	(screen.height - H) / 2;
	winProp		=	'width='+W+',height='+H+',left='+winleft+',top='+winup+',scrollbars='+S+',resizable' + ',status=yes'
	Win			=	window.open(URL, N, winProp)
	if (parseInt(navigator.appVersion) >= 4) { Win.window.focus(); }
}




//-------------- Admin --------------//
function ContentEdit(URL) {
  PopUpWindow(URL,'TAPB1',778,600,'yes');
}

function delPositon(URL)
{
	if(confirm('ยกเลิกการรับสมัครตำแหน่งนี้'))
		PopUpWindow(URL,'TAPB1',300,200,'no');
	return;
}
function openPositon(URL)
{
	PopUpWindow(URL,'TAPB1',300,200,'no');
	return;
}
function editPositon(URL)
{
	PopUpWindow(URL,'TAPB10',650,550,'no');
	return;
}

function ContentDel(URL) {
  PopUpWindow(URL,'TAPB2',500,200,'no');
}

function ContentActive(URL) {
  PopUpWindow(URL,'TAPB3',500,200,'no');
}


function InsertDateShow() {	
	var strContentDate = document.cm_form.content_date.value;
	var arrContentDate = strContentDate.split("/");
	var strContentDateStart = strContentDate;
	var strContentDateStop = "";
	var strContentDateStopHilight = "";
	var intContentYear = parseFloat(arrContentDate[2]) + 10;
	var intContentMonthHilight = parseFloat(arrContentDate[1]) + 3;
	var intContentYearHilightFix = parseFloat(arrContentDate[2]) + 1;
	var intContentYearHilight = parseFloat(arrContentDate[2]);
	
	if (intContentYear > 0) {
		strContentDateStop = arrContentDate[0] + "/" + arrContentDate[1] + "/" + intContentYear;

		if (intContentMonthHilight > 12) {
			intContentMonthHilight = intContentMonthHilight - 12;
			intContentYearHilight = intContentYearHilightFix;
		}
		if (intContentMonthHilight < 10) {
			intContentMonthHilight = "0" + intContentMonthHilight;
		}
		strContentDateStopHilight = arrContentDate[0] + "/" + intContentMonthHilight + "/" + intContentYearHilight;
	}	

	document.cm_form.content_date_start.value = strContentDateStart;
	document.cm_form.content_date_stop.value = strContentDateStop;

	document.cm_form.content_date_start_hilight.value = strContentDateStart;
	document.cm_form.content_date_stop_hilight.value = strContentDateStopHilight;
}

//-------------- / Admin --------------//







//-------------- Web --------------//
function PressReleaseView(URL) {
  PopUpWindow(URL,'TAPB4',620,600,'yes');
}

function TvcView(URL) {
  PopUpWindow(URL,'TAPB5',620,500,'yes');
}

function PrintAdsView(URL) {
  PopUpWindow(URL,'TAPB6',620,600,'yes');
}

function CompanyProfileView(URL) {
  PopUpWindow(URL,'TAPB7',860,600,'yes');
}
//-------------- / Web --------------//




function jumpMenu(targ,selObj,restore){   
	if (selObj.options[selObj.selectedIndex].value != "") {
		eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
		if (restore) selObj.selectedIndex=0;
	}
}



function Check_All(){
	for (var i=0;i<frm.elements.length;i++) {
		var e=frm.elements[i];
		if ((e.name != 'allbox') && (e.type=='checkbox')) {
			e.checked=frm.allbox.checked;
		}
	}
}



//-->