function checkSecurity() {
   var DocumentLocation = "";
   var isHttps;
   var vUrl;
   var vMap;
   var vFirstPage;
   var vTransferTo;
   var vBegin;
   var vEnd;
   var v;
   DocumentLocation = top.document.location.toString();
   isHttps = false;
   vFirstPage = "index.html";
   vBegin = DocumentLocation.indexOf("//") + 2;
   vEnd = DocumentLocation.indexOf("/",vBegin);
   
   vUrl = DocumentLocation.substring(vBegin,vEnd);
   
   vMap = "v.o"; /*** constant for Vomela *****/

   if (vUrl.indexOf("dev")>=0){
     vTransferTo = "http://";
   }
   else
     vTransferTo = "https://";
      
   vTransferTo = vTransferTo + vUrl + "/" + vMap + "/" + vFirstPage;
   if (DocumentLocation!=vTransferTo) {
     top.window.location = vTransferTo;
   } 
}

function swap(objImage){
  var noImage = new Image();
  noImage.src = "/images/noimage.gif";
  
  document.cf[objImage].src=noImage.src;
}

function setEnv() {
   var DocumentLocation = "";

   DocumentLocation = top.document.location.toString();
   
   if (document.forms[0].Envcount.value==""){
     document.forms[0].Envcount.value = "1";
     if (DocumentLocation.indexOf("dev")>=0){
       document.forms[0].Env.value = "dev";
     }
     else {
       document.forms[0].Env.value = "prod";
     } 
     document.forms[0].submit();
   }
}

function setPath(vvir,vname,vsource){
  if (document.forms[0].PathCount.value==""){
    document.forms[0].PathCount.value = "1";
    
    var downloadURL = "/asp/SetPath.asp?vvirpath=/" + vvir + "&vname=" + vname + "&vsource=" + vsource; 
    
    top.download.location.href= downloadURL;
 
  }
}

function getPath(FieldName,VirtualPath) {
  var xmlHttp;
  var vurl;
  var vquery;
  
  try {  // Firefox, Opera 8.0+, Safari  
    xmlHttp=new XMLHttpRequest();  
  }
  catch (e) {  // Internet Explorer  
    try {    
       xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
    }
    catch (e) {    
      try {      
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
      }
      catch (e) {      
        alert("Your browser does not support AJAX!");      
        return false;      
      }
    }  
  }
  xmlHttp.onreadystatechange=function(){
    if(xmlHttp.readyState==4)  
        {

        /*vquery = "document.forms[0]." + FieldName + ".value=xmlHttp.responseText;";
        eval(vquery);*/

       document.cf.MapPath.value = xmlHttp.responseText;
       alert(xmlHttp.responseText);
        
        }
  }
  vurl = "/asp/GetPathAjax.asp?virpath=" + VirtualPath;
  xmlHttp.open("GET",vurl,true);
  xmlHttp.send(null);  
    
}




