function Display(table1,table2) {
	if (table2.style.display=="none"){      
    	table1.style.display="none";
     	table2.style.display=""; 
 	}
}

function display_table(table1,table2) {
	if (table2.style.display=="none") {     
    	table1.style.display="none";
     	table2.style.display=""; 
	}
}

function show_hide(id) {
        	var div = document.getElementById('item'+id);
	div.style.display = div.style.display=='none'?'':'none';
}


function showtitle(id) {
	var div = document.getElementById('title'+id);
	var img = document.getElementById('icon'+id);
	
	var showing = ( img.src.indexOf("plus") > 0 ); 
	div.style.display = div.style.display=='none'?'':'none';
	img.src = showing ? '../../images/minus.gif'  : '../../images/plus.gif';
}

function showmonth(id) {
	var div = document.getElementById('month'+id);
	var img = document.getElementById('micon'+id);
	
	var showing = ( img.src.indexOf("plus") > 0 ); 
	div.style.display = div.style.display=='none'?'':'none';
	img.src = showing ? '../../images/minus.gif'  : '../../images/plus.gif';
}

function showChart2(pubcoid) {
	chartwindow = window.open('../IR_Website/org_chart_IR.asp?pubcoid=' + pubcoid, '', 'width=800, height=600, resizable=yes, scrollbars=yes');
}

function showContactMap() {
	strucwindow = window.open('../IR_Website/location_map.asp', '','width=800, height=600, resizable=yes, scrollbars=yes');
}

function showcorpstruc() {
	strucwindow = window.open('../IR_Website/group_struc.asp', '','width=800, height=600, resizable=yes');
}

function showcorpstruc2(pubcoid) {
	strucwindow = window.open('../IR_Website/group_struc_IR.asp?pubcoid=' + pubcoid, '','width=800, height=600, resizable=yes');
}


function showhelp() {
	helpwindow = window.open('../IR_Website/trackme_help.asp', '', 'width=220, height=130');
}


function showadhelp() {
	helpwindow = window.open('../CMS/ad_help.asp', '', 'width=220, height=120');
}


function showsubfol(id) {
	var div = document.getElementById('folder'+id);
	var img = document.getElementById('icon'+id);
        	
	var showing = ( img.src.indexOf("plus") > 0 ); 

	div.style.display = div.style.display=='none'?'':'none';
	img.src = showing ? '../../images/minus.gif'  : '../../images/plus.gif';      	
}


function showevent(id) {
	var div = document.getElementById('e'+id);
	div.style.display = 'block';
}


function showMediaPic(url,title) {
	chartwindow = window.open('../IR_Website/media_pic_detail.asp?url=' + url + '&title=' + title, '', 'width=800, height=600, resizable=yes');
}


function showNewsPic(url,title) {
	chartwindow = window.open('../Berhadnet_Homesite/news_pic_detail.asp?url=' + url + '&title=' + title, '', 'width=800, height=600, resizable=yes');
}

function showOrgChart() {
	strucwindow = window.open('../IR_Website/Org_Chart_Pic.asp', '','width=800, height=600, resizable=yes');
}


function show_subs(id) {
	var div = document.getElementById('sub'+id);
	div.style.display = div.style.display=='none'?'':'none';
}

function hideevent(id) {
	var div = document.getElementById('e'+id);
	div.style.display = 'none';
}


function swapform(id) {
	document.getElementById('form1').style.display = 'none';
  	document.getElementById('form2').style.display = 'none';
  	document.getElementById('form'+id).style.display = 'block';
}


function cleardates(datebox) {
	if (datebox.value=="") {
		datebox.value="Please Use Calendar";
	} else {
		if (confirm("Clear date?")) {datebox.value=""};
	}
}


function imgaction() {
	document.frm.action = '../CFO_Info/cc_folder1.asp';
	document.frm.submit();
}


function view() {
	document.frm.action = 'cv_mohdabdullah.asp';
	document.frm.submit();

}


function show_content(id) {
	var div = document.getElementById('result'+id);
	div.style.display = div.style.display=='none'?'':'none';
	
}

function showpath(){
   document.frm.action='berhad_links_edit.asp';
   document.frm.submit();
}


function showCalendarEvent(){
   document.frm.action='../CMS/calendar_event.asp';
   document.frm.submit();

}


function delete_confirm() {
	var a = confirm("Are you sure you want to delele this file?")

	if (a == true)
	{
		//delete
	}
	else
	{
		//do not delete
	}
}

function showcontactdetail(){
document.frm.action='../CMS/contact_detail.asp';
   document.frm.submit();

}

function showblogs(){
document.frm.action='../CMS/blog_view_abu.asp';
   document.frm.submit();

}

function editblog(){
document.frm.action='../CMS/blog_view_abu_content_edit.asp';
   document.frm.submit();

}
function blogcontent(){
document.frm.action='../CMS/blog_view_abu_content.asp';
   document.frm.submit();

}

function viewforum(){
   document.frm.action='../CMS/bhd_forum_view.asp';
   document.frm.submit();

}

function viewcontent(){
   document.frm.action='../CMS/forum_management_view.asp';
   document.frm.submit();
}


function showdir(){
 document.frm.action='../CMS/director_edit.asp';
 document.frm.submit();
}


function edittopic(){
 	document.frm.action='../CMS/forum_management_edittopic.asp';
 	document.frm.submit();
}


function editcontact(){
 	document.frm.action='../CMS/contact_edit.asp';
 	document.frm.submit();
}


function editmember(){
 	document.frm.action='../CMS/membermgnt_edit.asp';
 	document.frm.submit();
}


function viewmember(){
	document.frm.action='../CMS/membermgnt_detail.asp';
 	document.frm.submit();
}

	
function compselect(id) {
	document.getElementById('1').style.display = 'block';

}


function pubselect(id) {
	document.getElementById('1').style.display = 'none';
}

function viewmember()
{
	document.frm.action='../CMS/membermgnt_detail.asp';
 	document.frm.submit();
}

function getselection() {
	var i=0;
	var selectedItem;
	var selectedText;
	var selectedValue;
	var newoption;

	for (i = 0; i < frm.product.length; i++) {
		if (frm.product.options[i].selected == 1) {
			selectedItem = document.frm.product.selectedIndex; 
			selectedText = document.frm.product.options[selectedItem].text;
			selectedValue = document.frm.product.options[selectedItem].value;

			newoption = new Option(selectedText, selectedValue, false, false);
			document.frm.prodselected.options[i] = newoption;
		}
	}	
}

function removeselection() {
	var boxLength = document.frm.prodselected.length;
	
	arrSelected = new Array();

	var count = 0;
	for (i = 0; i < boxLength; i++) {
		if (document.frm.prodselected.options[i].selected)
		 {
			arrSelected[count] = document.frm.prodselected.options[i].value;
			}
		count++;
	}
	var x;
	
	for (i = 0; i < boxLength; i++) {
		for (x = 0; x < arrSelected.length; x++) {
			if (document.frm.prodselected.options[i].value == arrSelected[x]) {
				document.frm.prodselected.options[i] = null;
			}
		}
		boxLength = document.frm.prodselected.length;
	}
}


function addnewcomp() {
	newwindow = window.open('../CMS/add_new_company.asp', '','width=350, height=180, resizable=no');
}

function editprod() {
	newwindow = window.open('../CMS/edit_product.asp', '', 'width=350, height=180, resizable=no');
}