
// Copyright 2000-2002 SecureIE.com and Capital Intellect Inc

function MaximizeWindow()
{
	top.window.moveTo(0,0);


	if (document.all)
	{
  		top.window.resizeTo(screen.availWidth,screen.availHeight);
	}

	else if (document.layers||document.getElementById)
	{
  		if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
  		{
    		top.window.outerHeight = screen.availHeight;
    		top.window.outerWidth = screen.availWidth;
  		}
	}
}

function SetCookie (cookieName, cookieValue, expiry) 
{
	var expDate = new Date();
	if(expiry)
	{
		expDate.setTime (expDate.getTime() + expiry);
	    document.cookie = cookieName + "=" + escape (cookieValue) + "; expires=" + expDate.toGMTString();
    }
    else
    {
        document.cookie = cookieName + "=" + escape (cookieValue);
	}
}

function GetCookie(CookieName) 
{
  	var CookieString = document.cookie;
  	var CookieSet = CookieString.split (';');
  	var SetSize = CookieSet.length;
  	var CookiePieces
  	var ReturnValue = "";
  	var x = 0;

  	for (x = 0; ((x < SetSize) && (ReturnValue == "")); x++) 
	{
		CookiePieces = CookieSet[x].split ('=');

	    if (CookiePieces[0].substring (0,1) == ' ') 
    	{
    		CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);
	    }

    	if (CookiePieces[0] == CookieName) 
	    {
    		ReturnValue = CookiePieces[1];
	    }
	}
	return ReturnValue;
}

function SetPurchased()
{
	SetCookie("PurchasedSecureIEPrivateIE", 1, 1000 * 60 * 60 * 24 * 14);  // 2 Weeks
}

function UnloadHandler() 
{
	if (GetCookie("PurchasedSecureIEPrivateIE") != 1) 
	{
		CouponWindow=window.open("coupon.htm","CouponWindow","'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=340,height=450'");
	}
}

function LoadHandler() 
{
	MaximizeWindow();

	ToggleState = true;
	speaker.src="http://www.secureie.com/images/speaker_large_on_animated.gif"
	Sound1.TGotoAndPlay('/','start')

	timerRunning = true;
	timerID = self.setTimeout("AudioComplete()", 28000)
}

function Buy1()
{
	SetPurchased();
	window.top.location = "buyboth.htm";
	return false;
}

function Subscribe1()
{
	var SubscribeURL = "subscribe.pl?email=" + emailaddress.value + "&howhear=" + window.location + "&updates=TRUE&productid=SIEPIE Website&source=MCAFEE1_6";
	SubscribeWindow = window.open(SubscribeURL,"SubscribeWindow","'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=100,height=80'");
	SubscribeWindow.close();
	
	window.open("subscribed.htm","SubscribedWindow","'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=600'");
	return false;
}

function TestFileDownload()
{
	TestFileDownloadWindow=window.open("testfiledownload.htm","TestFileDownloadWindow","'width=400,height=600,scrollbars=1'");
}

function CookiesEnabled()
{
	var cookies = (window.navigator.cookieEnabled);
	if (cookie ==true) {return true};

}

function ToggleAudio()
{
	if (ToggleState == true) 
	{
		speaker.src="http://www.secureie.com/images/speaker_large_off.gif"
		Sound1.TGotoAndPlay('/','stop');
		ToggleState = false;

		if (timerRunning)
		{
			clearTimeout(timerID);
			timerRunning = false;
		}
	}
	else
	{
		speaker.src="http://www.secureie.com/images/speaker_large_on_animated.gif"
		Sound1.TGotoAndPlay('/','start');
		ToggleState = true;
		
		if (timerRunning)
		{
			clearTimeout(timerID);
			timerRunning = false;
		}
		
		timerRunning = true;
		timerID = self.setTimeout("AudioComplete()", 28000)
	}
}

function AudioComplete()
{
	if (timerRunning)
	{
		clearTimeout(timerID);
		timerRunning = false;
	}
	
	speaker.src="http://www.secureie.com/images/speaker_large_on.gif"
}
