var dvepopWinMedia;
var dvepopWinMedia2;
var dvepopWinMedia2ex;


/* **** NATIVE AJAX *** */

function testme(url){
    loadurl(url);
}
function loadurl(url) {
    try {
        xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
    } catch(e) {
        // alert("Sorry, your browser does not support AJAX");
    }
    
    /*
    // asyncron mit triggrr
    xmlhttp.onreadystatechange = triggered;
    xmlhttp.open("GET", url,true);
    xmlhttp.send(null);
    */
    
    // syncron
    xmlhttp.open("GET", url,false);   
    xmlhttp.send();
    return xmlhttp.responseText;
}
function triggered() {
    if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
        text = xmlhttp.responseText;
        dynamicsizes = text
        // Code to execute 'text'
    }
}

/* **** NATIVE AJAX *** */



function openMediaVDBpopup(xlink, width, height, dynamic){
  if(dvepopWinMedia){
       if(false == dvepopWinMedia.closed){
          dvepopWinMedia.close();
       }      
   }
   if(dynamic){
   /*
      dynamic = loadurl(dynamic);
      tmp = dynamic.split('x');
      if(tmp[0] &&  tmp[1] ){
        width  = tmp[0];
        height = tmp[1];
      }
    */
   }
   dvepopWinMedia = window.open(xlink, 'popup', "width=" + width + ",height=" + height + ",fullscreen=no,location=no,menubar=no,status=no,scrollbars=yes,resizable=yes,titlebar=yes");
   dvepopWinMedia.focus();
   return false;
}




function openCEpopup(xlink, width, height){
  if(dvepopWinMedia2){
       if(false == dvepopWinMedia2.closed){
          dvepopWinMedia2.close();
       }      
   }
   dvepopWinMedia2 = window.open(xlink, 'popup', "width=" + width + ",height=" + height + ",fullscreen=no,location=no,menubar=no,status=no,scrollbars=yes,resizable=yes,titlebar=yes");
   dvepopWinMedia2.focus();
   return false;
}


function openCEpopupEx(xlink, width, height){
  if(dvepopWinMedia2ex){
       if(false == dvepopWinMedia2ex.closed){
          //dvepopWinMedia2ex.close();
       }      
   }
   
   dvepopWinMedia2ex = window.open(xlink, 'popup2', "width=" + width + ",height=" + height + ",fullscreen=no,location=no,menubar=no,status=no,scrollbars=yes,resizable=yes,titlebar=yes");
   dvepopWinMedia2ex.focus();
   return false;
}



