Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Hardware>>UPDATE: My mouse over pop up question

UPDATE: My mouse over pop up question

techgearfree
02-03-2005, 10:47 PM
Ok, so I wanted to do this:

http://www.dynamicdrive.com/dynamicindex4/imagetooltip.htm

Now, I changed my index.php to:


<html>
<head>
<script language="javascript" type="text/javascript">
<!--

/*
Image w/ description tooltip- By Dynamic Web Coding (www.dyn-web.com)
Copyright 2002 by Sharon Paine
Visit http://www.dynamicdrive.com for this script
*/

/* IMPORTANT: Put script after tooltip div or
put tooltip div just before </BODY>. */

var dom = (document.getElementById) ? true : false;
var ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ns4 = (document.layers && !dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;

// resize fix for ns4
var origWidth, origHeight;
if (ns4) {
origWidth = window.innerWidth; origHeight = window.innerHeight;
window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

/////////////////////// CUSTOMIZE HERE ////////////////////
// settings for tooltip
// Do you want tip to move when mouse moves over link?
var tipFollowMouse= true;
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 160;
var offX= 20; // how far from mouse to show tip
var offY= 12;
var tipFontFamily= "Verdana, arial, helvetica, sans-serifhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
var tipFontSize= "8pthttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
// set default text color and background color for tooltip here
// individual tooltips can have their own (set in messages arrays)
// but don't have to
var tipFontColor= "#000000http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
var tipBgColor= "#DDECFF";
var tipBorderColor= "#000080http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
var tipBorderWidth= 3;
var tipBorderStyle= "ridgehttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
var tipPadding= 4;

// tooltip content goes here (image, description, optional bgColor, optional textcolor)
var messages = new Array();
// multi-dimensional arrays containing:
// image and text for tooltip
// optional: bgColor and color to be sent to tooltip
messages[0] = new Array('red_balloon.gif','Here is a red balloon on a white background',"#FFFFFF");
messages[1] = new Array('duck2.gif','Here is a duck on a light blue background.',"#DDECFF");
messages[2] = new Array('test.gif','Test description','black','white');

//////////////////// END OF CUSTOMIZATION AREA ///////////////////

// preload images that are to appear in tooltip
// from arrays above
if (document.images) {
var theImgs = new Array();
for (var i=0; i<messages.length; i++) {
theImgs[i] = new Image();
theImgs[i].src = messages[i][0];
}
}

// to layout image and text, 2-row table, image centered in top cell
// these go in var tip in doTooltip function
// startStr goes before image, midStr goes between image and text
var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';
var midStr = '" border="0"></td></tr><tr><td valign="top">';
var endStr = '</td></tr></table>';

////////////////////////////////////////////////////////////
// initTip - initialization for tooltip.
// Global variables for tooltip.
// Set styles for all but ns4.
// Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
var tooltip, tipcss;
function initTip() {
if (nodyn) return;
tooltip = (ns4)? document.tipDiv.document: (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
tipcss = (ns4)? document.tipDiv: tooltip.style;
if (ie4||ie5||ns5) { // ns4 would lose all this on rewrites
tipcss.width = tipWidth+"pxhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
tipcss.fontFamily = tipFontFamily;
tipcss.fontSize = tipFontSize;
tipcss.color = tipFontColor;
tipcss.backgroundColor = tipBgColor;
tipcss.borderColor = tipBorderColor;
tipcss.borderWidth = tipBorderWidth+"pxhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
tipcss.padding = tipPadding+"pxhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
tipcss.borderStyle = tipBorderStyle;
}
if (tooltip&&tipFollowMouse) {
if (ns4) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = trackMouse;
}
}

window.onload = initTip;

/////////////////////////////////////////////////
// doTooltip function
// Assembles content for tooltip and writes
// it to tipDiv
/////////////////////////////////////////////////
var t1,t2; // for setTimeouts
var tipOn = false; // check if over tooltip link
function doTooltip(evt,num) {
if (!tooltip) return;
if (t1) clearTimeout(t1); if (t2) clearTimeout(t2);
tipOn = true;
// set colors if included in messages array
if (messages[num][2]) var curBgColor = messages[num][2];
else curBgColor = tipBgColor;
if (messages[num][3]) var curFontColor = messages[num][3];
else curFontColor = tipFontColor;
if (ns4) {
var tip = '<table bgcolor="' + tipBorderColor + '" width="' + tipWidth + '" cellspacing="0" cellpadding="' + tipBorderWidth + '" border="0"><tr><td><table bgcolor="' + curBgColor + '" width="100%" cellspacing="0" cellpadding="' + tipPadding + '" border="0"><tr><td>'+ startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr + '</td></tr></table></td></tr></table>';
tooltip.write(tip);
tooltip.close();
} else if (ie4||ie5||ns5) {
var tip = startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr;
tipcss.backgroundColor = curBgColor;
tooltip.innerHTML = tip;
}
if (!tipFollowMouse) positionTip(evt);
else t1=setTimeout("tipcss.visibility='visible'",100);
}

var mouseX, mouseY;
function trackMouse(evt) {
mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
if (tipOn) positionTip(evt);
}

/////////////////////////////////////////////////////////////
// positionTip function
// If tipFollowMouse set false, so trackMouse function
// not being used, get position of mouseover event.
// Calculations use mouseover event position,
// offset amounts and tooltip width to position
// tooltip within window.
/////////////////////////////////////////////////////////////
function positionTip(evt) {
if (!tipFollowMouse) {
mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
}
// tooltip width and height
var tpWd = (ns4)? tooltip.width: (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
var tpHt = (ns4)? tooltip.height: (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
// document area in view (subtract scrollbar width for ns)
var winWd = (ns4||ns5)? window.innerWidth-20+window.pageXOffset: document.body.clientWidth+document.body.scrollLeft;
var winHt = (ns4||ns5)? window.innerHeight-20+window.pageYOffset: document.body.clientHeight+document.body.scrollTop;
// check mouse position against tip and window dimensions
// and position the tooltip
if ((mouseX+offX+tpWd)>winWd)
tipcss.left = (ns4)? mouseX-(tpWd+offX): mouseX-(tpWd+offX)+"pxhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
else tipcss.left = (ns4)? mouseX+offX: mouseX+offX+"pxhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if ((mouseY+offY+tpHt)>winHt)
tipcss.top = (ns4)? winHt-(tpHt+offY): winHt-(tpHt+offY)+"pxhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
else tipcss.top = (ns4)? mouseY+offY: mouseY+offY+"pxhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
if (!tooltip) return;
t2=setTimeout("tipcss.visibility='hidden'",100);
tipOn = false;
}

//-->
</script>

</head>

<body>
<a href=http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/"#" onmouseover="doTooltip(event,0)" onmouseout="hideTip()">http://www.techgearfree.com/images/money.gif</a><br>
</body>
</html>
<div id="tipDiv" style="position:absolute; visibility:hidden; z-index:100"></div>

<?php

$ipforcookie = $_SERVER['REMOTE_ADDR'];

if(! isset($_COOKIE['ipcookie']))
{
setcookie("ipcookie",$ipforcookie, time() +315569260);
}

define('IN_RAFS', true);
include 'sessions.php';


if ( $_SESSION['username'] != "" ) {
header("Location: http://" . $_SERVER['HTTP_HOST']
. dirname($_SERVER['PHP_SELF'])
. "offers.php");
}



include 'includes/header.php';
$year = date("Y");

if (isset($_GET['referral'])) {
$referral = $_GET['referral'];

$sql = "SELECT email
FROM users WHERE `id` = '$referral'http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if( !($result = $db->sql_query($sql)) )
{
die("Could not query referral information");
}

while ( $row = $db->sql_fetchrow($result) )
{
$referral_email2 = $row['email'];
}
$referral_text = "<BR>You are being referred by <B>" . $referral_email2 . "</B>http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";

}
else {
$referral = 0;
}

//
// Get referrals into a table
//
$username = $_SESSION['username'];
if ($_SESSION['username'] != '') {
$refs .= '<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"><center><span class="genmed">' . $overview . '</span></center></td>
</tr>
<tr>
<td width=\"0\">ID #</td>
<td width=\"0\">Email</td>
<td width=\"0\">Status</td></tr>
';
$check = '0';

$sql = "SELECT *
FROM offer_credit WHERE `user_id` = '$user_id'http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if( !($result = $db->sql_query($sql)) )
{
die("Could not query user offer credit information");
}

$result2 = $db->sql_numrows($result);

if ( $result2 != 0 ) {
$offer_complete2 = "You have completed your offerhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}
else {
$offer_complete2 = "You have not completed your offerhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}

$sql = "SELECT *
FROM users WHERE id = '$user_id'http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if( !($result = $db->sql_query($sql)) )
{
die("Could not query user information");
}

while ( $row = $db->sql_fetchrow($result) )
{
$user_status = $row['status'];
}

if ( $user_status == 4 ) {
$offer_complete2 .= ", and your account is on hold.http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}

$sql = "SELECT *
FROM users WHERE referral = '$user_id'http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if( !($result = $db->sql_query($sql)) )
{
die("Could not query users referrals information");
}

while ( $row = $db->sql_fetchrow($result) )
{
$check = $check + 1;
$rowid = $row['id'];
$referral_offer = "<img src=http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/\"" . $CONFIG['OFFER_NOT_COMPLETED_IMAGE'] . "\">&nbsp;&nbsp;No offer completedhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
$sql3 = "SELECT *
FROM offer_credit WHERE `user_id` = '$rowid'http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if( !($result3 = $db->sql_query($sql3)) )
{
die("Could not query referral information");
}

while ( $row3 = $db->sql_fetchrow($result3) )
{
$referral_offer = "<img src=http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/\"" . $CONFIG['OFFER_COMPLETED_IMAGE'] . "\">&nbsp;&nbsp;Completed " . $row3['offer_name'] . " Offerhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}

if ( $row['status'] == 4 ) {
$referral_offer = "<img src=http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/\"" . $CONFIG['OFFER_ON_HOLD_IMAGE'] . "\">&nbsp;&nbsp;User is on Holdhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}

$refs .= "<tr>
<td width=\"0\">" . $row['id'] . "</td>
<td width=\"0\">" . $row['email'] . "</td>
<td width=\"0\">" . $referral_offer . "</td>
</tr>http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}
}

$refs .= "</table>http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";

if ($check == 0) {
$refs = 'No Referrals';
}


if ( $_SESSION['username'] == "" ) {
$sql = "SELECT *
FROM itemshttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if( !($result = $db->sql_query($sql)) )
{
die("Could not query items");
}

$first_item = "yeshttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
$td_position = 1;

while ( $row = $db->sql_fetchrow($result) )
{
if ( $td_position == 1 ) {
$items_table = $items_table . "<tr>http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}
$items_table = $items_table . "
<td width=\"16%\" class=\"choice\">
<img src=http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/\"" . $row['image'] . "\" border=\"0\"><br />
" . $row['name'] . " (" . $row['referrals'] . " Referrals)<br /><input type=\"radio\" name=\"item\" value=http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/\"" . $row['id'] . "\"http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if ( $first_item == "yes" ) {
$items_table = $items_table . " checked>http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}
else {
$items_table = $items_table . ">http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}
$items_table = $items_table . "</td>http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if ( $td_position == 3 ) {
$items_table = $items_table . "</tr>http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}
$first_item = "nohttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";

$td_position++;

if ( $td_position == 4 ) {
$td_position = 1;
}

}
}


$tvars = array(
'SITE_TITLE' => $CONFIG['SITE_TITLE'],
'SITE_DESCRIPTION' => $CONFIG['SITE_DESCRIPTION'],
'PRODUCT' => $CONFIG['PRODUCT'],
'PRODUCT_IMAGE' => $CONFIG['PRODUCT_IMAGE'],
'YEAR' => $year,
'STEPS' => $CONFIG['STEPS'],
'REFERRAL' => $referral,
'REFERRAL_EMAIL' => $referral_text,
'REFERRALS' => $refs,
'USER_COMPLETED_OFFER' => $offer_complete2,
'ITEMS_TABLE' => $items_table
);
pparse('index');
include 'includes/footer.php';
?>





and you can see what happens here: www.techgearfree.com

I am trying to get that image to get the pop up and not the link. The index page has a template and I do not know if I should have messed with that. Its code is:





<!-- Begin_switch_logged_out -->
<tr>
<td width="10%">
</td>

<td width="80%" class="box">
<center>
<img src=http://www.codingforums.com/archive/index.php/"/images/select.gif"><FORM action="register.php" method="get">
<table width="100%" cellspacing="3" cellpadding="2" border="0">

<tr>
<td width="16%" class="choice">
<img src=http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/"/images/money.gif" border="0"><br />
$450 Check<br /><input type="radio" name="item" value="$450 Check">
</td>
</tr>
</table>
</center>
</td>

<td width="10%">
</td>
</tr>

<tr>
<td colspan="3">
<br />
</td>
</tr>

<tr>
<td width="10%">
</td>

<td width="80%" class="box">
<center>
<img src=http://www.codingforums.com/archive/index.php/"../Application%20Data/Ipswitch/WS_FTP/Application%20Data/Ipswitch/WS_FTP/Storage/images/complete.gif">{REFERRAL_EMAIL}<br /><br />
Your E-Mail Address:
<input type="text" class="input" name="email" size="50"><br /><br />
<INPUT type=hidden value="{REFERRAL}" name=referral>
<input type="submit" class="input" value="Register"></form><br /><br />
</center>
</td>

<td width="10%">
</td>
</tr>
<!-- End_switch_logged_out -->

<!-- Begin_switch_logged_in -->
<tr>
<td width="10%">
</td>

<td width="80%" class="box">
<center>
<B>Welcome back to {SITE_TITLE}, {USERNAME}!<BR>
Below you can see your status for your free {PRODUCT}.</B>


</center>
</td>

<td width="10%">
</td>
</tr>

<tr>
<td colspan="3">
<br />
</td>
</tr>

<tr>
<td width="10%">
</td>

<td width="80%" class="box">
<center>
{USER_COMPLETED_OFFER}
</center>
</td>

<td width="10%">
</td>
</tr>

<tr>
<td colspan="3">
<br />
</td>
</tr>

<tr>
<td width="10%">
</td>

<td width="80%" class="box">
<center>
Referrals:<hr>{REFERRALS}

</center>
</td>

<td width="10%">
</td>
</tr>

<!-- End_switch_logged_in -->



Thank you.

Willy Duitt
02-03-2005, 11:15 PM
So... What was the original problem and question??
Why did you start another thread which prevents someone from following what has previously transpired... Seems all rather counter-productive... Are you now expecting someone, whom is willing to help you, to search and find the original thread so that they have a complete picture of what is going on?? :rolleyes:

.....Willy

techgearfree
02-03-2005, 11:33 PM
I am sorry, I thought it might be better if I re explained my question because in the previous thread, : http://www.codingforums.com/showthread.php?t=51244 I had started with just asking how to do a mouse over, and then I actually got a script for it. Now, I am trying to implement it.

Sorry for the confusion :confused:

techgearfree
02-04-2005, 06:49 PM
I thought this would be an easy question.

techgearfree
02-04-2005, 08:50 PM
I have been working on this all day, and might be alittle closer, but just need some help.

So, my index.tpl file is the template and displays all the items.

It looks like this:

<!-- Begin_switch_logged_out -->
<tr>
<td width="10%">
</td>

<td width="80%" class="box">
<center>
<img src=http://www.codingforums.com/archive/index.php/"images/select.gif"><FORM action="register.php" method="get">
<table width="100%" cellspacing="3" cellpadding="2" border="0">

<td width="16%" class="choice">
<img src=http://www.codingforums.com/archive/index.php/"images/money.gif" border="0"><br />
$450 Check<br /><input type="radio" name="item" value="$450 Check">
</td>
</table>
</center>
</td>

<td width="10%">
</td>
</tr>

<tr>
<td colspan="3">
<br />
</td>
</tr>

<tr>
<td width="10%">
</td>

<td width="80%" class="box">
<center>
<img src=http://www.codingforums.com/archive/index.php/"images/complete.gif">{REFERRAL_EMAIL}<br /><br />
Your E-Mail Address:
<input type="text" class="input" name="email" size="50"><br /><br />
<INPUT type=hidden value="{REFERRAL}" name=referral>
<input type="submit" class="input" value="Register"></form><br /><br />
</center>
</td>

<td width="10%">
</td>
</tr>
<!-- End_switch_logged_out -->

<!-- Begin_switch_logged_in -->
<tr>
<td width="10%">
</td>

<td width="80%" class="box">
<center>
<B>Welcome back to {SITE_TITLE}, {USERNAME}!<BR>
Below you can see your status for your free {PRODUCT}.</B>


</center>
</td>

<td width="10%">
</td>
</tr>

<tr>
<td colspan="3">
<br />
</td>
</tr>

<tr>
<td width="10%">
</td>

<td width="80%" class="box">
<center>
{USER_COMPLETED_OFFER}
</center>
</td>

<td width="10%">
</td>
</tr>

<tr>
<td colspan="3">
<br />
</td>
</tr>

<tr>
<td width="10%">
</td>

<td width="80%" class="box">
<center>
Referrals:<hr>{REFERRALS}

</center>
</td>

<td width="10%">
</td>
</tr>

<!-- End_switch_logged_in -->

All it is doing is showing one picture (money.gif).

Now, in the php file for the page, I have:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script language="javascript" type="text/javascript">
<!--

/*
Image w/ description tooltip- By Dynamic Web Coding (www.dyn-web.com)
Copyright 2002 by Sharon Paine
Visit http://www.dynamicdrive.com for this script
*/

/* IMPORTANT: Put script after tooltip div or
put tooltip div just before </BODY>. */

var dom = (document.getElementById) ? true : false;
var ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ns4 = (document.layers && !dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;

// resize fix for ns4
var origWidth, origHeight;
if (ns4) {
origWidth = window.innerWidth; origHeight = window.innerHeight;
window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

/////////////////////// CUSTOMIZE HERE ////////////////////
// settings for tooltip
// Do you want tip to move when mouse moves over link?
var tipFollowMouse= true;
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 160;
var offX= 20; // how far from mouse to show tip
var offY= 12;
var tipFontFamily= "Verdana, arial, helvetica, sans-serifhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
var tipFontSize= "8pthttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
// set default text color and background color for tooltip here
// individual tooltips can have their own (set in messages arrays)
// but don't have to
var tipFontColor= "#000000http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
var tipBgColor= "#DDECFF";
var tipBorderColor= "#000080http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
var tipBorderWidth= 3;
var tipBorderStyle= "ridgehttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
var tipPadding= 4;

// tooltip content goes here (image, description, optional bgColor, optional textcolor)
var messages = new Array();
// multi-dimensional arrays containing:
// image and text for tooltip
// optional: bgColor and color to be sent to tooltip
messages[0] = new Array('red_balloon.gif','Here is a red balloon on a white background',"#FFFFFF");
messages[1] = new Array('duck2.gif','Here is a duck on a light blue background.',"#DDECFF");
messages[2] = new Array('test.gif','Test description','black','white');

//////////////////// END OF CUSTOMIZATION AREA ///////////////////

// preload images that are to appear in tooltip
// from arrays above
if (document.images) {
var theImgs = new Array();
for (var i=0; i<messages.length; i++) {
theImgs[i] = new Image();
theImgs[i].src = messages[i][0];
}
}

// to layout image and text, 2-row table, image centered in top cell
// these go in var tip in doTooltip function
// startStr goes before image, midStr goes between image and text
var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';
var midStr = '" border="0"></td></tr><tr><td valign="top">';
var endStr = '</td></tr></table>';

////////////////////////////////////////////////////////////
// initTip - initialization for tooltip.
// Global variables for tooltip.
// Set styles for all but ns4.
// Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
var tooltip, tipcss;
function initTip() {
if (nodyn) return;
tooltip = (ns4)? document.tipDiv.document: (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
tipcss = (ns4)? document.tipDiv: tooltip.style;
if (ie4||ie5||ns5) { // ns4 would lose all this on rewrites
tipcss.width = tipWidth+"pxhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
tipcss.fontFamily = tipFontFamily;
tipcss.fontSize = tipFontSize;
tipcss.color = tipFontColor;
tipcss.backgroundColor = tipBgColor;
tipcss.borderColor = tipBorderColor;
tipcss.borderWidth = tipBorderWidth+"pxhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
tipcss.padding = tipPadding+"pxhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
tipcss.borderStyle = tipBorderStyle;
}
if (tooltip&&tipFollowMouse) {
if (ns4) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = trackMouse;
}
}

window.onload = initTip;

/////////////////////////////////////////////////
// doTooltip function
// Assembles content for tooltip and writes
// it to tipDiv
/////////////////////////////////////////////////
var t1,t2; // for setTimeouts
var tipOn = false; // check if over tooltip link
function doTooltip(evt,num) {
if (!tooltip) return;
if (t1) clearTimeout(t1); if (t2) clearTimeout(t2);
tipOn = true;
// set colors if included in messages array
if (messages[num][2]) var curBgColor = messages[num][2];
else curBgColor = tipBgColor;
if (messages[num][3]) var curFontColor = messages[num][3];
else curFontColor = tipFontColor;
if (ns4) {
var tip = '<table bgcolor="' + tipBorderColor + '" width="' + tipWidth + '" cellspacing="0" cellpadding="' + tipBorderWidth + '" border="0"><tr><td><table bgcolor="' + curBgColor + '" width="100%" cellspacing="0" cellpadding="' + tipPadding + '" border="0"><tr><td>'+ startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr + '</td></tr></table></td></tr></table>';
tooltip.write(tip);
tooltip.close();
} else if (ie4||ie5||ns5) {
var tip = startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr;
tipcss.backgroundColor = curBgColor;
tooltip.innerHTML = tip;
}
if (!tipFollowMouse) positionTip(evt);
else t1=setTimeout("tipcss.visibility='visible'",100);
}

var mouseX, mouseY;
function trackMouse(evt) {
mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
if (tipOn) positionTip(evt);
}

/////////////////////////////////////////////////////////////
// positionTip function
// If tipFollowMouse set false, so trackMouse function
// not being used, get position of mouseover event.
// Calculations use mouseover event position,
// offset amounts and tooltip width to position
// tooltip within window.
/////////////////////////////////////////////////////////////
function positionTip(evt) {
if (!tipFollowMouse) {
mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
}
// tooltip width and height
var tpWd = (ns4)? tooltip.width: (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
var tpHt = (ns4)? tooltip.height: (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
// document area in view (subtract scrollbar width for ns)
var winWd = (ns4||ns5)? window.innerWidth-20+window.pageXOffset: document.body.clientWidth+document.body.scrollLeft;
var winHt = (ns4||ns5)? window.innerHeight-20+window.pageYOffset: document.body.clientHeight+document.body.scrollTop;
// check mouse position against tip and window dimensions
// and position the tooltip
if ((mouseX+offX+tpWd)>winWd)
tipcss.left = (ns4)? mouseX-(tpWd+offX): mouseX-(tpWd+offX)+"pxhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
else tipcss.left = (ns4)? mouseX+offX: mouseX+offX+"pxhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if ((mouseY+offY+tpHt)>winHt)
tipcss.top = (ns4)? winHt-(tpHt+offY): winHt-(tpHt+offY)+"pxhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
else tipcss.top = (ns4)? mouseY+offY: mouseY+offY+"pxhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
if (!tooltip) return;
t2=setTimeout("tipcss.visibility='hidden'",100);
tipOn = false;
}

//-->
</script>
</head>

<body>
<a href=http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/"#" onmouseover="doTooltip(event,0)" onmouseout="hideTip()"><img src=http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/"/images/money.gif" border="0"><br /></a><br>
</body>
</html>
<div id="tipDiv" style="position:absolute; visibility:hidden; z-index:100"></div>
<?php

$ipforcookie = $_SERVER['REMOTE_ADDR'];

if(! isset($_COOKIE['ipcookie']))
{
setcookie("ipcookie",$ipforcookie, time() +315569260);
}

define('IN_RAFS', true);
include 'sessions.php';


if ( $_SESSION['username'] != "" ) {
header("Location: http://" . $_SERVER['HTTP_HOST']
. dirname($_SERVER['PHP_SELF'])
. "offers.php");
}



include 'includes/header.php';
$year = date("Y");

if (isset($_GET['referral'])) {
$referral = $_GET['referral'];

$sql = "SELECT email
FROM users WHERE `id` = '$referral'http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if( !($result = $db->sql_query($sql)) )
{
die("Could not query referral information");
}

while ( $row = $db->sql_fetchrow($result) )
{
$referral_email2 = $row['email'];
}
$referral_text = "<BR>You are being referred by <B>" . $referral_email2 . "</B>http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";

}
else {
$referral = 0;
}

//
// Get referrals into a table
//
$username = $_SESSION['username'];
if ($_SESSION['username'] != '') {
$refs .= '<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"><center><span class="genmed">' . $overview . '</span></center></td>
</tr>
<tr>
<td width=\"0\">ID #</td>
<td width=\"0\">Email</td>
<td width=\"0\">Status</td></tr>
';
$check = '0';

$sql = "SELECT *
FROM offer_credit WHERE `user_id` = '$user_id'http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if( !($result = $db->sql_query($sql)) )
{
die("Could not query user offer credit information");
}

$result2 = $db->sql_numrows($result);

if ( $result2 != 0 ) {
$offer_complete2 = "You have completed your offerhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}
else {
$offer_complete2 = "You have not completed your offerhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}

$sql = "SELECT *
FROM users WHERE id = '$user_id'http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if( !($result = $db->sql_query($sql)) )
{
die("Could not query user information");
}

while ( $row = $db->sql_fetchrow($result) )
{
$user_status = $row['status'];
}

if ( $user_status == 4 ) {
$offer_complete2 .= ", and your account is on hold.http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}

$sql = "SELECT *
FROM users WHERE referral = '$user_id'http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if( !($result = $db->sql_query($sql)) )
{
die("Could not query users referrals information");
}

while ( $row = $db->sql_fetchrow($result) )
{
$check = $check + 1;
$rowid = $row['id'];
$referral_offer = "<img src=http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/\"" . $CONFIG['OFFER_NOT_COMPLETED_IMAGE'] . "\">&nbsp;&nbsp;No offer completedhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
$sql3 = "SELECT *
FROM offer_credit WHERE `user_id` = '$rowid'http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if( !($result3 = $db->sql_query($sql3)) )
{
die("Could not query referral information");
}

while ( $row3 = $db->sql_fetchrow($result3) )
{
$referral_offer = "<img src=http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/\"" . $CONFIG['OFFER_COMPLETED_IMAGE'] . "\">&nbsp;&nbsp;Completed " . $row3['offer_name'] . " Offerhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}

if ( $row['status'] == 4 ) {
$referral_offer = "<img src=http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/\"" . $CONFIG['OFFER_ON_HOLD_IMAGE'] . "\">&nbsp;&nbsp;User is on Holdhttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}

$refs .= "<tr>
<td width=\"0\">" . $row['id'] . "</td>
<td width=\"0\">" . $row['email'] . "</td>
<td width=\"0\">" . $referral_offer . "</td>
</tr>http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}
}

$refs .= "</table>http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";

if ($check == 0) {
$refs = 'No Referrals';
}


if ( $_SESSION['username'] == "" ) {
$sql = "SELECT *
FROM itemshttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if( !($result = $db->sql_query($sql)) )
{
die("Could not query items");
}

$first_item = "yeshttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
$td_position = 1;

while ( $row = $db->sql_fetchrow($result) )
{
if ( $td_position == 1 ) {
$items_table = $items_table . "<tr>http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}
$items_table = $items_table . "
<td width=\"16%\" class=\"choice\">
<img src=http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/\"" . $row['image'] . "\" border=\"0\"><br />
" . $row['name'] . " (" . $row['referrals'] . " Referrals)<br /><input type=\"radio\" name=\"item\" value=http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/\"" . $row['id'] . "\"http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if ( $first_item == "yes" ) {
$items_table = $items_table . " checked>http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}
else {
$items_table = $items_table . ">http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}
$items_table = $items_table . "</td>http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
if ( $td_position == 3 ) {
$items_table = $items_table . "</tr>http://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";
}
$first_item = "nohttp://www.codingforums.com/archive/index.php/http://www.codingforums.com/archive/index.php/";

$td_position++;

if ( $td_position == 4 ) {
$td_position = 1;
}

}
}


$tvars = array(
'SITE_TITLE' => $CONFIG['SITE_TITLE'],
'SITE_DESCRIPTION' => $CONFIG['SITE_DESCRIPTION'],
'PRODUCT' => $CONFIG['PRODUCT'],
'PRODUCT_IMAGE' => $CONFIG['PRODUCT_IMAGE'],
'YEAR' => $year,
'STEPS' => $CONFIG['STEPS'],
'REFERRAL' => $referral,
'REFERRAL_EMAIL' => $referral_text,
'REFERRALS' => $refs,
'USER_COMPLETED_OFFER' => $offer_complete2,
'ITEMS_TABLE' => $items_table
);
pparse('index');
include 'includes/footer.php';
?>



What I did was try to have the money.gif image do the popup.

But, it doesn't popup over the money picture loaded by the tpl. It loads another money picture and that one pops up.

This is the site in action:

www.techgearfree.com

Can anyone help?


 

TOP

For more info

setting a minimum size
Auto Preview of Image 
Refresh with a query s
JS Validation obsolete
Javascript Pop up func
Slide show transitions
I'm a newbie...please!
how to write coding in
Advanced Debug Info 
.js file doesn't work 

News Archive

Adding Graphic To Text
re-direct form after s
pop up window controls
Clock on homepage - He
passing a param from a
Password Procection wi
document.title in same
focus onload 
Counting Wrong from Ri
Help needed on how to 

Related stories:

write to an html file dynamically?
FireFox doesn't recognize history.go(-1)
Changing e.keyCode (e.which)
Clearing a range created by element.createTextRange()
I am having problem with this script!!!
Creating Handlers
"Login ID" pass over to subsequent pages visited
Checkbox to manipulate Form Field

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics