menu_status = new Array(); 

function doSaveAs(filename){
	if (document.execCommand){
		document.execCommand("SaveAs",1,filename)
	}
	else {
		alert("Save-feature available only in Internet Exlorer 5.x.")
	}
}

function doPrint(){
	
	print();
	
}

function showHide(theid){
    if (document.getElementById) {
    var switch_id = document.getElementById(theid);

        if(menu_status[theid] != 'show') {
           switch_id.className = 'show';
           menu_status[theid] = 'show';
        }else{
           switch_id.className = 'hide';
           menu_status[theid] = 'hide';
        }
    }
}


function NewWindow(myPage, myName, Width, Height, Scroll, Resizable, Menubar) {
    var winTop = ((screen.height - Height) / 2);
    var winLeft= ((screen.width - Width) / 2);
    winProps = 'top=' +winTop+ ',left=' +winLeft+ ',height=' +Height+ ',width=' +Width+ ',Scrollbars=' +Scroll+ ',menubar=' +Menubar+ ',Resizable=' +Resizable+ ';'
    Win = window.open(myPage, myName, winProps);

        if (parseInt(navigator.appVersion) >= 4) {
            Win.window.focus(); //set focus to the window
        }
}


function currency(ZAR){
	
	// remove any commas
	ZAR = ZAR.replace(/,/g,"");
	NewWindow('convert-currency.php?ZAR='+ZAR,'Currency',400,210,'yes','yes','yes');	
}