trigger = new Image();
var ie=document.all;

function changeto(highlightcolor){
if (ie) {
	source=event.srcElement
	if (source.tagName=="TR"||source.tagName=="TABLE")
	return
	while(source.tagName!="TD")
	source=source.parentElement
	if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
	source.style.backgroundColor=highlightcolor
}
}

function changeback(originalcolor){
if (ie) {
	if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")
	return
	if (event.toElement!=source)
	source.style.backgroundColor=originalcolor
}
}

function NoteWire() {

	var name = "";
	var mail = "";
	var message = "";

	name = prompt("Your Name:","");
	if (!name || name == "" || name == null) { alert("No name given, action cancelled."); return false; }

	mail = prompt("Your E-Mail Address:","");
	if (!mail || mail == "" || mail == null) { alert("No e-mail address given, action cancelled."); return false; }

	message = prompt("Type your message:","");
	if (!message || message == "" || message == null) { alert("No message given, action cancelled."); return false; }

	var myurl = "http://www.jumpx.com/notewire.php";
	trigger.src = myurl+"?name="+escape(name)+"&mail="+escape(mail)+"&message="+escape(message);
	trigger.onload = new Function(alert("Your message was sent successfully!"));
}

var domain = ".jumpx.com";
var autoreply = "newsletter@leadlightning.com";


if (GetCookie("counter") == null) SetCookie("counter","0")
SetCookie("counter",parseInt(GetCookie("counter"))+1);

var popuptext = "Subscribe to JumpX E-Magazine.\n\nRegularly distributed PHP tips, sample scripts, and tools.\nDigest invaluable web programming information.\n\nIt's free to join.  Click OK to opt-in.";

//var formcode = "<form name='popupform' action='mailto:" + autoreply + "?subject=subscribe' method='post' enctype='text/plain'></form>";
//document.write(formcode);

function CheckMe() {
	if (GetCookie("counter") == 1)
		popMe();
}

function popMe() {
	if (confirm(popuptext))
		//document.popupform.submit();
		document.popupform.gonow.click();
	else return true;
}

function getCookieVal (offset) {  
var endstr = document.cookie.indexOf (";", offset);  
if (endstr == -1)    
endstr = document.cookie.length;  
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {  
var arg = name + "=";  
var alen = arg.length;  
var clen = document.cookie.length;  
var i = 0;  
while (i < clen) {    
var j = i + alen;    
if (document.cookie.substring(i, j) == arg)      
return getCookieVal (j);    
i = document.cookie.indexOf(" ", i) + 1;    
if (i == 0) break;   
}  
return null;
}
function SetCookie (name, value) { 
	
var expDays = 365;
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

var argv = SetCookie.arguments;  
var argc = SetCookie.arguments.length;  
var expires = exp  
var path = (argc > 3) ? argv[3] : null;  
//var domain = (argc > 4) ? argv[4] : null;  
var secure = (argc > 5) ? argv[5] : false;  
document.cookie = name + "=" + escape (value) + 
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
((path == null) ? "" : ("; path=" + path)) +  
((domain == null) ? "" : ("; domain=" + domain)) +    
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {  
var exp = new Date();  
exp.setTime (exp.getTime() - 1);  
var cval = GetCookie (name);  
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}