﻿function myPop() {
    var xmlDoc = null;
    
    this.square = null;
    this.overdiv = null;

    this.popOut = function (GEBID) {
        //filter:alpha(opacity=25);-moz-opacity:.25;opacity:.25; 
        this.overdiv = document.createElement("div");
        this.overdiv.className = "overdiv";
        this.overdiv.setAttribute("id", "idAll123");

        document.getElementById(GEBID).style.display = 'block';
        this.square = document.getElementById(GEBID);
        this.square.className = "square";
        this.square.Code = this;

        document.body.appendChild(this.overdiv);
        document.body.appendChild(this.square);

        load(GEBID);

    }

}



function load(GEBID) {
    if (typeof window.ActiveXObject != 'undefined') {
        xmlDoc = new ActiveXObject("Microsoft.XMLHTTP");
        xmlDoc.onreadystatechange = process;
    }
    else {
        xmlDoc = new XMLHttpRequest();
        xmlDoc.onload = process;
    }

    var turl = document.location.href;
    
    if (turl.indexOf('www.dailyforex.com') != -1) {
        xmlDoc.open("POST", "http://www.dailyforex.com/AlternativeCounter.aspx?GEBID=" + GEBID + "&WhereOpened=" + turl, true);
    }

    if (turl.indexOf('es.dailyforex.com') != -1) {
        xmlDoc.open("POST", "http://es.dailyforex.com/AlternativeCounter.aspx?GEBID=" + GEBID + "&WhereOpened=" + turl, true);
    }

    if (turl.indexOf('arab.dailyforex.com') != -1) {
        xmlDoc.open("POST", "http://arab.dailyforex.com/AlternativeCounter.aspx?GEBID=" + GEBID + "&WhereOpened=" + turl, true);
    }

    if (turl.indexOf('it.dailyforex.com') != -1) {
        xmlDoc.open("POST", "http://it.dailyforex.com/AlternativeCounter.aspx?GEBID=" + GEBID + "&WhereOpened=" + turl, true);
    }

    if (turl.indexOf('fr.dailyforex.com') != -1) {
        xmlDoc.open("POST", "http://fr.dailyforex.com/AlternativeCounter.aspx?GEBID=" + GEBID + "&WhereOpened=" + turl, true);
    }

    if (turl.indexOf('tr.dailyforex.com') != -1) {
        xmlDoc.open("POST", "http://tr.dailyforex.com/AlternativeCounter.aspx?GEBID=" + GEBID + "&WhereOpened=" + turl, true);
    }
    
    xmlDoc.send(null);
}

function process() {

}




function popIn(GEBID) {

    document.getElementById(GEBID).style.display = 'none';
    document.body.removeChild(document.getElementById('idAll123'));


}





          function altrenOnOff(ShowAlternativeBroker, itemid,one,two,three,name) {
              div1 = itemid + one;
              div2 = itemid + two;
              divmain = itemid + three;
              
              if (ShowAlternativeBroker == 'True') {
                  document.getElementById(div1).style.display = 'inline';
                  document.getElementById(div2).style.display = 'none';

                  if (document.location.href.indexOf('http://www.dailyforex.com') > -1) {
                      document.getElementById(divmain).href = "http://www.dailyforex.com/forex_providers/brokers/" + name + ".aspx";
                  }


                  if (document.location.href.indexOf('http://es.dailyforex.com') > -1) {
                      document.getElementById(divmain).href = "http://es.dailyforex.com/forex_providers/brokers/" + name + ".aspx";
                  }

                  if (document.location.href.indexOf('http://arab.dailyforex.com') > -1) {
                      document.getElementById(divmain).href = "http://arab.dailyforex.com/forex_providers/brokers/" + name + ".aspx";
                  }

                  if (document.location.href.indexOf('http://it.dailyforex.com') > -1) {
                      document.getElementById(divmain).href = "http://it.dailyforex.com/forex_providers/brokers/" + name + ".aspx";
                  }

                  if (document.location.href.indexOf('http://fr.dailyforex.com') > -1) {
                      document.getElementById(divmain).href = "http://fr.dailyforex.com/forex_providers/brokers/" + name + ".aspx";
                  }

                  if (document.location.href.indexOf('http://tr.dailyforex.com') > -1) {
                      document.getElementById(divmain).href = "http://tr.dailyforex.com/forex_providers/brokers/" + name + ".aspx";
                  }

              }

              else {
                  document.getElementById(div1).style.display = 'none';
                  document.getElementById(div2).style.display = 'inline';


                  if (document.location.href.indexOf('http://www.dailyforex.com') > -1) {
                      document.getElementById(div2).href = "http://www.dailyforex.com/forex_providers/brokers/" + name + ".aspx";
                  }

                  if (document.location.href.indexOf('http://es.dailyforex.com') > -1) {
                      document.getElementById(div2).href = "http://es.dailyforex.com/forex_providers/brokers/" + name + ".aspx";
                  }

                  if (document.location.href.indexOf('http://arab.dailyforex.com') > -1) {
                      document.getElementById(div2).href = "http://arab.dailyforex.com/forex_providers/brokers/" + name + ".aspx";
                  }

                  if (document.location.href.indexOf('http://it.dailyforex.com') > -1) {
                      document.getElementById(div2).href = "http://it.dailyforex.com/forex_providers/brokers/" + name + ".aspx";
                  }

                  if (document.location.href.indexOf('http://fr.dailyforex.com') > -1) {
                      document.getElementById(div2).href = "http://fr.dailyforex.com/forex_providers/brokers/" + name + ".aspx";
                  }

                  if (document.location.href.indexOf('http://tr.dailyforex.com') > -1) {
                      document.getElementById(div2).href = "http://tr.dailyforex.com/forex_providers/brokers/" + name + ".aspx";
                  }

              }
           }
         



          