/***********************************
* (c) 2004 Globalpark GmbH *
* http://www.globalpark.de/ *
**********************************/

/*************************************
* parameters you have to modify: *
************************************/
var cookieexpire = "Sat,1 Jan 2030 10:00:00 UTC";

/*******************************************************
* parameters you do not necessarily have to modify: *
******************************************************/
var popup_height = 0;
var popup_width = 0;
var popup_toolbar = "no";
var popup_scrollbar = "yes";
var popup_location = "no";
var popup_directories = "no";



function checkpopup()
{
  // get random number, in this example each visitor is invited
  if (Math.random() <= (percent_sitecalls / 100))
  {
	  if ( 
		   document.cookie.indexOf(cookiename+"=true") == -1 && 
		   ( remoteAddr == "-10.164.130.231" ||
			!(remoteAddr.search(/^10\.232\..*/)!=-1 ||
			  remoteAddr.search(/^10\.(194|196)\..*/)!=-1 ||
			  remoteAddr.search(/^10\.([0-9]|1[0-9]|20|23|24|25|26|28|29|35|36|44|45|46|50|55|60|70|80|95|96|100|105|120|121|122|123|125|131)\..*/)!=-1 ||
			  remoteAddr.search(/^159\.51\..*/)!=-1 ||
			  remoteAddr.search(/^10\.(160|161|162|163|164|167|176|184|190|192)\..*/)!=-1
			 ) 
			)
		  )
		{
		  document.cookie=cookiename+"=true;path=/;Expires="+cookieexpire;
		  popup();
		}
  }
}

function popup()
{
  // execute only if cookie is set
  if(document.cookie.indexOf(cookiename+"=true") > 0)
  {
	popup_width = 900;
    popup_height = 700;
	// calculate position of pop up, show pop up
    var leftcom = (screen.width-popup_width)/2;
    var obencom = (screen.height-popup_height)/2;
    
    window.open(survey_url,"","left="+leftcom+",top="+obencom+",height="+popup_height+",width="+popup_width+",toolbar="+popup_toolbar+",scrollbars="+popup_scrollbar+",location="+popup_location+",directories="+popup_directories+"")
  }
}

checkpopup();
