function openCS(url) 
{
	popupWin = window.open(url, 'openWin', "width=800, height=500, scrollbars=yes, resizable=yes"); 
	popupWin.focus();
} 
function Launch(page) { 

OpenWin = this.open(page, "The Campaigner Challenge", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=500,height=500"); 

}
function sendme()
	{
	referrer = encodeURI(document.location.href);
		window.open( "/scripts/ForwardArticle.pl?referrer=" + referrer , "formwindow", "toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=no,width=389, height=350" );
		
	}
	function talkToMe(){
	sesame = window.open('http://server.iad.liveperson.net/hc/53334311/?VISITORVAR!JumpPage=CAMPAIGNERPRO&SESSIONVAR!skill=SALES&cmd=file&file=visitorWantsToChat&site=53334311&referrer='+document.location,'chat53334311','width=472,height=320');
}

	function openQuiz(url) 
{
	popupWin = window.open(url, 'openWin', "width=500, height=650, scrollbars=yes, resizable=yes"); 
} 


function MM_swapImgRestore() 
{ 
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() 
{ 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) 
{
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() 
{ 
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function openWindow(url) 
{
	popupWin = window.open(url, 'openWin', "width=400, height=250, scrollbars=yes, resizable=yes"); 
}  

function openLink(url) 
{
	popupWin = window.open(url, 'openWin', "width=730, height=500, scrollbars=yes, resizable=yes"); 
	popupWin.focus();
} 
function openWeb(url) 
{
	popupWin = window.open(url, 'openWin', "width=675, height=625, scrollbars=yes, resizable=yes"); 
	popupWin.focus();
} 
function openWeb2(url) 
{
	popupWin = window.open(url, 'openWin', "width=725, height=575, scrollbars=yes, resizable=yes"); 
	popupWin.focus();
} 
function Tour()
{
    var Demo = window.open('http://education.gotcorp.com/tour/index.html',"demo",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=700,height=455');
    Demo.focus();
}

function Movie()
{
    var Movie = window.open('http://education.gotcorp.comeducation/bd/',"movie",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=643,height=420');
    Movie.focus();
}

function doButtons(picimage) 
{
	document['picture'].src=picimage;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function Newsletter()
{
      var Newsletter = window.open('http://www.gotcorp.com/archive/2005.html',"newsletter",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=700,height=575,top=50,left=50');
      Newsletter.focus();
}

function openBuilder(url) 
{ 
	var popupWin = window.open(url, "openWin", "width=446, height=505,scrollbars=yes,resizable=yes");
	popupWin.focus(); 
} 

function openWindow(url) 
{ 
	var popupWin = window.open(url, "openWin", "width=500, height=440,scrollbars=yes,resizable=yes");
	popupWin.focus(); 

}


function createCookie(name,value,days)
{
	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 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 eraseCookie(name)
{
	createCookie(name,"",-1);
} 

// ---
// parameters

getParameters();

// ---
// organisation

var org_id = "-75";
var passed_org_id = getValueByName("org_id");

if( passed_org_id == "" )
{
	org_id = "-75";
	var cookie_org_id = readCookie("org_id");
	if (cookie_org_id == "") createCookie("org_id", org_id, 5*365);
}
else
{
	org_id = passed_org_id;
	createCookie("org_id", org_id, 5*365);	
}

org_id = readCookie("org_id");

// ---
// store the HTTP referer

var actualReferer = (typeof document.referrer == 'undefined') ? '' : document.referrer;

var visitor_id = "0";
var passed_visitor_id = getValueByName("visitor_id");

if( passed_visitor_id != "" )
{
	visitor_id = passed_visitor_id;
	createCookie("visitor_id", visitor_id, 5*365);	
}
else
{
	var referers = new Array();
	/*referers["http://www.messagia.com"] = 6;
	referers["http://www.ffwd.com"] = 7;
	referers["http://www.smartsi.com"] = 8;
	referers["http://www.gotmarketing.com"] = 9;
	referers["http://www.gotcorp.com"] = 11;
	referers["http://campaigner.com"] = 12;
	referers["http://partners.gotcorp.com"] = 13;
	referers["http://www.campaignerpro.com"] = 14;
	referers["http://www.campaigner.com/cforce"] = 15;
	referers["http://education.gotcorp.com"] = 16;
	referers["http://library.gotcorp.com"] = 17;
	referers["http://clients.gotcorp.com"] = 18;
	referers["http://www.campaigner.com/?testdrive_1"] = 1;*/
	referers["http://www.google.com/search?"] = 10;
	referers["http://www.google.ca/search?"] = 11;
	referers["http://www.google.co.uk/search?"] = 12;
	referers["http://search.msn.com"] = 20;
	referers["http://search.yahoo.com/search"] = 30;
	var foundVisitor = 0;
	for (var searchReferer in referers) {
		if (actualReferer.indexOf(searchReferer) != -1) {
			foundVisitor = referers[searchReferer];
		}
	}
	if (foundVisitor > 0) createCookie("visitor_id", foundVisitor, 5*365);
}

visitor_id = readCookie("visitor_id");

/* -- REMOVED!

var cookie_value = document.cookie;
if( cookie_value.indexOf( "org_id" ) == -1 )
{
	document.cookie = "org_id=" + org_id;
}

var cookies = document.cookie;
var visitor_id = 0;
if( cookies.indexOf( "visitor_id=" ) != -1 )
{
	var semicolon = cookies.indexOf( ";", cookies.indexOf( "visitor_id=" ) );
	if( semicolon == -1 )
		visitor_id = cookies.substring( cookies.indexOf( "visitor_id=" ) + 11 );
	else
		visitor_id = cookies.substring( cookies.indexOf( "visitor_id=" ) + 11, semicolon );

}

*/

