home *** CD-ROM | disk | FTP | other *** search
/ Boot Disc 4 / boot-disc-1996-12.iso / Apps / Fusion / T2.Z / script_layout.txt < prev    next >
Text File  |  1996-08-23  |  3KB  |  88 lines

  1. <script language="JavaScript">
  2. <!--
  3. var expires = new Date();
  4. //expire in 30 days
  5. expires.setTime(expires.getTime() + 24 * 60 * 60 * 30 * 1000);
  6. var expiryDate = expires.toGMTString();
  7. window.name = "netobjects_main_power";
  8. var netobjects_nav = expires.getTime();
  9.  
  10. function newCookie(name, value){
  11.   document.cookie = name + "=" + value + "; expires=" + expiryDate;
  12. }
  13.  
  14. function readCookie(name){
  15.   var cookieFound = false;
  16.   var start = 0;
  17.   var end = 0;
  18.   var cookieString = document.cookie;
  19.   var i = 0;
  20.   while (i <= cookieString.length){
  21.     start =i;
  22.     end = start + name.length;
  23.     if (cookieString.substring(start,end) == name){
  24.       cookieFound = true;
  25.       break;
  26.     }
  27.     i++;
  28.   }     
  29.   if (cookieFound){
  30.     start = end + 1;
  31.     end = document.cookie.indexOf(";",start);
  32.     if (end < 0){
  33.       end = document.cookie.length;
  34.     }
  35.     else if (end < start){
  36.       end = document.cookie.length;
  37.     }
  38.     return document.cookie.substring(start,end);
  39.   }
  40.   return '';
  41. }
  42.  
  43.  
  44. function go(){
  45. //use time to create navigator name(allow random)
  46.   var locs="";
  47.   var loc = location.pathname;
  48.   var pos = loc.lastIndexOf("/");
  49.   loc = loc.substring(0,pos);
  50.   if (loc.lastIndexOf("html") == pos - 4) { locs = "../";   }
  51.  
  52.   if (navigator.userAgent.substring(0,9) != "Mozilla/2"){
  53.    //3.0 and above
  54.  
  55.     var WinName = window.open(locs+'assets/applets/sitemapper.html','netobjects_nav','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,copyhistory=0,width=385,height=335');
  56.     newCookie("netobjects_main",window.name);
  57.   }
  58.   else if  (window.name == "netobjects_main_power"){
  59.     //2.0 re-entry position - main window already have name
  60.  
  61.     if((location.protocol.substring(0,4) == "file")  && (navigator.userAgent.substring(0,23) == "Mozilla/2.0 (compatible")){
  62.        alert("Internet Explorer is not supported under local mode.");
  63.     }
  64.     else {
  65.       var ex =  new Date();    
  66.       var objects_nav = ex.getTime();
  67.       var WinName = window.open(locs+'assets/applets/sitemapper.html',netobjects_nav,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,copyhistory=0,width=385,height=335');
  68.     }
  69.   }
  70.   else {
  71.     var ex =  new Date();    
  72.     var objects_nav = ex.getTime();
  73.     //2.0
  74.     var Replace = window.open(window.location,"netobjects_main_power");
  75.     newCookie("netobjects_main",Replace.name);    
  76.     var WinName = window.open(locs+'assets/applets/sitemapper.html',netobjects_nav,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,copyhistory=0,width=385,height=335');
  77.     window.close();
  78.   }
  79. }
  80. //-->
  81. </script>
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.