// Inline clickthrough
function jumpmenu(targ,selObj,restore){ //v3.0
  var mpath =
location.pathname.substring(0,location.pathname.lastIndexOf("/"));
  var normPath = selObj.options[selObj.selectedIndex].value;
var goThere = normPath;
eval(targ+".location='"+ goThere +"'");
  if (restore) selObj.selectedIndex=0;
}
// javascript email validation
function badEmail(theEmail)
{
	var sEmail = "" + theEmail;
  	if (sEmail) {
	if (sEmail.indexOf('@') == -1) return true;
	if (sEmail.indexOf('.') == -1) return true;
	}
}
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 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 set_name(form) {
        var expdate = new Date ();
        // Below line expires cookie in 7 days
        expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000 * 7));
        // Below line expires cookie in 77 days
        expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000 * 77));
        // Below line expires cookie in 17 days
        expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000 * 17));
        SetCookie ("GSeZineviewed", "seen", expdate);
        }
function show_name() {
    if(GetCookie("GSeZineviewed") != null)
    {var donothing=0;}
// There is some CSS conflict with dhtmlwindow.js script, and need to comment out below until fixed
      else {
      var googlewin=dhtmlwindow.open("googlebox", "iframe", "http://www.greatskin.com/join_pop.php3", "Sign up for exclusive offers", "width=458px,height=355px,resize=1,scrolling=1,center=1", "recal");
      set_name("GSezine");
      	}
}

// Cookie for cart last modified: 5/24/04 by NET MAN
// All of the below is for setting cookies to determine sales figures
 // setup some locals for this setting routine
 var refer;
 var expdate = new Date();
 expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 300));
 var locationrefer = location.pathname;
var qstring = "";
// First check to see if this visitor already has an identity
var is_set;
if(!(is_set = GetCookie("Referer")))
 {
// Below to set cookie based on Referrer variable from SSI
var refer = "(none)";
if (refer != "(none)")
{
var pos = refer.indexOf("greatskin.com");
var pos2 = refer.indexOf("greatskin-anti-aging.com");
var pos3 = refer.indexOf("securesites.com");
var here = refer.indexOf("none");
if ((pos == -1) && (pos2 == -1) && (pos3 == -1) && (here == -1))
 {
SetCookie("Referer", refer, expdate, "/", ".greatskin.com", false);
 }
} // end of routine to set cookie based on referring URL
} // end of routine if cookie is NOT set

// Below sets cookie if current DOM location includes yh.htm
var adrefer = locationrefer.indexOf("yh.htm");
if (adrefer != -1)
  {
SetCookie("Referer", "http://Yahoo_Paid_Ads.com", expdate, "/", ".greatskin.com", false);
  } // End of setting Yahoo cookie

// NET MAN 006 For some reason the below causes problems on home page
	// Below sets cookie if current DOM location includes ov.htm which overrides
	// referring URL to let us know sales based on Overture.com listings
	// And, the cookie gets set regardless of whether a previous cookie is in place
	var adreferOverture = locationrefer.indexOf("ov.htm");
	if (adreferOverture != -1)
	  {
	SetCookie("Referer", "http://Overture_Paid_Listings.com", expdate, "/", ".greatskin.com", false);
	  } // End of setting Overture cookie


// Below sets cookie if current DOM location includes goo.htm which overrides
// referring URL to let us know sales based on Google.com listings
// And, the cookie gets set regardless of whether a previous cookie is in place
var adreferGoogle = locationrefer.indexOf("goo.htm");
if (adreferGoogle != -1)
  {
SetCookie("Referer", "http://Google_Paid_Listings.com", expdate, "/", ".greatskin.com", false);
  } // End of setting Google cookie


// Below sets cookie if current DOM location includes ?.*google which overrides
// referring URL to let us know sales based on Google.com listings
// And, the cookie gets set regardless of whether a previous cookie is in place
var adqueryGoogle = qstring.indexOf("google");
if (adqueryGoogle != -1)
  {
SetCookie("Referer", "http://Google_Paid_Listings.com", expdate, "/", ".greatskin.com", false);
  } // End of setting Google cookie


// Below sets cookie if current DOM location includes ?.*shopping_com which overrides
// referring URL to let us know sales based on Shopping.com listings
// And, the cookie gets set regardless of whether a previous cookie is in place
var adqueryShopping = qstring.indexOf("shopping_com");
if (adqueryShopping != -1)
  {
SetCookie("Referer", "http://Shopping_com_Listings.com", expdate, "/", ".greatskin.com", false);
  } // End of setting Shopping.com cookie


// Below sets cookie if current DOM location includes ?.*mondera which overrides
// referring URL to let us know sales based on Mondera.com listings
// And, the cookie gets set regardless of whether a previous cookie is in place
var adqueryMondera = qstring.indexOf("mondera");
if (adqueryMondera != -1)
  {
SetCookie("Referer", "http://Mondera_Link_2005MothersDay.com", expdate, "/", ".greatskin.com", false);
  } // End of setting Mondera cookie


// Below sets cookie if current DOM location includes ?nl601 which overrides
// referring URL to let us know sales based on Jan. 06 newsletter clickthroughs
// And, the cookie gets set regardless of whether a previous cookie is in place
var adquerynl601 = qstring.indexOf("nl601");
if (adquerynl601 != -1)
  {
SetCookie("Referer", "http://GSNewsJanuary2006Email.com", expdate, "/", ".greatskin.com", false);
  } // End of setting nl601 cookie


// Below sets cookie if current DOM location includes ?nl602 which overrides
// referring URL to let us know sales based on Feb. 06 newsletter clickthroughs
// And, the cookie gets set regardless of whether a previous cookie is in place
var adquerynl602 = qstring.indexOf("nl602");
if (adquerynl602 != -1)
  {
SetCookie("Referer", "http://GSNewsFebruary2006Email.com", expdate, "/", ".greatskin.com", false);
  } // End of setting nl602 cookie

