var ss_resolution = screen.width+"x"+screen.height;
var ss_referer = ""+document.referrer;
var ss_title = "";
var ss_url = "";
var ss_base_dir = "";
var ss_http_url = "http";
var ss_homePage = "";
var ss_connectionType = "";
var ss_plugIns = "";

if( typeof(ss_project) != "undefined") {
    if( window.ss_https ) {
    	if( s_https == 1 ) {
    		ss_doc_loc = ''+document.location;
    		myRE = new RegExp( "^https", "i" )
    		if( ss_doc_loc.match( myRE ) ) {
    			ss_http_url = "https";
    		}
    		else {
    			ss_http_url = "http";
    		}
    	}
    	else {
    		ss_http_url = "http";
    	}
    }

    if( ss_partition == 1 )
    	ss_base_dir = ss_http_url+"://sitestats.justechn.com/counter.php?";
    /*
    else if( ss_partition == 2 )
    	ss_base_dir = ss_http_url+"://sitestats2.justechn.com/counter.php?";
    else if( ss_partition == 3 )
    	ss_base_dir = ss_http_url+"://sitestats3.justechn.com/counter.php?";
    else if( ss_partition == 4 )
    	ss_base_dir = ss_http_url+"://sitestats4.justechn.com/counter.php?";
    else if( ss_partition == 5 )
    	ss_base_dir = ss_http_url+"://sitestats5.justechn.com/counter.php?";
    */
    else
    	ss_base_dir = ss_http_url+"://sitestats.justechn.com/counter.php?";

    ss_title = ""+document.title;
    //ss_title = ss_title.substring( 0, 150 );
    ss_title = escape( ss_title );

    ss_url = ""+document.location;
    //ss_url = ss_url.substring( 0, 150 );
    ss_url = escape( ss_url );

    //ss_referer = ss_referer.substring( 0, 150 );
    ss_referer = escape( ss_referer );

    var ss_date = new Date();
    var ss_time = ss_date.getTime();

    var appVer = "";
    var ie = navigator.appVersion.indexOf( "MSIE " );
    var ns6 = navigator.userAgent.indexOf( "Netscape6/" );
    var isIe = ( navigator.appName == "Microsoft Internet Explorer" );
    var isNs = ( navigator.appName == "Netscape" );
    var isOpera = ( navigator.appName == "Opera" );
    var isMac = ( navigator.userAgent.indexOf( "Mac" ) >= 0 );

    if( ie > 0 ) {
    	var ie2;
    	appVer = parseInt( ie2 = navigator.appVersion.substring( ie+5 ) );
    	if( appVer > 3 ) appVer = parseFloat( ie2 );
    }
    else if( ns6 > 0 ) appVer = parseFloat( navigator.userAgent.substring( ns6+10 ) );
    else appVer = parseFloat( navigator.appVersion );

    window.document.cookie = "cc=true; path=/";
    var ss_cookieEnabled = window.document.cookie.indexOf( "cc=" ) >= 0 ? "Y":"N";

    var ss_javascriptVersion = "1.0";
    if( isNs || isOpera ) {
    	if( appVer >= 3 ) {
    		ss_javascriptVersion = "1.1";
    		plugInsLength = navigator.plugins.length;
    		ss_plugIns = "";
    		for ( i = 0; i < plugInsLength && i < 30; i++ ) {
    			var plugs = navigator.plugins[i].name;
    			if (ss_plugIns.indexOf(plugs) == -1) {
    				if ( i != 0 ) ss_plugIns += ";";
    				//if( plugs.length > 100 ) plugs = plugs.substring( 0, 100 );
    				ss_plugIns += plugs;
    			}
    		}
    		ss_javascriptEnabled = navigator.javaEnabled() ? "Y":"N";
    	}
    	if( appVer >= 4 ) {
    		ss_javascriptVersion = "1.2";
    		ss_colorDepth = screen.pixelDepth;
    		ss_browserWidth = window.innerWidth;
    		ss_browserHeight = window.innerHeight;
    	}
    	if( appVer >= 4.06 ) ss_javascriptVersion = "1.3"
    }
    else if( isIe ) {
    	if( appVer < 4 ) ss_referer = "";
    	if( appVer >= 4 ) {
    		ss_javascriptEnabled = navigator.javaEnabled() ? "Y":"N";
    		ss_javascriptVersion = "1.2";
    		ss_colorDepth = screen.colorDepth
    	}
    	if( appVer >= 5 ) {
    		ss_browserWidth = window.document.documentElement.offsetWidth;
    		ss_browserHeight = window.document.documentElement.offsetHeight;
    		ss_javascriptVersion = "1.3";
    		if( !isMac && window.document.body ) {
    			window.document.body.addBehavior("#default#homePage");
    			ss_homePage = window.document.body.isHomePage(window.location) ? "Y":"N";
    			window.document.body.addBehavior("#default#clientCaps");
    			ss_connectionType = window.document.body.connectionType;
    		}
    	}
    }

    var ss_tracking_url = ss_base_dir+"a="+ss_project+"&t="+ss_date+"&pn="+ss_pageName+"&sn="+ss_server+"&cn="+ss_channel+"&pt="+ss_pageType+"&c1="+ss_cust1+"&c2="+ss_cust2+"&c3="+ss_cust3+"&c4="+ss_cust4+"&c5="+ss_cust5+"&res="+ss_resolution+"&bw="+ss_browserWidth+"&bh="+ss_browserHeight+"&jv="+ss_javascriptVersion+"&hp="+ss_homePage+"&ct="+ss_connectionType+"&cd="+ss_colorDepth+"&co="+ss_cookieEnabled+"&ref="+ss_referer+"&u="+ss_url+"&ptitle="+ss_title+"&js=Y&pi="+ss_plugIns;

    if (window.ss_javascript) {
    	document.writeln('<scr' + 'ipt language="JavaScript"' + ' src=' + ss_tracking_url + '></scr' + 'ipt>');
    }
    else {
    	ss_img = new Image();
    	ss_img.src = ss_tracking_url;
    	//document.writeln(ss_tracking_url);
    }
}

