/* Version 1.3.2

	ROL/SOCITM Survey Code

	Copyright (c) ROL/SOCITM

	Modified by VJKL to work with jQuery 1.2.6
*/

var socitm_my_domains = "www.worthing.gov.uk,selfservice.worthing.gov.uk,www.icon.worthing.gov.uk,discover.worthing.gov.uk";
var socitm_custcode = "416";
var socitm_intro_file = "/lib/socitm_intro.html";
var socitm_language_opt = '';

var socitm_ratio = 5;
var socitm_popup = "";
var socitm_my_domains_tmp = "";
var socitm_popup_css = "";
var socitm_protocol = "http:";
var cookie_suffix = "2";

var Page_Enter;
var TimeLimit = 20;
var Page_ShowPopOnExit = false;
var Page_ExternalDest = '';
var Page_InternalDest = '';

if (socitm_my_domains_tmp.length > 0) { socitm_my_domains = socitm_my_domains_tmp; }
var r = Math.floor(Math.random() * (typeof(socitm_ratio) != "undefined" ? socitm_ratio : 5));

if ((document.location.search.indexOf("SocitmForcePop") > -1)||(r == 0) || (getCookie("socitm_include_me") == "true")) {
    
    document.write('<script type="text/javascript" src="'+ socitm_protocol +'//socitm.govmetric.com/js/socitm_popups.aspx"><\/script>');
    document.write('<link rel="stylesheet" type="text/css" href="'+ socitm_protocol +'//socitm.govmetric.com/css/socitm.css" />');
    if ((document.location.search.indexOf("SocitmForcePop") > -1) || ((getCookie("socitm_exclude_me") != "true") && (getCookie("socitm_include_me") != "true"))) {
        document.write('<script type="text/javascript" src="http://socitm.govmetric.com/popcounter.aspx?code=' + socitm_custcode + '&lang_code=' + socitm_language_opt +'"><\/script>');
    }
}

function getCookie(c_name)
{
	if (document.cookie.length>0)
	{
		c_start=document.cookie.indexOf(c_name+cookie_suffix+"=");
		if (c_start!=-1)
		{ 
			c_start=c_start+c_name.length+cookie_suffix.length+1; 
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		} 
	}
	return "";
}

function setCookie(c_name,value,expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+cookie_suffix+"=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString()) +";path=/";
}
