function bojax(url, container) {
    var req = false;
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
    } else {
        alert("Your browser does not support Ajax.");
        return false;
    }

    req.onreadystatechange = function() {
        loadPage(req, container)
    }
    req.open('GET', url, true)
    req.send(null)
}
function loadPage(req, container) {
    if (req.readyState == 4 && req.status == 200) {
        document.getElementById(container).innerHTML = req.responseText;
    }
}
function loadPWRC() {
	bojax('http://test.exheat.com/show_html.php?show_html=pwrc', 'create-account');
}
function loadCANA() {
	bojax('http://test.exheat.com/show_html.php?show_html=cana', 'create-account');
}
function loadflag(country) {
	document.getElementById("cute-flag").innerHTML="<img src=\"_img/_flags/" + country + ".png\" class=\"flag-border\" />";
}
function goBpage(brochure,page) {
	bojax("http://test.exheat.com/download-brochure-pages.php?b=" + brochure + "&p=" + page, "brochure-preview");
}

function startUpload(){
 document.getElementById('upload_process').style.visibility = 'visible';
 return true;
}

function stopUpload(success,file){
var result = '';
 if (success == 1){
  document.getElementById('upload_process').innerHTML = 'Your CV has been sent, <a href=\"_uploads/' + file + '\">' + file + '</a>';
 }
 if(success == 2){
  document.getElementById('upload_process').innerHTML = 'The file must be a <strong>.docx</strong> / <strong>.doc</strong> / <strong>.rtf</strong> / <strong>.pdf</strong>';
 }
 if(success == 0){
  document.getElementById('upload_process').innerHTML = 'There was an error during file upload, the web admin has been notified';
 }
 return true;
}

function submitENQ(){
	var email = document.getElementById('email').value;
	var uri = document.getElementById('uri').value;
	var safe = 'http://www.exheat.it/product-interest-it.php?email=' + email + '&uri=' + uri;

    bojax(safe,'enquiry');
}