/*
$Log:   E:/users/ftu/sources/pvcsproj/website/welcome.jsv  $
*
*   Rev 6.1   Jan 26 2002 23:49:04   fturi
*expand window size for long URI
*
*   Rev 6.0   Jan 23 2002 16:37:44   fturi
*add ISP localisation style
*tested against ie 5.0, ie5.5 and ie6.0
*corrected error due to change of behavior
*of writeln with new releases of ie.
*Better use of pvcs information in tail
*Reorganisation of index
*Add information of root by properties
*
*   Rev 5.21   Dec 02 2001 23:43:20   fturi
*cosmetic correction
*
*   Rev 5.20   Aug 09 2001 00:19:02   fturi
*ready for g2r1c1
*
*   Rev 5.19   Aug 04 2001 22:00:30   fturi
*resize the screen of opening
*
*   Rev 5.18   Aug 02 2001 00:42:36   fturi
*some enhancement and proof reading and
*html 4.0 links
*
*
*   Rev 5.17   Aug 01 2001 00:41:36   fturi
*fabrication version g2r1c1 (5.17)
*creation of a pure dynamic version based on index.html only
*recreation of a pure non dynamic version based on mainframe ...
*update welcome for this release
*corrected about and help for navigator
*index is functionnal for nav and ie
*corrected charte.css to integrate root behavior !
*modified nothing to allow netscape to add text based
*on a corect css version
*modified toolbar to attach (create) css for ie version
*
*   Rev 5.15   Jul 30 2001 00:39:38   fturi
*another approch to welcome them
*
*   Rev 5.14   Jul 22 2001 17:14:36   fturi
*safer version
*
*   Rev 5.13   Jul 22 2001 17:08:24   fturi
*refine math
*
*   Rev 5.9   Jul 16 2001 14:17:20   fturi
*bug fix
*
*   Rev 5.8   Jul 16 2001 13:06:22   fturi
*hide counter
*
*   Rev 5.7   Jul 04 2001 22:09:50   fturi
*added cookie handling for silent browsing
*
*   Rev 5.6   Apr 30 2001 16:42:56   fturi
*Add Cookie to vary page ID behaviour
*
*   Rev 5.5   Apr 29 2001 23:43:04   fturi
*HTML 4.0 compliance + welcome js window +revision information
*/

function getCookie(sName)
	{
	// cookies are separated by semicolons
	var aCookie = top.document.cookie.split("; ");
	for (var i=0; i < aCookie.length; i++)
		{
		// a name/value pair (a crumb) is separated by an equal sign
		var aCrumb = aCookie[i].split("=");
		if (sName == aCrumb[0])
		return unescape(aCrumb[1]);
		}
	// a cookie with the requested name does not exist
	return null;
   	}
function initCounter()
	{
    s="na";c="na";j="na";f=""+escape(document.referrer)
    if ("undefined" != typeof(navigator) && "undefined" != typeof(screen))
    	{
		s=screen.width;
		v=navigator.appName
		if (v != "Netscape")
			{c=screen.colorDepth}
		else
			{c=screen.pixelDepth}
		j=navigator.javaEnabled()
		}
	}
function pr(n) {document.write(n,"\n");}
function PageID(pID)
	{
	var isNetscape=false;
	if ("Netscape" == navigator.appName)
		isNetscape=true;
	if (null==pID || ""==pID)
		return isNetscape;
	initCounter();
	NS2Ch=0;
	if (isNetscape && navigator.appVersion.charAt(0) == "2")
		{NS2Ch=1}
	if (NS2Ch == 0)
		{
		r="&size="+s+"&colors="+c+"&referer="+f+"&java="+j+""
		}
	cookCounter=getCookie("FturiCounter");
	switch (cookCounter)
		{
		case "3":
			pr("<br><h6>Counter Reference is:id="+pID+r+"</h6>");
			break;
		case "2":
			pr("<br>");
			break;
		case "1":
		case "0":
		case "null":
		default:
			pr("<br><a href=\"http://www.TheCounter.com\" TARGET=\"_top\">");
			pr("<img BORDER=0 HEIGHT=1 WIDTH=1 SRC=\"http://c1.thecounter.com/id="+pID+r+"\"></a>");
			break;
		}
	return isNetscape;
	}


/*
	index: 			181274	`/	!!
	mainframe:		181274		!!
	sitemap			181274		!!

	resume: 		181326	`/	!!
	pq optim:		181392	`/	!!
	ora security:	181456	`/	!!
	y2k:			181479	`/	!!
					181491			Unix Note

	cv: 			181495	`/	!!
	ora surete: 	181507	`/	!!
	use lisp:		181512	N'existe Pas

target="_self" href="#top @1@190001@181274@"
avec @1 = 1 sous niveau

@190001:
PPID
	EN				1*****
	FR				2*****
		Aix			 10***
		 data		 12
		 ip			 15
		 notes		 18
		 frame		 19
		C			 20***
		Oracle		 30***
		Resume		 40***
		frame		 90***

et 181274 ancien cpt

<br><a id="pvcs" name=Revision title="$Revision:   6.1  $" target="_self" href="#top@1@190001@181274@">Last Update : $Date:   Jan 26 2002 23:49:04  $</a>
*/
isWelcomeDone=false;
function welcome(theRoot,pID)
{
	var isNetscape=false;
	if (isWelcomeDone)
		return;
	else
		isWelcomeDone=true;
	isNetscape=PageID(pID);
	if (top.window==window && 0==top.frames.length)
		{
		if ("on"==getCookie("FturiShut"))
			window.status="alone:"+window.location;
		else
			{
			//alert("standalone"+top.window.name);
			top.Welcome=true;
			introWindow=null;
			introWindow=window.open("about:blank","welcomeWindow",
				"resizable=yes,width=360,height=170,toolbar=no,scrollbars=auto,menubar=no,location=no");
			if (null!=introWindow)
				{
				var Iindex;
				introWindow.window.close();
				introWindow=window.open("about:blank","welcomeWindow",
					"resizable=yes,width=360,height=170,toolbar=no,scrollbars=auto,menubar=no,location=no");
				//introWindow.document.writeln('<html>');
				top.introWindow=introWindow;

				if (null==theRoot)
					{
					var theanchor=null;
					if (isNetscape)
						{
						il=document.links.length;
						for (i=il-1;i>=0;i--)
							if ("_self"==document.links[i].target)
								{
								theanchor=document.links[i];
								break;
								}
							//else alert(theanchor.href);
						}
					else
						{
						theanchor=document.getElementById("pvcs");
						}
					if (theanchor.hash)
						{
						var tokens=theanchor.hash.split("@",2);
						if (tokens.length>1)
							{
							theRoot="";
							im=Math.min(tokens[1],4);
							for (i=0;i<im;i++)
								theRoot+="../";
							}
						if (tokens.length>2)
							pID=tokens[2];
						}
					//alert(theRoot);
					}

				if (isNetscape)
					{
					isp_home=theRoot;
					isp_http=".";
					if (null==theRoot) //&& ("file:" != window.location.protocole))
						{
						Iindex=isp_http+'/';
						isp_home=isp_http;
						}
					else
						Iindex=theRoot;
					}
				else
					{
					isp_home=top.document.body.htc_find_prop("#isp_link","ispT",true)+'/';
					isp_http=top.document.body.htc_find_prop("#isp_link","ispU",true);
					if (null==theRoot) //&& ("file:" != window.location.protocole))
						Iindex=isp_http+'/';
					else
						Iindex=theRoot;
					}
				//alert(theRoot);
				IndexHome="'"+Iindex+"index.html'";
				IndexMain="'"+Iindex+"mainframe.htm'";
				if ("undefined"==typeof(window.screen))
					IndexDim="";
				else
					IndexDim=',"","location=yes,toolbar=yes,scollbars=yes,resizable=yes,menubar=yes,top=0,left=0,width='+
						(window.screen.availWidth-10)+',height='+(window.screen.availHeight-160)+'"';
				introWindow.document.writeln(
					'<html><head><title>Follow the Guide ...</title></head>');
				introWindow.document.writeln(
					 '<h4>Welcome!.<br>This page is part of my website. You can visit it by'
					+' clicking this: <a href="javascript:go('+IndexHome+')" title="javascript version">'
					+'[<big>'+isp_home+'index.html</big>]</a>'
					+'or <a href="javascript:go('+IndexMain+')" title="non javascript version" >'
					+'[<big>'+isp_home+'mainframe.htm</big>]</a><br><br>'
					+'</h4><i><a href="javascript:shutup()" title="set up a cookie to make sure this window doesnt prompt again">'
					+'close this window </a></i><br></body>'
					+'<script>function go(x) {toto=window.open(x'+IndexDim+');close();}'
					+'function shutup(){var t=new Date();var e=new Date(t.getTime() + 86400000);'
					+'top.document.cookie = "FturiShut=on;path=/;expires="+e.toGMTString();close();}'
					+'</script></html>');
				//	);
				//introWindow.document.writeln(
				}
			}
		}
	else
		window.status="location:"+window.location;
}
setTimeout("welcome(null,null)",500,"JScript");
//alert("3.4="+Math.floor(3.4409404));
oldFloor=Math.floor;
fM=true;
Math.floor=function(x)
{
if (fM)
	{
	//alert("first");
	fM=false;
	window.status="href:"+window.location;
	return Number.NaN;
	}
else
	{
	//alert("second");
	Math.floor=oldFloor;
	//alert(Math.floor);
	//alert("3.4="+Math.floor(3.4404004));
	window.status="zone:"+window.location;
	return Number.NaN;
	}
}
/* file welcome.js fin*/