function launchNews(news_id){
    var newsBox = window.open('/news.php?n='+news_id, 'nBox', 'width=800,height=600,scrollbars=yes');
    newsBox.focus();
}

function launchVideoPlayer(vident){
    var vBox = window.open('/cnbc_partner.php?vident='+vident, 'vidBox', 'width=800,height=432,scrollbars=no');
    vBox.focus();
}

function confDel(){
    if(confirm("Are you sure you wish to delete this system?")){
        return true;
    }
    else{
        return false;
    }
}

function addNewSystem(){
    if(document.getElementById('addNewBox').style.display == 'none'){
        document.getElementById('addNewBox').style.display = 'block';
    }
    else{
        document.getElementById('addNewBox').style.display = 'none';
    }
}

function protEmail(dept){
    document.write('<a href="mailto:'+dept+'@vaz'+'uresfx.com">'+dept+'@vaz'+'uresfx.com</a>');
}

function hideFund(fund_id){
    document.getElementById('fund_more_'+fund_id).style.display = 'none';
    document.getElementById('fund_hide_'+fund_id).style.display = 'none';
    document.getElementById('fund_unhide_'+fund_id).style.display = 'inline-block';
    document.getElementById('fund_title_'+fund_id).className = 'fund_title_hidden';
    ajaxHideFund(fund_id);
}

function unhideFund(fund_id){
    document.getElementById('fund_more_'+fund_id).style.display = 'block';
    document.getElementById('fund_hide_'+fund_id).style.display = 'inline-block';
    document.getElementById('fund_unhide_'+fund_id).style.display = 'none';
    document.getElementById('fund_title_'+fund_id).className = 'fund_title_normal';
    ajaxShowFund(fund_id);
}

function ajaxHideFund(account_id){
    var randnum1 = Math.floor(Math.random()*1000000);

    xmlhttp.open("GET", "/ajax_functions.php?r="+randnum1+"&a=hide_fund&acc="+account_id, true);
    
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) {
            //alert(xmlhttp.responseText);
        }
    }
    
    xmlhttp.send(null);
}

function ajaxShowFund(account_id){
    var randnum1 = Math.floor(Math.random()*1000000);

    xmlhttp.open("GET", "/ajax_functions.php?r="+randnum1+"&a=show_fund&acc="+account_id, true);
    
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) {
            //alert(xmlhttp.responseText);
        }
    }
    
    xmlhttp.send(null);
}

// Ajax functions
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
