// "TODAY ON TRS" DATE JAVASCRIPT 
function MakeArray(n) {

        this.length = n

        return this

}

monthNames = new MakeArray(12)

monthNames[1] = "January"

monthNames[2] = "February"

monthNames[3] = "March"

monthNames[4] = "April"

monthNames[5] = "May"

monthNames[6] = "June"

monthNames[7] = "July"

monthNames[8] = "August"

monthNames[9] = "September"

monthNames[10] = "October"

monthNames[11] = "November"

monthNames[12] = "December"

function customDateString(oneDate) {

        var theMonth = monthNames[oneDate.getMonth() + 1]

        var theYear = oneDate.getFullYear()

        return theMonth + " " + oneDate.getDate() + ", " + theYear

}



// SITE SEARCH JAVASCRIPT
function OnSubmitForm(){

    var searchfield = document.getElementById('searchfield');

    if(document.searchForm.cc[0].selected == true){

        document.searchForm.action ="http://www.google.com/custom";

        searchfield.setAttribute('name','q');

    } 

        else if(document.searchForm.cc[1].selected == true){

        document.searchForm.action ="http://www.techreviewsource.com/marketplace/v2/shop.php";

        searchfield.setAttribute('name','k');

    }

        else if(document.searchForm.cc[2].selected == true){

        document.searchForm.action ="http://www.techreviewsource.com/blog/";

        searchfield.setAttribute('name','s');

    }


        else if(document.searchForm.cc[3].selected == true){

        document.searchForm.action ="http://www.google.com/search";

        searchfield.setAttribute('name','keyword');

    }

    return true;

}

// NEWSLETTER DHTML POPUP

<!--
/****************************************************
     Author: Eric King
     Url: http://redrival.com/eak/index.shtml
     This script is free to use as long as this info is left in
     Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);}
// -->


// Drop-in content box- By Dynamic Drive
// For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
// This credit MUST stay intact for use

var ie=document.all
var dom=document.getElementById
var ns4=document.layers
var calunits=document.layers? "" : "px"

var bouncelimit=32 //(must be divisible by 8)
var direction="up"

function initbox(){
if (!dom&&!ie&&!ns4)
return
crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
crossobj.top=scroll_top-250+calunits
crossobj.visibility=(dom||ie)? "visible" : "show"
dropstart=setInterval("dropin()",50)
}

function dropin(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
if (parseInt(crossobj.top)<100+scroll_top)
crossobj.top=parseInt(crossobj.top)+40+calunits
else{
clearInterval(dropstart)
bouncestart=setInterval("bouncein()",50)
}
}

function bouncein(){
crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits
if (bouncelimit<0)
bouncelimit+=8
bouncelimit=bouncelimit*-1
if (bouncelimit==0){
clearInterval(bouncestart)
}
}

function dismissbox(){
if (window.bouncestart) clearInterval(bouncestart)
crossobj.visibility="hidden"
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}


function get_cookie(Name) {
var search = Name + "="
var returnvalue = ""
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset)
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function dropornot(){
if (get_cookie("droppedin")==""){
window.onload=initbox
document.cookie="droppedin=yes"
}
}
dropornot()

