function jah(url,target) {
    // native XMLHttpRequest object
    document.getElementById(target).innerHTML = "<img src='/images/products/cocreate/campaigns/explicit-images/25-0.gif' />";
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = function() {jahDone(target);};
        req.open("GET", url, true);
        req.send(null);
    // IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = function() {jahDone(target);};
            req.open("GET", url, true);
            req.send();
        }
    }
}    

function jahDone(target) {
    // only if req is "loaded"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
            results = req.responseText;
            killMain();
			document.getElementById(target).innerHTML = results;
			
        } else {
            document.getElementById(target).innerHTML="Error:\n" +
                req.statusText;
        }
    }
}

function killMain(){
	
	document.getElementById('mainContent').style.display="none";
	
}

function showMain(){
	document.getElementById('loadedContent').innerHTML='';
	document.getElementById('mainContent').style.display="block";
	
}

/* Opens links that are imported via Ajax in a new window.
 * can't use rel=external because that gets loaded before 
 * secondary content.
 */
function openNew(path){
	window.open(path);	
}


