// *** System ***
function dswLoginResult(data){
    if(data=='OK'){
        var url =window.location.href;
        if (url.indexOf('?')<0) { url=url+'?'; } else { url=url+'&x'; }
        window.open(url,'_self');
    }if(data=='REGISTER'){
        window.open('/Membership/Registration.aspx','_self');
    }
}

// *** Tools ***
function XSLTransform( xmlurl, xslurl ) 
{
  var xmlHttp;
  var xsltHttp;
  if (window.XMLHttpRequest) {
    xmlHttp = new XMLHttpRequest();
    xsltHttp = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    try {
      xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
      xsltHttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        xsltHttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        return false;
      }
    }
  } else return false;
  xmlHttp.open("GET", xmlurl, false);
  xmlHttp.send(null);
  var XML = xmlHttp.responseXML;
  xsltHttp.open("GET", xslurl, false);
  xsltHttp.send(null);
  var XSLT = xsltHttp.responseXML;
  var xsltProc;
  if (typeof XSLTProcessor != "undefined") {
      xsltProc = new XSLTProcessor();
      xsltProc.importStylesheet(XSLT);
      var fragment = xsltProc.transformToFragment(XML, document);      
      var res = '';      
      if ((typeof(fragment.outherXML))!='undefined'){
        res = fragment.outherXML;                
      } else {
        try{
          res = fragment.firstChild.innerHTML;
        } catch( ex ){ res = ''; };
      }              
      return res;
  } else {    
      return XML.transformNode(XSLT);
  }
}

function getSize()
{
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  };
  return new Array( myWidth, myHeight );
}
