
//==================Character counter script====================================
<!-- Original:  Ronnie T. Moore -->
<!-- Web Site:  The JavaScript Source -->

<!-- Dynamic 'fix' by: Nannette Thacker -->
<!-- Web Site: http://www.shiningstar.net -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else 
countfield.value = maxlimit - field.value.length;
}
//========================================Character Counter End ================
//************************Window launching function*******************************
function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}
//************************/Window launching function*******************************

//=.=.=.=.=.=.=.=.=.=.=.=.=.=.= Cookie functions =.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=
// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

// name - name of the cookie
// [path] - path of the cookie (must be same as path used to create cookie)
// [domain] - domain of the cookie (must be same as domain used to create cookie)
// * path and domain default if assigned null or omitted if no explicit argument proceeds
function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

// date - any instance of the Date object
// * hand all instances of the Date object to this function for "repairs"
function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}
//=.=.=.=.=.=.=.=.=.=.=.=.=.=.= /Cookie functions =.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=

var expDays = 30; // number of days the cookie should last

var page = "only-popup-once.html";
var windowprops = "width=300,height=200,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes";

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 argv = SetCookie.arguments;  
var argc = SetCookie.arguments.length;  
var expires = (argc > 2) ? argv[2] : null;  
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();
}
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function amt(){
var count = GetCookie('count')
if(count == null) {
SetCookie('count','1')
return 1
}
else {
var newcount = parseInt(count) + 1;
DeleteCookie('count')
SetCookie('count',newcount,exp)
return count
   }
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

	//******  Send to friends script ******
	function sendToFriend(){
		var sourceURL
		var newURL
		sourceURL = escape(window.location)
		if (sourceURL.indexOf("dev.interactive") != -1||sourceURL.indexOf("dev.cdm") != -1||sourceURL.indexOf("dev.wcm") != -1) {
			newURL = "http://dev.interactive/Wrapper/SendToFriend.aspx" + "?siteurl=" + sourceURL
		}
		else if (sourceURL.indexOf("interactive.creflodollarministries.org") != -1||sourceURL.indexOf("www.creflodollarministries.org") != -1||sourceURL.indexOf("www.worldchangers.org") != -1) {
			newURL = "http://interactive.creflodollarministries.org/Wrapper/SendToFriend.aspx" + "?siteurl=" + sourceURL
		}
		else if (sourceURL.indexOf("creflodollaministries.org") != -1||sourceURL.indexOf("worldchangers.org") != -1) {
			newURL = "http://interactive.creflodollarministries.org/Wrapper/SendToFriend.aspx" + "?siteurl=" + sourceURL
		}
		else {
			newURL = "http://interactive.creflodollarministries.org/Wrapper/SendToFriend.aspx" + "?siteurl=" + sourceURL
		}
		
		OpenWindow(newURL,'','width=509,height=456')		
	}

	function reportThisPage(){
		var sourceURL
		var newURL
		var sBrowser, sVersion, sPlugins, sPlatform, sVariables
		sourceURL = escape(window.location)
		sBrowser = escape(navigator.appName)
				
		sVersion = escape(navigator.appVersion) 
		//sPlugins = escape(navigator.plugins)
		sPlatform = escape(navigator.platform)
		
		sVariables = "Browser=" + sBrowser
		sVariables += "&Version=" + sVersion
		sVariables += "&Platform=" + sPlatform
		sVariables += "&SiteUrl=" + sourceURL
		//sVariables += "&Plugins=" + sPlugins

		if (sourceURL.indexOf("dev.interactive") != -1||sourceURL.indexOf("dev.cdm") != -1||sourceURL.indexOf("dev.wcm") != -1) {
			newURL = "http://dev.interactive/Wrapper/ReportThisPage.aspx" + "?" + sVariables
		}
		else if (sourceURL.indexOf("interactive.creflodollarministries.org") != -1||sourceURL.indexOf("www.creflodollarministries.org") != -1||sourceURL.indexOf("www.worldchangers.org") != -1) {
			newURL = "http://interactive.creflodollarministries.org/Wrapper/ReportThisPage.aspx" + "?" + sVariables
		}
		else if (sourceURL.indexOf("creflodollaministries.org") != -1||sourceURL.indexOf("worldchangers.org") != -1) {
			newURL = "http://interactive.creflodollarministries.org/Wrapper/ReportThisPage.aspx" + "?" + sVariables
		}
		else {
			newURL = "http://interactive.creflodollarministries.org/Wrapper/ReportThisPage.aspx" + "?" + sVariables
		}
		
		OpenWindow(newURL,'','width=509,height=456')	
	}
	
	function printThisPage(){
		var sourceURL
		var newURL
		sourceURL = escape(window.location)
		if (sourceURL.indexOf("dev.interactive") != -1||sourceURL.indexOf("dev.cdm") != -1||sourceURL.indexOf("dev.wcm") != -1) {
			newURL = "http://dev.interactive/Wrapper/PrintThisPage.aspx" + "?siteurl=" + sourceURL
		}
		else if (sourceURL.indexOf("interactive.creflodollarministries.org") != -1||sourceURL.indexOf("www.creflodollarministries.org") != -1||sourceURL.indexOf("www.worldchangers.org") != -1) {
			newURL = "http://interactive.creflodollarministries.org/Wrapper/PrintThisPage.aspx" + "?siteurl=" + sourceURL
		}
		else if (sourceURL.indexOf("creflodollaministries.org") != -1||sourceURL.indexOf("worldchangers.org") != -1) {
			newURL = "http://interactive.creflodollarministries.org/Wrapper/PrintThisPage.aspx" + "?siteurl=" + sourceURL
		}
		else {
			newURL = "http://interactive.creflodollarministries.org/Wrapper/PrintThisPage.aspx" + "?siteurl=" + sourceURL
		}
		
		window.location = newURL
	}
	
	function getURL() {
		return window.location
	}
	
	function OpenWindow(NewURL,winName,features) { //v2.0
		window.open(NewURL,'',features);
	}
//******  end - Send to friends script ******

//***********************************************************************************************************

/* This is where the popup script thrives! */


// Global Variable
var theDuration = 10; 

// This causes the popup window to close after 10 seconds
function endPopup()
	{
		setTimeout("self.close()",theDuration * 1000);
	}

// Below are the various popups:	
function popUp()
		{
			window.open("../bookstore-popup.html", "banner1", "width=175, height=95, status=no, resizable=no");
		}
		
function popUp2()
		{
			window.open("../online-popup.html", "banner2", "width=175, height=95, status=no, resizable=no");
		}
		
