Mourning the loss of our friend, WhitPhil.
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Web Design & Development
Tag Cloud
access audio black screen blue screen boot bsod connection crash dell desktop drivers dvd email error excel firefox hard drive hardware hijackthis internet keyboard laptop malware monitor motherboard network networking outlook problem ram recovery router safe mode screen slow sound spyware tdlwsp.dll trojan upgrade vba video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
JavaScript Fails to run

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
flockit's Avatar
Junior Member with 1 posts.
 
Join Date: Apr 2009
Experience: Intermediate
03-Apr-2009, 12:14 AM #1
Question JavaScript Fails to run
Hello,

Below is the code of my "default.php"

Code:
<?php include ("header-execute.php"); ?>
<script src="privatec.js" />

<html>
  <head>
    <title>Private Chat</title>
  </head>
  <body>
    <map id="close" name="close">
      <area shape="rect" coords="262, 3, 282, 18" href="closeWin();">
    </map>
    <div id="mainWIN">
      <center><img src="_logo_.bmp"><center>
      <br />
      <br />
      Welcome, <b><?= $_COOKIE["FFBPCName"]; ?></b>
      <br />
      <br />
    </div>
    <div id="hide" style="display:none; position:absolute">
      <div id="top">
        <img src="about:blank" usemap="#close" id="tI" width="22">
      </div>
      <div id="bottom">
        <iframe width="22" src="about:blank" height="200" id="bI">
      </div>
    </div>
  </body>
</html>
<?php include ("checklogin.php"); ?>
And the "privatec.js" contains:-

Code:
// FaceFunBook JScript file
// FaceFunBook Private Chat JScript File
// Using the file without permission is highly punitive

// Thanks to
// http://www.dynamicdrive.com/forums/showthread.php?t=23936

var Centralize = {

init:function(id)
{
obj = document.getElementById(id);
this.MoveObject(obj);
},

MoveObject:function(obj)
{
this.GetCentralPoints() //Get current viewpoint numbers
obj.style.left = this.scroll_left+(this.docwidth-obj.offsetWidth)/2+"px";
obj.style.top = this.scroll_top+(this.docheight-obj.offsetHeight)/2+"px";
},

GetCentralPoints:function(){ //get window viewpoint numbers
var ie=document.all && !window.opera
var domclientWidth=document.documentElement && parseInt(document.documentElement.clientWidth) || 100000 //Preliminary doc width in non IE browsers
this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
this.scroll_top=(ie)? this.standardbody.scrollTop : window.pageYOffset
this.scroll_left=(ie)? this.standardbody.scrollLeft : window.pageXOffset
this.docwidth=(ie)? this.standardbody.clientWidth : (/Safari/i.test(navigator.userAgent))? window.innerWidth : Math.min(domclientWidth, window.innerWidth-16)
this.docheight=(ie)? this.standardbody.clientHeight: window.innerHeight
}

};

// Declaration - Start

var timer1;
var timer2;
var run = 0;
var login = false;

// Declarations - End

// Functions - Start

function loginInvoke()
{
  login = true;
  run = 2;
  document.background = "bg_off.bmp";
  document.getElementById("bI").src = "http://privchat.facefunbook.com/login.php";
  document.getElementById("tI").src = "http://privchat.facefunbook.com/ajax/imgs/login.bmp";
  document.getElementById("hide").style.display = "";
  document.getElementById("mainWIN").style.display = "none";
  Centralize.init('hide');
  window.onscroll = "Centralize.init('hide');";
  document.onscroll = "Centralize.init('hide');";
}

function closeInvoke()
{
  if ( login == true )
  {
    document.background = "";
    location.replace("http://www.facefunbook.com/");
  }
  else
  {
    document.background = "";
    document.getElementById("bI").src = "about:blank";
    document.getElementById("tI").src = "about:blank";
    document.getElementById("hide").style.display = "none";
    document.getElementById("mainWIN").style.display = "";
    window.onscroll = "";
    document.onscroll = "";
  }
}

function logoutInvoke()
{
  login = false;
  run = 1;
  document.background = "bg_off.bmp";
  document.getElementById("bI").src = "http://privchat.facefunbook.com/logout.php";
  document.getElementById("tI").src = "http://privchat.facefunbook.com/ajax/imgs/logout.bmp";
  document.getElementById("hide").style.display = "";
  document.getElementById("mainWIN").style.display = "none";
  Centralize.init('hide');
  window.onscroll = "Centralize.init('hide');";
  document.onscroll = "Centralize.init('hide');";
}

function cStatusInvoke()
{
  login = false;
  run = 3;
  document.background = "bg_off.bmp";
  document.getElementById("bI").src = "http://privchat.facefunbook.com/status.php";
  document.getElementById("tI").src = "http://privchat.facefunbook.com/ajax/imgs/status.bmp";
  document.getElementById("hide").style.display = "";
  document.getElementById("mainWIN").style.display = "none";
  Centralize.init('hide');
  window.onscroll = "Centralize.init('hide');";
  document.onscroll = "Centralize.init('hide');";
}

// Functions - End
Thanks a lot !!
Closed Thread Bookmark and Share

Tags
design, javascript, php, web

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 01:10 AM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.