// x.js
// X v3.10, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003 Michael Foster (mike@cross-browser.com)
// This library is distributed under the terms of the LGPL (gnu.org)

// Variables:
var xVersion='3.10',xOp7=false,xOp5or6=false,xIE4Up=false,xNN4=false,xUA=navigator.userAgent.toLowerCase();
if(window.opera){
  xOp7=(xUA.indexOf('opera 7')!=-1 || xUA.indexOf('opera/7')!=-1);
  if (!xOp7) xOp5or6=(xUA.indexOf('opera 5')!=-1 || xUA.indexOf('opera/5')!=-1 || xUA.indexOf('opera 6')!=-1 || xUA.indexOf('opera/6')!=-1);
}
else if(document.layers) xNN4=true;
else {xIE4Up=document.all && xUA.indexOf('msie')!=-1 && parseInt(navigator.appVersion)>=4;}

// Appearance:
function xShow(e) {
  if(!(e=xGetElementById(e))) return;
  if(e.style && xDef(e.style.visibility)) e.style.visibility='inherit';
  else if(xDef(e.visibility)) e.visibility='show';
}
function xHide(e) {
  if(!(e=xGetElementById(e))) return;
  if(e.style && xDef(e.style.visibility)) e.style.visibility='hidden';
  else if(xDef(e.visibility)) e.visibility='hide';
}
function xZIndex(e,uZ) {
  if(!(e=xGetElementById(e))) return 0;
  if(e.style && xDef(e.style.zIndex)) {
    if(arguments.length>1) e.style.zIndex=uZ;
    else uZ=e.style.zIndex;
  }
  else if(xDef(e.zIndex)) {
    if(arguments.length>1) e.zIndex=uZ;
    else uZ=e.zIndex;
  }
  return uZ;
}
function xColor(e,sColor) {
  if(!(e=xGetElementById(e))) return "";
  var c="";
  if(e.style && xDef(e.style.color)) {
    if(arguments.length>1) e.style.color=sColor;
    c=e.style.color;
  }
  return c;
}
function xBackground(e,sColor,sImage) {
  if(!(e=xGetElementById(e))) return "";
  var bg="";
  if(e.style) {
    if(arguments.length>1) e.style.backgroundColor=sColor;
    if(arguments.length==3) e.style.backgroundImage=(sImage && sImage!="")? "url("+sImage+")" : null;
    bg=e.style.backgroundColor;
  }
  else if(xDef(e.bgColor)) {
    if(arguments.length>1) e.bgColor=sColor;
    bg=e.bgColor;
    if(arguments.length==3) e.background.src=sImage;
  }
  return bg;
}

// Position:
function xMoveTo(e,iX,iY) {
  xLeft(e,iX);
  xTop(e,iY);
}
function xLeft(e,iX) {
  if(!(e=xGetElementById(e))) return 0;
  var css=xDef(e.style);
  if (css && xDef(e.style.left) && typeof(e.style.left)=="string") {
    if(arguments.length>1) e.style.left=iX+"px";
    else {
      iX=parseInt(e.style.left);
      if(isNaN(iX)) iX=0;
    }
  }
  else if(css && xDef(e.style.pixelLeft)) {
    if(arguments.length>1) e.style.pixelLeft=iX;
    else iX=e.style.pixelLeft;
  }
  else if(xDef(e.left)) {
    if(arguments.length>1) e.left=iX;
    else iX=e.left;
  }
  return iX;
}
function xTop(e,iY) {
  if(!(e=xGetElementById(e))) return 0;
  var css=xDef(e.style);
  if(css && xDef(e.style.top) && typeof(e.style.top)=="string") {
    if(arguments.length>1) e.style.top=iY+"px";
    else {
      iY=parseInt(e.style.top);
      if(isNaN(iY)) iY=0;
    }
  }
  else if(css && xDef(e.style.pixelTop)) {
    if(arguments.length>1) e.style.pixelTop=iY;
    else iY=e.style.pixelTop;
  }
  else if(xDef(e.top)) {
    if(arguments.length>1) e.top=iY;
    else iY=e.top;
  }
  return iY;
}
function xPageX(e) {
  if (!(e=xGetElementById(e))) return 0;
  if (xDef(e.pageX)) return e.pageX;
  var x = 0;
  while (e) {
    if (xDef(e.offsetLeft)) x += e.offsetLeft;
    e = xParent(e);
  }
  return x;
}
function xPageY(e) {
  if (!(e=xGetElementById(e))) return 0;
  if (xDef(e.pageY)) return e.pageY;
  var y = 0;
  while (e) {
    if (xDef(e.offsetTop)) y += e.offsetTop;
    e = xParent(e);
  }
  return y;
}
function xSlideTo(e,x,y,uTime) {
  if (!(e=xGetElementById(e))) return;
  if (!e.timeout) e.timeout = 25;
  e.xTarget = x; e.yTarget = y; e.slideTime = uTime; e.stop = false;
  e.yA = e.yTarget - xTop(e); e.xA = e.xTarget - xLeft(e); // A = distance
  e.B = Math.PI / (2 * e.slideTime); // B = period
  e.yD = xTop(e); e.xD = xLeft(e); // D = initial position
  var d = new Date(); e.C = d.getTime();
  if (!e.moving) xSlide(e);
}
function xSlide(e) {
  if (!(e=xGetElementById(e))) return;
  var now, s, t, newY, newX;
  now = new Date();
  t = now.getTime() - e.C;
  if (e.stop) { e.moving = false; }
  else if (t < e.slideTime) {
    setTimeout("xSlide('"+e.id+"')", e.timeout);
    s = Math.sin(e.B * t);
    newX = Math.round(e.xA * s + e.xD);
    newY = Math.round(e.yA * s + e.yD);
    xMoveTo(e, newX, newY);
    e.moving = true;
  }  
  else {
    xMoveTo(e, e.xTarget, e.yTarget);
    e.moving = false;
  }  
}

// Size:
function xResizeTo(e,uW,uH) {
  xWidth(e,uW);
  xHeight(e,uH);
}
function xWidth(e,uW) {
  if(!(e=xGetElementById(e)) || (uW && uW<0)) return 0;
  uW=Math.round(uW);
  var css=xDef(e.style);
  if(css && xDef(e.style.width,e.offsetWidth) && typeof(e.style.width)=="string") {
    if(arguments.length>1) xSetCW(e, uW);
    uW=e.offsetWidth;
  }
  else if(css && xDef(e.style.pixelWidth)) {
    if(arguments.length>1) e.style.pixelWidth=uW;
    uW=e.style.pixelWidth;
  }
  else if(xDef(e.clip) && xDef(e.clip.right)) {
    if(arguments.length>1) e.clip.right=uW;
    uW=e.clip.right;
  }
  return uW;
}
function xHeight(e,uH) {
  if(!(e=xGetElementById(e)) || (uH && uH<0)) return 0;
  uH=Math.round(uH);
  var css=xDef(e.style);
  if(css && xDef(e.style.height,e.offsetHeight) && typeof(e.style.height)=="string") {
    if(arguments.length>1) xSetCH(e, uH);
    uH=e.offsetHeight;
  }
  else if(css && xDef(e.style.pixelHeight)) {
    if(arguments.length>1) e.style.pixelHeight=uH;
    uH=e.style.pixelHeight;
  }
  else if(xDef(e.clip) && xDef(e.clip.bottom)) {
    if(arguments.length>1) e.clip.bottom=uH;
    uH=e.clip.bottom;
  }
  return uH;
}
// thank moz for the next 2000 bytes
function xGetCS(ele,sP){return parseInt(document.defaultView.getComputedStyle(ele,"").getPropertyValue(sP));}
function xSetCW(ele,uW){
  if(uW<0) return;
  var pl=0,pr=0,bl=0,br=0;
  if(xDef(document.defaultView) && xDef(document.defaultView.getComputedStyle)){
    pl=xGetCS(ele,"padding-left");
    pr=xGetCS(ele,"padding-right");
    bl=xGetCS(ele,"border-left-width");
    br=xGetCS(ele,"border-right-width");
  }
  else if(xDef(ele.currentStyle,document.compatMode)){
    if(document.compatMode=="CSS1Compat"){
      pl=parseInt(ele.currentStyle.paddingLeft);
      pr=parseInt(ele.currentStyle.paddingRight);
      bl=parseInt(ele.currentStyle.borderLeftWidth);
      br=parseInt(ele.currentStyle.borderRightWidth);
    }
  }
  else if(xDef(ele.offsetWidth,ele.style.width)){
    ele.style.width=uW+"px";
    pl=ele.offsetWidth-uW;
  }
  if(isNaN(pl)) pl=0; if(isNaN(pr)) pr=0; if(isNaN(bl)) bl=0; if(isNaN(br)) br=0;
  var cssW=uW-(pl+pr+bl+br);
  if(isNaN(cssW)||cssW<0) return;
  else ele.style.width=cssW+"px";
}
function xSetCH(ele,uH){
  if(uH<0) return;
  var pt=0,pb=0,bt=0,bb=0;
  if(xDef(document.defaultView) && xDef(document.defaultView.getComputedStyle)){
    pt=xGetCS(ele,"padding-top");
    pb=xGetCS(ele,"padding-bottom");
    bt=xGetCS(ele,"border-top-width");
    bb=xGetCS(ele,"border-bottom-width");
  }
  else if(xDef(ele.currentStyle,document.compatMode)){
    if(document.compatMode=="CSS1Compat"){
      pt=parseInt(ele.currentStyle.paddingTop);
      pb=parseInt(ele.currentStyle.paddingBottom);
      bt=parseInt(ele.currentStyle.borderTopWidth);
      bb=parseInt(ele.currentStyle.borderBottomWidth);
    }
  }
  else if(xDef(ele.offsetHeight,ele.style.height)){
    ele.style.height=uH+"px";
    pt=ele.offsetHeight-uH;
  }
  if(isNaN(pt)) pt=0; if(isNaN(pb)) pb=0; if(isNaN(bt)) bt=0; if(isNaN(bb)) bb=0;
  var cssH=uH-(pt+pb+bt+bb);
  if(isNaN(cssH)||cssH<0) return;
  else ele.style.height=cssH+"px";
}
function xClip(e,iTop,iRight,iBottom,iLeft) {
  if(!(e=xGetElementById(e))) return;
  if(e.style) {
    if (arguments.length == 5) e.style.clip="rect("+iTop+"px "+iRight+"px "+iBottom+"px "+iLeft+"px)";
    else e.style.clip="rect(0 "+parseInt(e.style.width)+"px "+parseInt(e.style.height)+"px 0)";
  }
  else if(e.clip) {
    if (arguments.length == 5) { e.clip.top=iTop; e.clip.right=iRight; e.clip.bottom=iBottom; e.clip.left=iLeft; }
    else { e.clip.top=0; e.clip.right=xWidth(e); e.clip.bottom=xHeight(e); e.clip.left=0; }
  }
}

// Event:
function xAddEventListener(e,eventType,eventListener,useCapture) {
  if(!(e=xGetElementById(e))) return;
  eventType=eventType.toLowerCase();
  if((!xIE4Up && !xOp7) && e==window) {
    if(eventType=='resize') { window.xPCW=xClientWidth(); window.xPCH=xClientHeight(); window.xREL=eventListener; xResizeEvent(); return; }
    if(eventType=='scroll') { window.xPSL=xScrollLeft(); window.xPST=xScrollTop(); window.xSEL=eventListener; xScrollEvent(); return; }
  }
  var eh="e.on"+eventType+"=eventListener";
  if(e.addEventListener) e.addEventListener(eventType,eventListener,useCapture);
  else if(e.attachEvent) e.attachEvent("on"+eventType,eventListener);
  else if(e.captureEvents) {
    if(useCapture||(eventType.indexOf('mousemove')!=-1)) { e.captureEvents(eval("Event."+eventType.toUpperCase())); }
    eval(eh);
  }
  else eval(eh);
}
function xRemoveEventListener(e,eventType,eventListener,useCapture) {
  if(!(e=xGetElementById(e))) return;
  eventType=eventType.toLowerCase();
  if((!xIE4Up && !xOp7) && e==window) {
    if(eventType=='resize') { window.xREL=null; return; }
    if(eventType=='scroll') { window.xSEL=null; return; }
  }
  var eh="e.on"+eventType+"=null";
  if(e.removeEventListener) e.removeEventListener(eventType,eventListener,useCapture);
  else if(e.detachEvent) e.detachEvent("on"+eventType,eventListener);
  else if(e.releaseEvents) {
    if(useCapture||(eventType.indexOf('mousemove')!=-1)) { e.releaseEvents(eval("Event."+eventType.toUpperCase())); }
    eval(eh);
  }
  else eval(eh);
}
function xEvent(evt) { // cross-browser event object prototype
  this.type = "";
  this.target = null;
  this.pageX = 0;
  this.pageY = 0;
  this.offsetX = 0;
  this.offsetY = 0;
  this.keyCode = 0;
  var e = evt ? evt : window.event;
  if(!e) return;
  // type
  if(e.type) this.type = e.type;
  // target
  if(xNN4) this.target = xLayerFromPoint(e.pageX, e.pageY);
  else if(e.target) this.target = e.target;
  else if(e.srcElement) this.target = e.srcElement;
  // pageX, pageY
  if(xOp5or6) { this.pageX = e.clientX; this.pageY = e.clientY; }
  else if(xDef(e.pageX,e.pageY)) { this.pageX = e.pageX; this.pageY = e.pageY; }
  else if(xDef(e.clientX,e.clientY)) { this.pageX = e.clientX + xScrollLeft(); this.pageY = e.clientY + xScrollTop(); }
  // offsetX, offsetY
  if(xDef(e.layerX,e.layerY)) { this.offsetX = e.layerX; this.offsetY = e.layerY; }
  else if(xDef(e.offsetX,e.offsetY)) { this.offsetX = e.offsetX; this.offsetY = e.offsetY; }
  else { this.offsetX = this.pageX - xPageX(this.target); this.offsetY = this.pageY - xPageY(this.target); }
  // keycode
  if (xDef(e.keyCode)) { this.keyCode = e.keyCode; }
  else if (xDef(e.which)) { this.keyCode = e.which; }
}
function xResizeEvent() { // window resize event simulation
  if (window.xREL) setTimeout("xResizeEvent()", 250);
  var cw = xClientWidth(), ch = xClientHeight();
  if (window.xPCW != cw || window.xPCH != ch) { window.xPCW = cw; window.xPCH = ch; if (window.xREL) window.xREL(); }
}
function xScrollEvent() { // window scroll event simulation
  if (window.xSEL) setTimeout("xScrollEvent()", 250);
  var sl = xScrollLeft(), st = xScrollTop();
  if (window.xPSL != sl || window.xPST != st) { window.xPSL = sl; window.xPST = st; if (window.xSEL) window.xSEL(); }
}

// Object:
function xGetElementById(e) {
  if(typeof(e)!="string") return e;
  if(document.getElementById) e=document.getElementById(e);
  else if(document.all) e=document.all[e];
  else if(document.layers) e=xLayer(e);
  else e=null;
  return e;
}
function xLayer(id,root) { // only for nn4
  var i,layer,found=null;
  if (!root) root=window;
  for(i=0; i<root.document.layers.length; i++) {
    layer=root.document.layers[i];
    if(layer.id==id) return layer;
    if(layer.document.layers.length) found=xLayer(id,layer);
    if(found) return found;
  }
  return null;
}
function xLayerFromPoint(x,y,root) { // only for nn4
  var i, hn=null, hz=-1, cn;
  if (!root) root = window;
  for (i=0; i < root.document.layers.length; ++i) {
    cn = root.document.layers[i];
    if (cn.visibility != "hide" && x >= cn.pageX && x <= cn.pageX + cn.clip.right && y >= cn.pageY && y <= cn.pageY + cn.clip.bottom ) {
      if (cn.zIndex > hz) { hz = cn.zIndex; hn = cn; }
    }
  }
  if (hn) {
    cn = xLayerFromPoint(x,y,hn);
    if (cn) hn = cn;
  }
  return hn;
}
function xParent(e){
  if (!(e=xGetElementById(e))) return null;
  var p=null;
  if (e.parentLayer){if (e.parentLayer!=window) p=e.parentLayer;}
  else{
    if (e.offsetParent) p=e.offsetParent;
    else if (e.parentNode) p=e.parentNode;
    else if (e.parentElement) p=e.parentElement;
  }
  return p;
}
function xDef() {
  for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])=="" || typeof(arguments[i])=="undefined") return false;}
  return true;
}

// Window:
function xScrollLeft() {
  var offset=0;
  if(xDef(window.pageXOffset)) offset=window.pageXOffset;
  else if(document.documentElement && document.documentElement.scrollLeft) offset=document.documentElement.scrollLeft;
  else if(document.body && xDef(document.body.scrollLeft)) offset=document.body.scrollLeft;
  return offset;
}
function xScrollTop() {
  var offset=0;
  if(xDef(window.pageYOffset)) offset=window.pageYOffset;
  else if(document.documentElement && document.documentElement.scrollTop) offset=document.documentElement.scrollTop;
  else if(document.body && xDef(document.body.scrollTop)) offset=document.body.scrollTop;
  return offset;
}
function xClientWidth() {
  var w=0;
  if(xOp5or6) w=window.innerWidth;
  else if(xIE4Up && document.documentElement && document.documentElement.clientWidth)
    w=document.documentElement.clientWidth;
  else if(document.body && document.body.clientWidth)
    w=document.body.clientWidth;
  else if(xDef(window.innerWidth,window.innerHeight,document.height)) {
    w=window.innerWidth;
    if(document.height>window.innerHeight) w-=16;
  }
  return w;
}
function xClientHeight() {
  var h=0;
  if(xOp5or6) h=window.innerHeight;
  else if(xIE4Up && document.documentElement && document.documentElement.clientHeight)
    h=document.documentElement.clientHeight;
  else if(document.body && document.body.clientHeight)
    h=document.body.clientHeight;
  else if(xDef(window.innerWidth,window.innerHeight,document.width)) {
    h=window.innerHeight;
    if(document.width>window.innerWidth) h-=16;
  }
  return h;
}

// end x.js


//**************************************************
// GOOGLE ANALYTICS LINK TRACKING - Start
//**************************************************
//	This javascript tags file downloads and external links in Google Analytics.
//	You need to be using the Google Analytics New Tracking Code (ga.js) 
//	for this script to work.
//	To use, place this file on all pages just above the Google Analytics tracking code.
//	All outbound links and links to non-html files should now be automatically tracked.
//
//	This script has been provided by Goodwebpractices.com
//	Thanks to ShoreTel, MerryMan and Colm McBarron
//
//	www.goodwebpractices.com
//	VKI has made changes as indicated below.								

if (document.getElementsByTagName) {
        // Initialize external link handlers
        var hrefs = document.getElementsByTagName("a");
        for (var l = 0; l < hrefs.length; l++) {
				// try {} catch{} block added by erikvold VKI
			try{
	                //protocol, host, hostname, port, pathname, search, hash
	                if (hrefs[l].protocol == "mailto:") {
	                        startListening(hrefs[l],"click",trackMailto);
	                } else if (hrefs[l].hostname == location.host) {
	                        var path = hrefs[l].pathname + hrefs[l].search;
							var isDoc = path.match(/\.(?:doc|eps|jpg|png|svg|xls|ppt|pdf|xls|zip|txt|vsd|vxd|js|css|rar|exe|wma|mov|avi|wmv|mp3)($|\&|\?)/);
	                        if (isDoc) {
	                                startListening(hrefs[l],"click",trackExternalLinks);
	                        }
	                } else {
	                        startListening(hrefs[l],"click",trackExternalLinks);
	                }
			}
			catch(e){
					continue;
			}
        }
}

function startListening (obj,evnt,func) {
        if (obj.addEventListener) {
                obj.addEventListener(evnt,func,false);
        } else if (obj.attachEvent) {
                obj.attachEvent("on" + evnt,func);
        }
}

function trackMailto (evnt) {
        var href = (evnt.srcElement) ? evnt.srcElement.href : this.href;
        var mailto = "/mailto/" + href.substring(7);
        if (typeof(pageTracker) == "object") pageTracker._trackPageview(mailto);
}

function trackExternalLinks (evnt) {
        var e = (evnt.srcElement) ? evnt.srcElement : this;
        while (e.tagName != "A") {
                e = e.parentNode;
        }
        var lnk = (e.pathname.charAt(0) == "/") ? e.pathname : "/" + e.pathname;
        if (e.search && e.pathname.indexOf(e.search) == -1) lnk += e.search;
        if (e.hostname != location.host) lnk = "/external/" + e.hostname + lnk;
        if (typeof(pageTracker) == "object") pageTracker._trackPageview(lnk); 
}
//**************************************************
// GOOGLE ANALYTICS LINK TRACKING - End
//**************************************************



//**************************************************
// GOOGLE ANALYTICS - Start
//**************************************************
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
//**************************************************
// GOOGLE ANALYTICS - End
//**************************************************



//**************************************************
// GOOGLE CUSTOM SEARCH - Start
//**************************************************
function SearchSiteEnglish() {
    document.location.href = 'http://www.eu-employment-observatory.net/en/search.htm?cx=014977962048188822665:yggdop13plw&cof=FORID%3A11&ie=UTF-8&q=' + URLEncode(document.getElementById('q').value) + '&sa=Search';
}

function SearchSiteFrench() {
    document.location.href = 'http://www.eu-employment-observatory.net/fr/search.htm?cx=014977962048188822665:yggdop13plw&cof=FORID%3A11&ie=UTF-8&q=' + URLEncode(document.getElementById('q').value) + '&sa=Search';
}

function SearchSiteGerman() {
    document.location.href = 'http://www.eu-employment-observatory.net/de/search.htm?cx=014977962048188822665:yggdop13plw&cof=FORID%3A11&ie=UTF-8&q=' + URLEncode(document.getElementById('q').value) + '&sa=Search';
}

function URLEncode(clearString) {
    var output = '';
    var x = 0;
    clearString = clearString.toString();
    var regex = /(^[a-zA-Z0-9_.]*)/;
    while (x < clearString.length) {
        var match = regex.exec(clearString.substr(x));
        if (match != null && match.length > 1 && match[1] != '') {
            output += match[1];
            x += match[1].length;
        } else {
            if (clearString[x] == ' ')
                output += '+';
            else {
                var charCode = clearString.charCodeAt(x);
                var hexVal = charCode.toString(16);
                output += '%' + (hexVal.length < 2 ? '0' : '') + hexVal.toUpperCase();
            }
            x++;
        }
    }
    return output;
}



function SubmitOnEnterEnglish(myfield, e) {
    var keycode;
    if (window.event)
        keycode = window.event.keyCode;
    else if (e)
        keycode = e.which;
    else
        return true;
    if (keycode == 13) {
        SearchSiteEnglish();
        return false;
    }
    else
        return true;
}

function SubmitOnEnterFrench(myfield, e) {
    var keycode;
    if (window.event)
        keycode = window.event.keyCode;
    else if (e)
        keycode = e.which;
    else
        return true;
    if (keycode == 13) {
        SearchSiteFrench();
        return false;
    }
    else
        return true;
}

function SubmitOnEnterGerman(myfield, e) {
    var keycode;
    if (window.event)
        keycode = window.event.keyCode;
    else if (e)
        keycode = e.which;
    else
        return true;
    if (keycode == 13) {
        SearchSiteGerman();
        return false;
    }
    else
        return true;
}

//**************************************************
// GOOGLE CUSTOM - Search
//**************************************************


//**************************************************
// Start of StatCounter.com Code 
//**************************************************

var sc_project=5678723; 
var sc_invisible=1; 
var sc_partition=63; 
var sc_click_stat=1;
var sc_security = "5a9471d3";
var sc_width = screen.width; var sc_height = screen.height; var sc_referer = "" + document.referrer; try { sc_referer = "" + parent.document.referrer } catch (ex) { sc_referer = "" + document.referrer } var sc_unique = 0; var sc_returning = 0; var sc_returns = 0; var sc_error = 0; var sc_remove = 0; var sc_cls = -1; var sc_inv = 0; var sc_os = ""; var sc_title = ""; var sc_url = ""; var sc_base_dir = ""; var sc_click_dir = ""; var sc_link_back_start = ""; var sc_link_back_end = ""; var sc_security_code = ""; var sc_http_url = "http"; var sc_host = "statcounter.com"; if (window.sc_invisible) { if (window.sc_invisible == 1) { sc_inv = 1 } } if (window.sc_click_stat) { sc_cls = window.sc_click_stat } if (window.sc_https) { if (sc_https == 1) { sc_doc_loc = '' + document.location; myRE = new RegExp("^https", "i"); if (sc_doc_loc.match(myRE)) { sc_http_url = "https" } } } if (window.sc_local) { sc_base_dir = sc_local } else { if (window.sc_partition) { if (sc_cls == -1 && (window.sc_partition > 45 || window.sc_partition == 44 || window.sc_partition == 39 || window.sc_partition == 34 || window.sc_partition == 31 || window.sc_partition == 29 || window.sc_partition == 23 || window.sc_partition == 22 || window.sc_partition == 21 || window.sc_partition == 20 || window.sc_partition == 19 || window.sc_partition == 18 || window.sc_partition == 17 || window.sc_partition == 16 || window.sc_partition == 15 || window.sc_partition == 14 || window.sc_partition == 13 || window.sc_partition == 12 || window.sc_partition == 11 || window.sc_partition == 10 || window.sc_partition == 9 || window.sc_partition == 7 || window.sc_partition == 6 || window.sc_partition == 5 || window.sc_partition == 4 || window.sc_partition == 3 || window.sc_partition == 2 || window.sc_partition == 1)) { sc_cls = 1 } var sc_counter = ""; if ((window.sc_partition != 1 && window.sc_partition != 2 && window.sc_partition != 3 && window.sc_partition != 4 && window.sc_partition != 5 && window.sc_partition != 6 && window.sc_partition != 7 && window.sc_partition != 9 && window.sc_partition != 10 && window.sc_partition != 11 && window.sc_partition != 12 && window.sc_partition != 13 && window.sc_partition != 14 && window.sc_partition != 15 && window.sc_partition != 16 && window.sc_partition != 17 && window.sc_partition != 18 && window.sc_partition != 19 && window.sc_partition != 20 && window.sc_partition != 21 && window.sc_partition != 22 && window.sc_partition != 23 && window.sc_partition != 29 && window.sc_partition != 31 && window.sc_partition != 34 && window.sc_partition != 39 && window.sc_partition != 44) && sc_partition <= 45) { sc_counter = sc_partition + 1 } sc_base_dir = sc_http_url + "://c" + sc_counter + "." + sc_host + "/" } else { sc_base_dir = sc_http_url + "://c1." + sc_host + "/" } } sc_click_dir = sc_base_dir; if (window.sc_text) { sc_base_dir += "text.php?" } else { sc_base_dir += "t.php?" } if (window.sc_project) { sc_base_dir += "sc_project=" + sc_project } else if (window.usr) { sc_base_dir += "usr=" + usr } else { sc_error = 1 } if (window.sc_remove_link) { sc_link_back_start = ""; sc_link_back_end = "" } else { sc_link_back_start = "<a class=\"statcounter\" href=\"http://www." + sc_host + "\" target=\"_blank\">"; sc_link_back_end = "<\/a>" } sc_date = new Date(); sc_time = sc_date.getTime(); sc_time_difference = 3600000; sc_title = "" + document.title; sc_url = "" + document.location; sc_referer = sc_referer.substring(0, 255); sc_title = sc_title.substring(0, 150); sc_url = sc_url.substring(0, 150); sc_referer = escape(sc_referer); if (encodeURIComponent) { sc_title = encodeURIComponent(sc_title) } else { sc_title = escape(sc_title) } sc_url = escape(sc_url); if (window.sc_security) { sc_security_code = sc_security } if (sc_script_num) { sc_script_num++ } else { var sc_script_num = 1 } var sc_tracking_url = sc_base_dir + "&resolution=" + sc_width + "&h=" + sc_height + "&camefrom=" + sc_referer + "&u=" + sc_url + "&t=" + sc_title + "&java=1&security=" + sc_security_code + "&sc_random=" + Math.random() + "&sc_snum=" + sc_script_num; var sc_clstr = "<span class=\"statcounter\">"; var sc_cltext = "\" alt=\"StatCounter - Free Web Tracker and Counter\" border=\"0\">"; var sc_strout = sc_clstr + sc_link_back_start + "<img src=\"" + sc_tracking_url + sc_cltext + sc_link_back_end + "</span>"; if (sc_error == 1) { document.writeln("Code corrupted. Insert fresh copy.") } else if (sc_remove == 1) { } else { if (sc_inv == 1) { if (window.sc_call) { sc_call++ } else { sc_call = 1 } eval("var sc_img" + sc_call + " = new Image();sc_img" + sc_call + ".src = \"" + sc_tracking_url + "&invisible=1\"") } else if (window.sc_text) { document.writeln('<scr' + 'ipt language="JavaScript"' + ' src=' + sc_tracking_url + "&text=" + sc_text + '></scr' + 'ipt>') } else { document.writeln(sc_strout) } } if (sc_cls > 0) { if (clickstat_done != 1) { var clickstat_done = 1; var clickstat_project = window.sc_project; var clickstat_security = window.sc_security_code; var dlext = "7z|aac|avi|csv|doc|docx|exe|flv|gif|gz|jpe?g|js|mp(3|4|e?g)|mov|pdf|phps|png|ppt|rar|sit|tar|torrent|txt|wma|wmv|xls|xlsx|xml|zip"; if (typeof (window.sc_download_type) == 'string') { dlext = window.sc_download_type } var ltype = "https?|ftp|telnet|ssh|ssl|mailto"; var second = "ac|co|gov|ltd|me|mod|net|nic|nhs|org|plc|police|sch|com"; var dl = new RegExp("\\.(" + dlext + ")$", "i"); var lnk = new RegExp("^(" + ltype + "):", "i"); var domsec = new RegExp("\^(" + second + ")$", "i"); var host_name = location.host.replace(/^www\./i, ""); var host_splitted = host_name.split("."); var domain = host_splitted.pop(); var host_split = host_splitted.pop(); if (domsec.test(host_split)) { domain = host_split + "." + domain; host_split = host_splitted.pop() } domain = host_split + "." + domain; var lnklocal_mask = "^https?:\/\/(.*)" + domain; var lnklocal = new RegExp(lnklocal_mask, "i"); if (document.getElementsByTagName) { var anchors = document.getElementsByTagName('a'); for (var i = 0; i < anchors.length; i++) { var anchor = anchors[i]; if (anchor.onmousedown) { var original_click = anchor.onmousedown; var s = original_click.toString().split("\n").join(" "); var bs = s.indexOf('{'); var head = s.substr(0, bs); var ps = head.indexOf('('); var pe = head.indexOf(')'); var params = head.substring(ps + 1, pe); var plist = params.split(","); var body = s.substr(bs + 1, s.length - bs - 2); var insert = "sc_clickstat_call(this,'" + sc_click_dir + "');"; var final_body = insert + body; var ev_head = "new Function ("; var ev_params = ""; var ev_sep = ""; for (var sc_i = 0; sc_i < plist.length; sc_i++) { ev_params = ev_sep + "'" + plist[sc_i] + "'"; ev_sep = "," } if (ev_sep == ",") { ev_params += "," } var ev_foot = "final_body);"; var ev_final = ev_head + ev_params + ev_foot; anchor.onmousedown = eval(ev_final) } else { anchor.onmousedown = new Function("event", "sc_clickstat_call(this,'" + sc_click_dir + "');return true;") } } } function sc_none() { return } function sc_delay() { if (window.sc_click_stat) { var d = window.sc_click_stat } else { var d = 250 } var n = new Date(); var t = n.getTime() + d; while (n.getTime() < t) { var n = new Date() } } function sc_clickstat_call(adata, sc_click_dir) { if (adata) { var clickmode = 0; if (lnk.test(adata)) { if ((lnklocal.test(adata))) { if (dl.test(adata)) { clickmode = 1 } else if (window.sc_exit_link_detect && new RegExp(sc_exit_link_detect, "i").test(adata)) { clickmode = 2 } else if (sc_cls == 2) { clickmode = 2 } } else { clickmode = 2 } } if (clickmode != 0) { var sc_link = escape(adata); if (sc_link.length > 0) { var sc_req = sc_click_dir + "click.gif?sc_project=" + clickstat_project + "&security=" + clickstat_security + "&c=" + sc_link + "&m=" + clickmode + "&u=" + sc_url + "&t=" + sc_title + "&rand=" + Math.random(); var sc_req_image = new Image(); sc_req_image.onload = sc_none; sc_req_image.src = sc_req; sc_delay() } } } } var sc_gsyn_pattern = 'googlesyndication\.com|ypn-js\.overture\.com|ypn-js\.ysm\.yahoo\.com|googleads\.g\.doubleclick\.net'; var sc_px; var sc_py; function sc_adsense_click(sc_data) { var sc_link = escape(sc_data.src); var i = new Image(); var sc_req = sc_click_dir + "click.gif?sc_project=" + clickstat_project + "&security=" + clickstat_security + "&c=" + sc_link + "&m=2&u=" + sc_url + "&t=" + sc_title + "&rand=" + Math.random(); i.src = sc_req; sc_delay() } function sc_adsense_init() { if (document.all && typeof window.opera == "undefined") { var el = document.getElementsByTagName("iframe"); for (var i = 0; i < el.length; i++) { if (el[i].src.match(sc_gsyn_pattern)) { el[i].onfocus = function() { sc_adsense_click(this) } } } } else { if (typeof window.addEventListener != "undefined") { window.addEventListener("unload", sc_exitpage, false); window.addEventListener("mousemove", sc_getmouse, true) } } } if (typeof window.addEventListener != 'undefined') { window.addEventListener('load', sc_adsense_init, false) } else { if (typeof document.addEventListener != 'undefined') { document.addEventListener('load', sc_adsense_init, false) } else { if (typeof window.attachEvent != 'undefined') { window.attachEvent('onload', sc_adsense_init) } else { if (typeof window.onload == 'function') { var sc_existing = onload; window.onload = function() { sc_existing(); sc_adsense_init() } } else { window.onload = sc_adsense_init } } } } function sc_getmouse(e) { if (typeof e.pageX == "number") { sc_px = e.pageX; sc_py = e.pageY } else { if (typeof e.clientX == "number") { sc_px = e.clientX; sc_py = e.clientY; if (document.body && (document.body.scrollLeft || document.body.scrollTop)) { sc_px += document.body.scrollLeft; sc_py += document.body.scrollTop } else { if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) { sc_px += document.documentElement.scrollLeft; sc_py += document.documentElement.scrollTop } } } } } function sc_findy(obj) { var y = 0; while (obj) { y += obj.offsetTop; obj = obj.offsetParent } return (y) } function sc_findx(obj) { var x = 0; while (obj) { x += obj.offsetLeft; obj = obj.offsetParent } return (x) } function sc_exitpage(e) { ad = document.getElementsByTagName("iframe"); if (typeof sc_px == "undefined") { return } for (i = 0; i < ad.length; i++) { var adLeft = sc_findx(ad[i]); var adTop = sc_findy(ad[i]); var adW = parseInt(adLeft) + parseInt(ad[i].width) + 15; var adH = parseInt(adTop) + parseInt(ad[i].height) + 10; var inFrameX = (sc_px > (adLeft - 10) && sc_px < adW); var inFrameY = (sc_py > (adTop - 10) && sc_py < adH); if (inFrameY && inFrameX) { if (ad[i].src.match(sc_gsyn_pattern)) { sc_adsense_click(ad[i]) } } } } } }
//**************************************************
// End of StatCounter.com Code 
//**************************************************
