// Text fields clear onfocus
function clearTxt(thefield) {
	if (thefield.defaultValue==thefield.value)
	document.query.query.value = "";
}
// JavaScript Document
//////////////////////////////////////////////////////////////////////////////////
// popup
function popup( url, name, w, h, x, y, scroll, status )
{   if( ( name == "" ) || ( name == null ) )
    {   var Winname = "ALLOY_POPUP";
    }
    else
    {   var Winname = name;
    }
    if( ( scroll == "" ) || ( scroll == null ) )
    {   var scrollBar = "auto";
    }
    else
    {   var scrollBar = scroll;
    }
    if( ( status == "" ) || ( status == null ) )
    {   var statusBar = "auto";
    }
    else
    {   var statusBar = status;
    }
    window.open( url, Winname, 'resizable=yes,menubar=no,toolbar=no,location=no,status='+statusBar+',scrollbars='+scrollBar+',width='+w+',height='+h+',left='+x+',top='+y );
}
//////////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////////
// send to friend
function launchSendToFriend( URL )
{   if( ( ctx == "" ) || ( ctx == null ) )
    {   ctx = "";
    }
    if( ( URL == "" ) || ( URL == null ) )
    {   popup( "http://classic.alloy.com/sendtofriend/index.do?from=" + escape( document.location.href ) + "&pageTitle=" + document.title, "ALLOY_SEND_TO_FRIEND_POPUP", 425, 500, 100, 100 );
    }
    else
    {   popup( "http://classic.alloy.com/sendtofriend/index.do?from=" + escape( URL ) + "&pageTitle=" + document.title, "ALLOY_SEND_TO_FRIEND_POPUP", 425, 500, 100, 100 );
    }
}
//////////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////////
// display functions
function showDiv( divId )
{   document.getElementById( divId ).style.display = 'inline';
}
function hideDiv( divId )
{   document.getElementById( divId ).style.display = 'none';
}
function showCommentForm()
{   showDiv( 'comment_form' );
    document.commentCommand.commentText.focus();
}
function hideCommentForm()
{   hideDiv( 'comment_form' );
}
//////////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////////
function trimAll( strValue )
{   /************************************************
    DESCRIPTION: Removes leading and trailing spaces.
    PARAMETERS: Source string from which spaces will
      be removed;
    RETURNS: Source string with whitespaces removed.
    *************************************************/
    var objRegExp = /^(\s*)$/;
    //check for all spaces
    if( objRegExp.test( strValue ) )
    {   strValue = strValue.replace( objRegExp, '' );
        if( strValue.length == 0 )
        {   return strValue;
        }
    }
    //check for leading & trailing spaces
    objRegExp = /^(\s*)([\W\w]*)(\b\s*$)/;
    if( objRegExp.test( strValue ) )
    {   //remove leading and trailing whitespace characters
        strValue = strValue.replace( objRegExp, '$2' );
    }
    return strValue;
}
function validateNotEmpty( strValue )
{   /************************************************
    DESCRIPTION: Validates that a string is not all
      blank (whitespace) characters.
    PARAMETERS:
       strValue - String to be tested for validity
    RETURNS:
       True if valid, otherwise false.
    *************************************************/
    var strTemp = strValue;
    strTemp = trimAll( strTemp );
    if( strTemp.length > 0 )
    {   return true;
    }
    return false;
}
function validateComment()
{   var alertComment = "Please enter Comment and Name and try again! \n";
    var isAlertComment = false;

    // The following makes sure a field is NOT EMPTY  (validateNotEmpty) Repeat As necessary
    replaceCommentChars( document.commentCommand.commentText );
    replaceCommentChars( document.commentCommand.name );
    filterEngine( document.commentCommand.commentText );
    filterEngine( document.commentCommand.name );
    if( !validateNotEmpty( document.commentCommand.commentText.value ) || !validateNotEmpty( document.commentCommand.name.value ) )
    {   isAlertComment = true;
    }
    if( isAlertComment )
    {   alert( alertComment );
    }
    else
    {   document.commentCommand.submit();
    }
}
function replaceCommentChars( entry )
{   out = ">"; // replace this
    add = "&gt;"; // with this
    temp = "" + entry.value ; // temporary holder
    while( temp.indexOf( out ) >- 1 )
    {   pos = temp.indexOf( out );
        temp = "" + ( temp.substring( 0, pos ) + add + temp.substring( ( pos + out.length ), temp.length ) );
    }
    entry.value = temp;
    out = "<"; // replace this
    add = "&lt;"; // with this
    temp = "" + entry.value ; // temporary holder
    while( temp.indexOf( out ) >- 1 )
    {   pos = temp.indexOf( out );
        temp = "" + ( temp.substring( 0, pos ) + add + temp.substring( ( pos + out.length ), temp.length ) );
    }
    entry.value = temp;
}
function filterEngine( formfield )
{   mask = "%!#%&*(%&*^%";
    cmp = "shit fuck porno cum cunt prick asshole pedophile twat bitch whore tits blowjob handjob slut fag dick cock";
    txt = formfield.value;
    txtx = formfield.value.toLowerCase();
    for( var i = 0; i < 16; i++ )
    {   pos = cmp.indexOf( " " );
        wrd = cmp.substring( 0, pos );
        wrdl = wrd.length
        cmp = cmp.substring( pos + 1, cmp.length );
        while( txtx.indexOf( wrd ) >- 1 )
        {   pos = txtx.indexOf( wrd );
            txtx = txtx.substring( 0, pos ) + mask.substring( 0, wrdl ) + txtx.substring( ( pos + wrdl ), txtx.length );
            txt = txtx;
        }
    }
    formfield.value = txt;
}
//////////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////////
// Browser and OS sniffer
var exclude=1;
var agt=navigator.userAgent.toLowerCase();
var win=0;var mac=0;var lin=1;
if(agt.indexOf('win')!=-1){win=1;lin=0;}
if(agt.indexOf('mac')!=-1){mac=1;lin=0;}
var lnx=0;if(lin){lnx=1;}
var ice=0;
var ie=0;var ie4=0;var ie5=0;var ie6=0;var com=0;var dcm;
var op5=0;var op6=0;var op7=0;
var ns4=0;var ns6=0;var ns7=0;var mz7=0;var kde=0;var saf=0;
if(typeof navigator.vendor!="undefined" && navigator.vendor=="KDE"){
    var thisKDE=agt;
    var splitKDE=thisKDE.split("konqueror/");
    var aKDE=splitKDE[1].split("; ");
    var KDEn=parseFloat(aKDE[0]);
    if(KDEn>=2.2){
        kde=1;
        ns6=1;
        exclude=0;
        }
    }
else if(agt.indexOf('webtv')!=-1){exclude=1;}
else if(typeof window.opera!="undefined"){
    exclude=0;
    if(/opera[\/ ][5]/.test(agt)){op5=1;}
    if(/opera[\/ ][6]/.test(agt)){op6=1;}
    if(/opera[\/ ][7-9]/.test(agt)){op7=1;}
    }
else if(typeof document.all!="undefined"&&!kde){
    exclude=0;
    ie=1;
    if(typeof document.getElementById!="undefined"){
        ie5=1;
        if(agt.indexOf("msie 6")!=-1){
            ie6=1;
            dcm=document.compatMode;
            if(dcm!="BackCompat"){com=1;}
            }
        }
    else{ie4=1;}
    }
else if(typeof document.getElementById!="undefined"){
    exclude=0;
    if(agt.indexOf("netscape/6")!=-1||agt.indexOf("netscape6")!=-1){ns6=1;}
    else if(agt.indexOf("netscape/7")!=-1||agt.indexOf("netscape7")!=-1){ns6=1;ns7=1;}
    else if(agt.indexOf("gecko")!=-1){ns6=1;mz7=1;}
    if(agt.indexOf("safari")!=-1 || (typeof document.childNodes!="undefined" && typeof document.all=="undefined" && typeof navigator.taintEnabled=="undefined")){mz7=0;ns6=1;saf=1;}
    }
else if((agt.indexOf('mozilla')!=-1)&&(parseInt(navigator.appVersion)>=4)){
    exclude=0;
    ns4=1;
    if(typeof navigator.mimeTypes['*']=="undefined"){
        exclude=1;
        ns4=0;
        }
    }
if(agt.indexOf('escape')!=-1){exclude=1;ns4=0;}
if(typeof navigator.__ice_version!="undefined"){exclude=1;ie4=0;}
//////////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////////
// Stats juking
/*
if( win&&ie5 )
{
    var alloy_trackingpaths = new Array( "http://classic.alloy.com/links/index.do?target=bounce1", "http://classic.alloy.com/links/index.do?target=bounce2", "http://classic.alloy.com/links/index.do?target=bounce3" );
    var collegeclub_trackingpaths = new Array( "http://www.collegeclub.com/links/index.do?target=bounce1", "http://www.collegeclub.com/links/index.do?target=bounce2", "http://www.collegeclub.com/links/index.do?target=bounce3" );
    var ccs_trackingpaths = new Array( "http://www.ccs.com/links/bounce1.asp", "http://www.ccs.com/links/bounce2.asp", "http://www.ccs.com/links/bounce3.asp" );

    var increment = Math.floor( Math.random() * 3 );

    document.write("<div style=\"visibility:hidden;position:absolute;left:800px;top:1100px;z-index:-1;\">");
    document.write("<iframe frameborder=\"0\" height=\"100\" width=\"100\" marginheight=\"0\" marginwidth=\"0\" scrolling=\"Auto\" id=\"ALLOY\" src='"+alloy_trackingpaths[increment]+"'></iframe></div>");

    document.write("<div style=\"visibility:hidden;position:absolute;left:800px;top:1100px;z-index:-1;\">");
    document.write("<iframe frameborder=\"0\" height=\"100\" width=\"100\" marginheight=\"0\" marginwidth=\"0\" scrolling=\"Auto\" id=\"ccs\" src='"+ccs_trackingpaths[increment]+"'></iframe></div>");

    document.write("<div style=\"visibility:hidden;position:absolute;left:800px;top:1100px;z-index:-1;\">");
    document.write("<iframe frameborder=\"0\" height=\"100\" width=\"100\" marginheight=\"0\" marginwidth=\"0\" scrolling=\"Auto\" id=\"CollegeClub\" src='"+collegeclub_trackingpaths[increment]+"'></iframe></div>");
}
else if( !win&&ie5 )
{
    //document.write ('not visible in pc or ie')
}
*/
/////////////////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////////
function ABAMod10(aba) { //v2.0
  var valid = "0123456789";
  var len = aba.length;
  var bNum = true;
  var iABA = parseInt(aba);
  var sABA = aba.toString();
  var url = "abaDisplay2.asp?aba=" + sABA;
  var iTotal = 0;
  var bResult = false;
  var temp;

  //alert(aba);
  for (var j=0; j<len; j++) {
  temp = "" + document.abaForm.aba.value.substring(j, j+1);
  if (valid.indexOf(temp) == "-1") bNum = false;
  }
  if(!bNum){alert("Not a Number");}
  if(len !=0) {  // incase they omit the number entirely.
    if(len != 9) {
      alert("This is not a proper ABA length");
    } else {
      for (var i=0; i<len; i += 3) {
        iTotal += parseInt(sABA.charAt(i),     10) * 3
          +  parseInt(sABA.charAt(i + 1), 10) * 7
          +  parseInt(sABA.charAt(i + 2), 10);
        }
    if (iTotal != 0 && iTotal % 10 == 0){
      bResult = true;
      // used for AJAX posting of data
      // get(this.parentNode);
    } else {
      alert("This is NOT a valid ABA Routing Number!");
      bResult = false;
    }
  }
  } else {
    // zero length do nothing
  }
  //  reset the frame detail.
  if (!bResult) {
    // used for AJAX posting of data
    //document.getElementById('myspan').innerHTML = "";
  } else {
    alert("This COULD BE a valid ABA Routing Number!");
  }
  // end of not shown in page version of code
  return bResult;
}
// -->
/////////////////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////////////////
function Copy(n){
copyme=n
textRange = document.createTextRange();
textRange.moveToElementText(copyme);
textRange.execCommand("Copy");
}

function CopyNew(n){
theField = document.getElementById(n);
theField.focus();
theField.select();
    if (theField.createTextRange) {
        textRange = theField.createTextRange();
        textRange.execCommand("Copy");
    }
}

function Select(n) {
theField = document.getElementById(n);
theField.focus();
theField.select();
}
/////////////////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////////
// ajax form validation
function combineDob()
{   var dobMonth = $F('dobMonth');
    var dobDay = $F('dobDay');
    var dobYear = $F('dobYear');
    if( ( dobMonth != null && dobMonth != "" ) &&
        ( dobDay != null && dobDay != "" ) &&
        ( dobYear != null && dobYear != "" ) )
    {   $('birthDate').value = dobMonth + "/" + dobDay + "/" + dobYear;
    }
}
function ajaxValidate( theForm )
{   combineDob();
    var elements = Form.getElements( theForm );
    for( i = 0; i < elements.length; i++ )
    {   if( elements[i].name != "" )
        {   if( $( elements[i].name + "Error" ) )
            {   $( elements[i].name + "Error" ).innerHTML = "";
            }
        }
    }
    $( 'ajaxForm' ).value = "true";
    formString = Form.serialize( theForm );
    Form.disable( theForm );
    var myAjax = new Ajax.Updater(
        { success: 'validationHolder' },
        theForm.action,
        { method: 'post',
          parameters: formString,
          onFailure: reportError,
          evalScripts: true
        }
    );
}
function ajaxFilter( theForm )
{   var elements = Form.getElements( theForm );
    $( 'groupResults' ).innerHTML = "";
    $( 'ajaxForm' ).value = "true";
    formString = Form.serialize( theForm );
    Form.disable( theForm );
    var myAjax = new Ajax.Updater(
        { success: 'filterResponse' },
        theForm.action,
        { method: 'post',
          parameters: formString,
          onFailure: reportFilterError,
          evalScripts: true
        }
    );
}
function ajaxPostMessage( theForm, theResponseDivId )
{
    var elements = Form.getElements( theForm );
    $( 'ajaxForm' ).value = "true";
    formString = Form.serialize( theForm );
    Form.disable( theForm );
    var myAjax = new Ajax.Updater(
        { success: theResponseDivId },
        theForm.action,
        { method: 'post',
          parameters: formString,
          evalScripts: true
        }
    );
}
function ajaxRate( theForm, ratingId, systemId, theValue )
{
    theForm.elements["value"].value=theValue;
    formString = Form.serialize( theForm );
    Form.disable( theForm );
    //$("ratingWorking-" + ratingId + "-" + systemId).style.display="";
    var myAjax = new Ajax.Updater(
        { success: 'ratingSuccess-' + ratingId + '-' + systemId },
        theForm.action,
        { method: theForm.method,
          parameters: formString,
          onFailure: reportRateError,
          evalScripts: true
        }
    );
    //$("ratingWorking-" + ratingId + "-" + systemId).style.display="none";
    //Form.enable( theForm );
}
function ajaxSubmit( theForm )
{   combineDob();
    $( 'ajaxForm' ).value = "false";
    formString = Form.serialize( theForm );
    var myAjax = new Ajax.Request(
        theForm.action,
        { method: 'post',
          parameters: formString
        }
    );
}
var myGlobalHandlers = {
    onCreate: function(){
        Element.show( 'systemWorking' );
    },
    onComplete: function() {
        if( Ajax.activeRequestCount == 0 ){
            Element.hide( 'systemWorking' );
        }
    }
};
Ajax.Responders.register( myGlobalHandlers );
function showResponse( request )
{   //put returned XML in the textarea
    if( request.readyState == 4 )
    {   if( request.status == 200 )
        {   eval( request.responseText );
        }
        else
        {   alert( "There was a problem validating this form:\n" + request.statusText );
        }
    }
    //$('validationHolder').value = request.responseText;
}
function reportError( request )
{   alert( "ERROR: There was a problem validating this form:\n" + request.statusText );
}
function reportFilterError( request )
{   alert( "ERROR: There was a problem filtering:\n" + request.statusText );
}
function reportRateError( request )
{   alert( "ERROR: There was a problem rating this group:\n" + request.statusText );
}
function swapImage( imageId, newSrc )
{   $( imageId ).src = newSrc;
}
function ajaxSubmitLogin( theForm )
{   formString = Form.serialize( theForm );
    var myAjax = new Ajax.Request(
        theForm.action,
        { method: 'post',
          parameters: formString
        }
    );
}
//////////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////////
// Login page show/hide function
function toggleThisElement( elemToToggle, elemToFocus )
{   Element.toggle( $( elemToToggle ) );
    if( Element.visible( $( elemToToggle ) ) )
    {   $( elemToFocus ).focus();
    }
}
/////////////////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////////
function lastMod(time) {
    var x = new Date (time);

    Modif = new Date(x.toGMTString());
    Year = takeYear(Modif);
    Month = Modif.getMonth();
    Day = Modif.getDate();
    Hours = Modif.getHours();
    Minutes = Modif.getMinutes();
    Seconds = Modif.getSeconds();

    Mod = (Date.UTC(Year,Month,Day,Hours,Minutes,Seconds))/1000;
    x = new Date();
    today = new Date(x.toGMTString());
    Year2 = takeYear(today);
    Month2 = today.getMonth();
    Day2 = today.getDate();
    Hours2 = today.getHours();
    Minutes2 = today.getMinutes();
    Seconds2 = today.getSeconds();
    now = (Date.UTC(Year2,Month2,Day2,Hours2,Minutes2,Seconds2))/1000;

    secondsago = now - Mod;

    if (secondsago < 1) return 'less than an second ago';
    unit = 'seconds';

    if (secondsago > 29030400)  {
        secondsago = Math.floor(secondsago/29030400);
        if(secondsago == 1)
        {
                unit='year'
        }else
        {
            unit = 'years';
        }
    }
    else if (secondsago > 2419200) {
        secondsago = Math.floor(secondsago/2419200);
        if(secondsago == 1)
        {
                unit='month'
        }else
        {
            unit = 'months';
        }
    }
    else if (secondsago > 604800) {
        secondsago = Math.floor(secondsago/604800);
        if(secondsago == 1)
        {
            unit='week'
        }else
        {
            unit = 'weeks';
        }

    }else if (secondsago > 86400) {
        secondsago = Math.floor(secondsago/86400);
        if(secondsago == 1)
        {
            unit='day'
        }else
        {
            unit = 'days';
        }
    }else if (secondsago > 3600 ) {
        secondsago = Math.floor(secondsago/3600);
        if(secondsago == 1)
        {
            unit='hour'
        }else
        {
            unit = 'hours';
        }
    }
    else if (secondsago > 60 ) {
        secondsago = Math.floor(secondsago/60);
        if(secondsago == 1)
        {
            unit='minute'
        }else
        {
            unit = 'minutes';
        }
    }

    var towrite = '';

    towrite += secondsago + ' ' + unit + ' ago';
    return towrite;
}

function takeYear(theDate) {
    x = theDate.getYear();
    var y = x % 100;
    y += (y < 38) ? 2000 : 1900;
    return y;
}

// Global Variables
var errorcolor = "#FFD600"; //this is the error hightlight color of fields
var normalcolor = "#ffffff"  // this is the normal background of fields
var isAlert = false;
var underage = false;
var expdate = new Date();
                expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 3));


/////////////////////////////////////////////////////////////////////////////////////////
function  IsUnderage(mm,dd,yy) {
  date();
    //DOB CHECK

  //alert("check under age here");
  //var birth_year=formname.dobYear.value;
  //var birth_month=formname.dobMonth.value;
  //var birth_day=formname.dobDay.value;

  var birth_year=yy;
  var birth_month=mm;
  var birth_day=dd;

  if (birth_month=="0" ) {
    alertMessage += "Month of birth\n";
    isAlert = true;

     }

  if (birth_day=="0" ) {
    alertMessage += "Day of birth\n";
    isAlert = true;
    }

  if ((birth_month=="02" ) && (birth_day >"29" ))  {
    alertMessage += "Please select a day less than or equal to 29 for February.\n";
    isAlert = true;
     }
  if (birth_year=="0" ) {
    alertMessage += "Year of birth\n";
    isAlert = true;
     }

agealert = ""

// Checks Year for less than 13
if(((thisyear - 13) < birth_year) && birth_year != "0"){
  isAlert = false;
  underage = true;

}

else if(eval(birth_year) == eval(thisyear - 13))
// Checks for the month on the 13th year
{
    if((birth_month != "0") && (eval(thismonth) < eval(birth_month)))
    {
    isAlert = false;
    underage = true;

    }
    // checks for the day on the month of the thirteenth year
    else if (eval(birth_month) == eval(thismonth))
    {
        if((birth_day != "0") && (eval(thisday) < eval(birth_day)))
        {
        isAlert = false;
       underage = true;

        }

        //else if (thisday == birth_day) alert("Happy Birthday!");
    }
}

if (isAlert){alert(alertMessage);}
else  checkForPrevious(formname);
return true;
//frm.submit();


}

// If the data is fine - this checks the cookie to make sure that the person hasnt already been in coppa violation
function checkForPrevious(frm){
    if (GetCookie ("AgeVerification")== null ){
    //alert (underage);
    SetCookie ("AgeVerification",underage,expdate);
    }
    if(GetCookie ("AgeVerification")!="false") {
    //alert (underage);
    //SetCookie ("AgeVerification",underage,expdate);
        alert("We are sorry, you are not eligible for this sweepstakes. \n ")
    }else{

        if (!underage){     //frm.submit();
        //window.location = 'http://10.4.5.128/alloy_2006_redesign/contests/entry.htm?.dobMonth='+frm.dobMonth.value+'&dobDay='+frm.dobDay.value+'&dobYear='+frm.dobYear.value

        window.location = 'http://10.4.5.128/alloy_2006_redesign/contests/entry.htm?contestId=1&dobMonth='+frm.dobMonth.value+'&dobDay='+frm.dobDay.value+'&dobYear='+frm.dobYear.value
        }
        else
         {
         SetCookie ("AgeVerification",underage,expdate);
        alert("We are sorry, you are not eligible for this sweepstakes. \n ");
        }
    }
}

function takeYear(theDate)
{
    x = theDate.getYear();
    var y = x % 100;
    y += (y < 38) ? 2000 : 1900;
    return y;
}


function date() {
temp_date = new Date();
thisday = temp_date.getDate();
thismonth = (temp_date.getMonth()+1);
thisyear = takeYear(temp_date);

/* if (!document.layers){
    thisyear = thisyear;
} else {
    thisyear = thisyear+=1900;
}*/
}

function SetCookie (name,value,expires) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "");
}
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 getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

// An adaptation of Dorcht's function for deleting a cookie.
function delCookie (name,path,domain) {
  if (GetCookie(name)) {
    document.cookie = name + "=" +
    ((path == null) ? "" : "; path=" + path) +
    ((domain == null) ? "" : "; domain=" + domain) +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}



/////////////////////////////////////////////////////////////////////////////////

// Hangman

function hangman(type) {
    window.open('http://www.alloy.com/games/hangman/'+type+'/index.html','hangman','width=463,height=468,toolbar=0,resizable=0');

    }
///////////////////////////////////////////////////////////////////////////////////
function dayDiff(time) {
    var x = new Date (time);

    Modif = new Date(x.toGMTString());
    Year = takeYear(Modif);
    Month = Modif.getMonth();
    Day = Modif.getDate();
    Hours = Modif.getHours();
    Minutes = Modif.getMinutes();
    Seconds = Modif.getSeconds();

    Mod = (Date.UTC(Year,Month,Day,Hours,Minutes,Seconds))/1000;
    x = new Date();
    today = new Date(x.toGMTString());
    Year2 = takeYear(today);
    Month2 = today.getMonth();
    Day2 = today.getDate();
    Hours2 = today.getHours();
    Minutes2 = today.getMinutes();
    Seconds2 = today.getSeconds();
    now = (Date.UTC(Year2,Month2,Day2,Hours2,Minutes2,Seconds2))/1000;

    secondsago = now - Mod;


    if (secondsago > 86400) {
        secondsago = Math.floor(secondsago/86400);
    }
    else{
        secondsago = 1;
    }

    var towrite = '';

    towrite += parseInt(secondsago);
    if(towrite > 7)
    {
    return true;
    }
    else{
    return '';
    }

}
/////////////////////////////////////////////////////////////////////////////////////////

