/*visitor's details code*/
  function css_browser_selector(u){var ua = u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1;},g='gecko',w='webkit',s='safari',h=document.getElementsByTagName('html')[0],b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+'  Firefox2':is('firefox/3')?g+' Firefox3':is('gecko/')?g:/opera(\s|\/)(\d+)/.test(ua)?'opera opera'+RegExp.$2:is('konqueror')?'konqueror':is('chrome')?w+' '+s+' Chrome':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?'mobile':is('iphone')?'iphone':is('ipod')?'ipod':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'Windows':is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;};browsertype=css_browser_selector(navigator.userAgent).split(' ');var browser,os;if(browsertype.length>3){  browser=browsertype[1];   os=browsertype[2];}else{    browser='';    os=browsertype[1];}

/****************************************************************function create and read 
cookie*********************************************/
function basename(path) {
    var path= path.replace(/\\/g,'/').replace( /.*\//, '' );
	path= path.split('?');
	return path[0];
}
function newCookie(name,value) 
{
 var days = 730;   // the number at the left reflects the number of days for the cookie to last
                 // modify it according to your needs
	if (days) 
	{
	   var date = new Date();
	   date.setTime(date.getTime()+(days*24*60*60*1000));
	   var expires = "; expires="+date.toGMTString(); 
	}
	
   else var expires = "";
   document.cookie = name+"="+value+expires+"; path=/"; 
}
function newCookie_30minuts(name,value) 
{
    // the number at the left reflects the number of days for the cookie to last
                 // modify it according to your needs
	
	   var date = new Date();
	   date.setTime(date.getTime()+(30*60*1000));
	   var expires = "; expires="+date.toGMTString(); 
	
	
  
   document.cookie = name+"="+value+expires+"; path=/"; 
}
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
/************************************************************************function read cookie*******************************************************/

/*hostname,page,referer,referer domain,screen*/
  var this_pagem,temp_pages,page_visits; //This is to count the number of visits per pages
  var hostname=window.location.hostname;    //host name
  var page=location.href;  //full url of current page
  var check_campid=page.indexOf("adl_tracker");   //checking whether campaign id exisits, returns -1 if campaign id does not exists 

  var referer=document.referrer;       // referrer page url   
  var curdom=referer.replace(/&/g, "*"); //current domain for tracking 'same domain'
  var durl=referer.split('http://').join('');
  var durl_array=durl.split('/');
 //storing the source domain in cookie
//if(hostname=='www.techwyse.com')alert(referer);
  if((durl_array[0]!=hostname && durl_array[0]!='') || check_campid!=-1)
  {
     source=durl_array[0];    //source domain name    
	 newCookie('adl_durl',source);   //create a new cookie and storing the source domain 
	 
	 //checking and storing the source campaign 
	 if(check_campid!=-1)
	 {
	    var temp=page.replace(/&/g, "*");
	    newCookie('adl_camp',temp);   //create a new cookie and storing the campaign id url 
	 }
	 if(durl_array[0]!=hostname && check_campid==-1 && readCookie('adl_same')!=111)  //adl_same is to identify whether its coming from thanks page.	                                                                                                                                           
	 {                                                                                                                                          //value will be 111 when it comes from thanks page  
	   document.cookie = "adl_camp=;expires=20/06/2000 00:00:00"; 		 
	 }
  }
  
  if(durl_array[0]=='' && readCookie('adl_same')!=111)
  {
    document.cookie = "adl_durl=;expires=20/06/2000 00:00:00";  
  }
  
  referer=referer.replace(/&/g, "*");
  var screen_resolution=screen.width+'x'+screen.height;  //screen resolution
  
  
  if(durl_array[0]!=hostname && durl_array[0]!='')
  {     
	  newCookie('adl_ref',referer);
  } 
  if(readCookie('adl_durl')!='')
 {   
   
    newCookie('adl_key',readCookie('adl_ref'));
	
 }
  if(durl_array[0]=='' && readCookie('adl_same')!=111)
  {
     document.cookie = "adl_ref=;expires=20/06/2000 00:00:00";    
	 document.cookie = "adl_key=;expires=20/06/2000 00:00:00";    
  } 
  
/*hostname,page,referer,referer domain,screen*/

if(referer=='' && check_campid==-1 && readCookie('adl_same')!=111)
{
 	document.cookie = "adl_camp=;expires=20/06/2000 00:00:00";   
}

/*creating random number for user session*/
if(readCookie('adl_rand')==null)
{
 	
	 newCookie('adl_rand',Math.random());
}
document.cookie = "adl_same=;expires=20/06/2000 00:00:00";  
/*30 minuts session for visits count*/
if(readCookie('adl_visit_time')==null)
{
 //newCookie_30minuts('visit_time','111');
 //var cnt=readCookie('total_visits');
// if(cnt==null)cnt=0;
 //else cnt=1;
 //var val=(parseInt(cnt)+parseInt(1));
 //newCookie('total_visits',cnt);
 total_visits=1;
}else {total_visits=0;}
newCookie_30minuts('adl_visit_time','111');

//visits per each page
if(readCookie('adl_visit_pages')==null)newCookie_30minuts('adl_visit_pages','');
this_page=basename(location.href);
if(this_page=='')this_page=hostname;
temp_pages=readCookie('adl_visit_pages');
if(temp_pages!=null)
  {var tempVal=temp_pages.indexOf(this_page);}
else {tempVal=-1;}  
if(tempVal==-1){temp_pages=temp_pages+","+this_page; page_visits=1;}else{page_visits=0;}
newCookie_30minuts('adl_visit_pages',temp_pages);  
/**********************************************************************************************************************/

//var trackerPath = (("https:" == document.location.protocol) ? "http://58.68.23.197/WYSEGUYZ/PROJECTS/CURRENT/techwyse/tracker-action/" : "http://58.68.23.197/WYSEGUYZ/PROJECTS/CURRENT/techwyse/tracker-action/");

var trackerPath = (("https:" == document.location.protocol) ? "http://www.techwyse.com/tracker-action/" : "http://www.techwyse.com/tracker-action/");

document.write(unescape("%3Cscript src='" + trackerPath + "visitors-action.php?dm="+hostname+"&pg="+page+"&ip="+address+"&br="+browser+"&os="+os+"&rf="+readCookie('adl_ref')+"&sc="+screen_resolution+"&adl_durl="+readCookie('adl_durl')+"&adl_key="+readCookie('adl_key')+"&adl_camp="+readCookie('adl_camp')+"&total_visits="+total_visits+"&page_visits="+page_visits+"&randnum="+readCookie('adl_rand')+"&curdom="+curdom+"' type='text/javascript'%3E%3C/script%3E"));

/**********************Another way to connect to server side ********************************/
/*
 var GifRequest = function(){
          var url_base = "";
          var gif_name = "http://www.gpablo.com/__req.gif";
          function getParamString(param_arr){
              /**
              * This function creates the string to append to the gif. The last parameter is a timestamp,
              * this ensures that the request is made, preventing the browser from getting the gif from the cache
              */
          /*    var param_str = "?";
              for(key in param_arr){
                  param_str += key + "=" + param_arr[key] + "&";
              }
              param_str += "timestamp=" + getTimeStamp();
              return param_str;
          }
          function getTimeStamp(){
     /**
              * Creates a timestamp string
              */
        /*      var date = new Date();
              return ""+date.getFullYear() + date.getMonth() + date.getDate() + date.getHours() + date.getMinutes() + date.getSeconds();
          }
          return {
              request: function(params){
                  /**
                   * Makes the gif request. Takes 2 parameters:
                   * params: an associative array with the keys as parameter name, and the value as the parameter value
                   */
            /*      var req_img = new Image();
                  req_img.src=url_base + gif_name + getParamString(params);
      
              }
          }
      }();
      
      /*********************************************************************************************/
      /*******************************************************************************************************/
/*      function loader()
		{
			GifRequest.request({
							   'dm':hostname,
							   'pg':page,
							   //'ip':address,
							   'br':browser,
							   'os':os,
							   'rf':referer,
							   'sc':screen_resolution,
							   'adl_durl':readCookie('adl_durl'),
							   'adl_key':readCookie('adl_key'),
							   'adl_camp':readCookie('adl_camp'),
							   'randnum':readCookie('adl_rand')});
		}
      //calling the function to call server side scripting

document.onDOMReady=loader();*/
