
var newWindow;
var tsu;
tsu = "tsunami_emdr.html";

function popalert(mylink, windowname)
{
return null;
if (document.location == "http://www.changingstates.co.uk") return null;
if (document.location == "http://www.changingstates.co.uk/") return null;
if (document.location == "http://www.changingstates.co.uk/index.html") return null;
if (document.location == "file:///C:/Hypnosis/changing_states/index.html") return null;
if (document.location == "file:///C:/Hypnosis/changing_states/hs~index.html") return null;
if (readCookie("csalvi") == "Done") return null;
dl_var = "Done";
createCookie("csalvi",dl_var,300);
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
	href=mylink;
else
	href=mylink.href;
	window.open(href, windowname, 'top=200, left=200, width=550, height=400, scrollbars=yes, resizable=yes');
	//openPlainWin(href,windowname,500,400,200,200)
return false;
}


function openPlainWin(thisURL,winName,winWidth,winHeight,xPos,yPos) {
  if (!newWindow || newWindow.closed) {
    winOpts = "width=" + winWidth + ",height=" + winHeight + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes";
    if (xPos != "") winOpts += ",screenX=" + xPos + ",left=" + xPos;
    if (yPos != "") winOpts += ",screenY=" + yPos + ",top=" + yPos;
    newWindow = window.open("",winName,winOpts);
    newWindow.location.href = thisURL;
    if (!newWindow.opener) {
      newWindow.opener = window;
    }
  }
  else {
    // window's already open; bring to front
    newWindow.focus();
    newWindow.location.href = thisURL;
  }
}


function right(e) {
if (navigator.appName == 'Netscape' && 
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' && 
(event.button == 2 || event.button == 3)) {
alert("Copyright Changing States 2012");
return false;
}
return true;
}
document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;


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 ""; 
	//-- return null;
}

function eraseCookie(name)
{
	createCookie(name,"",-1);
}


