
/*
 * client info
 */
var PLATFORM = navigator.appVersion.toLowerCase();
var CLIENT = navigator.appName.toLowerCase();
var VERSION = parseInt (navigator.appVersion);
var AOLCLIENT = (navigator.userAgent.indexOf ("AOL") != -1) ? 1 : 0;
var AOLUA = AOLCLIENT ? 1 : 0;
var DOCREF = document.referrer.slice((document.referrer.indexOf("//") + 2),document.referrer.indexOf(".",document.referrer.indexOf(".") + 1));
var BASE = "http://www.growthtrac.com";



// used for the cgi templates (omitted the email feature)
function topUtilities3 () {
bookmark2();
homepage2();
}


// $(document).ready(function(){
// $('a[href*=#]:not([href=#])').click(function() {
// if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
// && location.hostname == this.hostname) {
// var $target = $(this.hash);
// $target = $target.length && $target
// || $('[name=' + this.hash.slice(1) +']');
// if ($target.length) {
// var targetOffset = $target.offset().top;
// $('html,body')
// .animate({scrollTop: targetOffset}, 1000);
// return false;
// }}});}); 


// launches Floatbox -- called directly and from subcookie.js
// As of 2009-April floatbox replaces lytepop, The code is still here for legacy.

function subbox() {
fb.loadAnchor('http://www.growthtrac.com/_subscribe.php', 'width:460 height:390 scrolling:no');
}

function subbox02() {
fb.loadAnchor('http://www.growthtrac.com/_tagcloud.php', 'width:670 height:400 scrolling:no');
}

function subbox03() {
fb.loadAnchor('http://www.growthtrac.com/includes/ajax_01.htm', 'width:670 height:400 scrolling:no');
}

function subbox04() {
fb.loadAnchor('http://www.growthtrac.com/includes/ajax_03.htm', 'width:670 height:600 scrolling:no');
}

function subbox05() {
fb.loadAnchor('http://www.growthtrac.com/includes/ajax_02.htm', 'width:570 height:250 scrolling:no');
}

function subbox06() {
fb.loadAnchor('http://www.growthtrac.com/includes/ajax_mm.htm', 'width:570 height:500 scrolling:no');
}

function subbox07() {
fb.loadAnchor('http://www.growthtrac.com/includes/ajax_kgp.htm', 'width:570 height:400 scrolling:no');
}

function subbox08() {
fb.loadAnchor('http://www.growthtrac.com/includes/ajax_365.htm', 'width:570 height:600 scrolling:no');
}

function subbox09() {
fb.loadAnchor('http://www.growthtrac.com/includes/ajax_prov.htm', 'width:570 height:450 scrolling:no');
}

function subbox10() {
fb.loadAnchor('http://www.growthtrac.com/includes/ajax_liv.htm', 'width:570 height:300 scrolling:no');
}

function subbox11() {
fb.loadAnchor('http://www.growthtrac.com/includes/ajax_rss.htm', 'width:460 height:350 scrolling:no');
}

// recent articles
function subbox12() {
fb.loadAnchor('http://www.growthtrac.com/includes/ajax_recent.php', 'width:400 height:200 scrolling:no');
}


// most read
function subbox13() {
fb.loadAnchor('http://www.growthtrac.com/includes/ajax_most-read.php', 'width:400 height:250 scrolling:no');
}


// top topics
function subbox14() {
fb.loadAnchor('http://www.growthtrac.com/includes/ajax_top-topics.php', 'width:400 height:200 scrolling:no');
}

// contact
function subbox15() {
fb.loadAnchor('http://www.growthtrac.com/includes/ajax_contact.htm', 'width:400 height:200 scrolling:no');
}


// map
function subbox16() {
fb.loadAnchor('http://www.growthtrac.com/includes/ajax_map.htm', 'width:600 height:300 scrolling:no');
}

// radio about
function subbox17() {
fb.loadAnchor('http://www.growthtrac.com/includes/ajax_radioabout.htm', 'width:425 height:325 scrolling:no');
}

// contest rules, date night
function subbox18() {
fb.loadAnchor('http://www.growthtrac.com/includes/ajax_contestrules.htm', 'width:650 height:550 scrolling:no');
}

//  date night promo from home page
function subbox20() {
fb.loadAnchor('http://www.growthtrac.com/includes/ajax_datepromo.htm', 'width:585 height:240 scrolling:no');
}

// date examples
function subbox19() {
fb.loadAnchor('http://www.growthtrac.com/includes/ajax_date-examples.htm', 'width:650 height:450 scrolling:yes');
}

function subbox21() {
fb.loadAnchor('http://www.growthtrac.com/splash_contest02.php', 'width:460 height:300 scrolling:no');
}



//  Lytebox
function lytepop() {
var a = document.createElement("a");
a.href = "http://www.growthtrac.com/_contact.php";
a.rel = "lyteframe";
a.title = "";
a.rev = "width: 460px; height: 390px; scrolling: no;";
myLytebox.start(a,false,true);
}

function lytepop02() {
var a = document.createElement("a");
a.href = "http://www.growthtrac.com/_tagcloud.php";
a.rel = "lyteframe";
a.title = "";
a.rev = "width: 670px; height: 400px; scrolling: no;";
myLytebox.start(a,false,true);
}

// myLytebox.start(a,false,true);

function DoHomepagePop(newpage) {
        window.open ('http://www.growthtrac.com/pop_homepage.php','name','scrollbars=no,status=no,resizable=no,width=620,height=364');
}




// version for email validation only
function verifyform02 (optin)
     {
      //email
       if ((document.optin.email.value == "") || 
        (document.optin.email.value.indexOf('@') == -1) || 
        (document.optin.email.value.indexOf('.') == -1)) {
        alert("Please verify your email address.");
        return false;
        }
	}



	

function printpage() {
var pagetoprint = "http://www.growthtrac.com/printpage.php?page="+escape(window.location);
document.write('<table cellpadding="0" cellspacing="0" border="0"><tr><td><a href="' +pagetoprint+ '"><img src="http://www.growthtrac.com/images/icon_print3.gif" width="102" height="12" border="0" alt="Print this Page"></a></td></tr></table>');
}



/*
 * flash detect
 */

var isFlash = 0;
if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ) {
	var plugin = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
	if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".") - 1)) >= 4) isFlash = 1;
} else if (CLIENT != "netscape" && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\>\n');
	document.write('on error resume next\n');
	document.write('isFlash = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))\n');
	document.write('</SCRIPT\>\n');
}

/*
 * popup cookie ********************************
 */


<!-- Begin
var expDays = 15; // number of days the cookie should last

var page    = "http://www.growthtrac.com/pop_eharmony.php";
var windowprops  = "width=550,height=320,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no";

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));
}

function checkCount() {
var count = GetCookie('count');
if (count == null) {
count=1;
SetCookie('count', count, exp);

window.open(page, "", windowprops);

}
else {
count++;
SetCookie('count', count, exp);
   }
}


/*
 * 20-april-2004 (Below) launchpopup is for eHarmony flash popup on Premarried channel********************************
 */

function launchpopup() {
if ( browserAcceptsCookies() && isFlash ) 
  checkCount(); }
 

function browserAcceptsCookies() {
	var acceptsCookies = false;
	if ( document.cookie == '' ) {
		document.cookie = 'acceptsCookies=yes'; // Try to set a cookie.
		if ( document.cookie.indexOf( 'acceptsCookies=yes' ) != -1 ) {
			acceptsCookies = true;
		} // If it succeeds, set variable
	} else { // there was already a cookie
		acceptsCookies = true;
	}
	
	return ( acceptsCookies );
}

//  End -->


//babelfish
function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}



function emailFriend_generic() {
var newpage = "http://www.growthtrac.com/emailfriend_generic.htm" +
"?" +
"title=" + escape(document.title) +
"&" +
"fullpath=" + escape(window.location);
window.open (newpage,'name','scrollbars=no,status=no,resizable=no,width=635,height=515');
}	 




function MM_findObj(n, d) { //v4.0
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_preloadImages() { //v3.0
	var d=document; 
	if(d.images) {
		if(!d.MM_p) d.MM_p=new Array();
			var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
		for(i=0; i<a.length; i++)
			if (a[i].indexOf("#")!=0) {
				d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
			}
	}
}

function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
