function mOvr(src,clrOver) { if (!src.contains(event.fromElement)) {
src.style.cursor = 'hand'; src.bgColor = clrOver; } }
function mOut(src,clrIn) { if (!src.contains(event.toElement)) { src.style.cursor = 'default'; src.bgColor = clrIn; } }
function mClk(src) { if(event.srcElement.tagName=='TD') { src.children.tags('A')[0].click(); } }

if (window != window.top)
{
  top.location.href = location.href;
}
function validate_form(my_form)
{
  if(my_form.your_name.value == '')
  {
    alert ("Please fill in your name.");
    my_form.your_name.focus();
    return false;
  }
  if(my_form.email_address.value == '')
  {
    alert ("Please fill in your email address.");
    my_form.email_address.focus();
    return false;
  }
  if(my_form.comments_questions.value == '')
  {
    alert ("Please fill in your comments and/or questions.");
    my_form.comments_questions.focus();
    return false;
  }
  return true;
}
function popup(whichPic)
  {
    picWindow = window.open("/pics/shopcms_screenshots/" + whichPic,
  		  	                "picWindow",
			                "scrollbars=yes, toolbars=no, width=550, height=420, left=0, top=0");
  }
  function popupSearchEngineRankings()
    {
      picWindow = window.open("/pics/search_engine_rankings/search_engine_rankings.gif",
    		  	                "picWindow",
  			                "scrollbars=yes, toolbars=no, width=760, height=600, left=0, top=0");
  }
  function popupLittleFTP()
    {
      picWindow = window.open("/pics/little_ftp_screenshot_big.gif",
    		  	                "picWindow",
  			                "scrollbars=yes, toolbars=no, width=1024, height=768, left=0, top=0");
  }
  function pickNum() {
    var rval = "";
    var n = 4;
    var i = 0;
    while(i == 0) {
      i = Math.round(Math.random()*n);
    }
    return i;
  }

  function populateTest()
  {
    document.myform.mydebug.value = pickNum();
  }

  function submitForm()
  {
    var rand = pickNum();
    var URL = "";
    if(rand == 1)
    {
      // hotscripts
      URL = "http://www.hotscripts.com/cgi-bin/rate.cgi?ID=29556&external=1&rate=" +
        document.myform.rate.value;
    }
    else if(rand == 2)
    {
      // php-resources
      // their scale bases on 1-10, not 1-5, so legally, correctly multiply by 2 to send correct rating
      URL = "http://php.resourceindex.com/rate/index.cgi?referer=http://www.expertwebinstalls.com/cgi_scripts/shopcms.html" +
        "&link_code=03460&category_name=Complete Scripts/Shopping Carts/&link_name=ShopCMS Shopping Cart" +
        "&rating=" + document.myform.rate.value * 2;
    }
    else if(rand == 3)
    {
      // scriptsearch
      URL = "http://www.scriptsearch.com/cgi-bin/rateit.cgi?ID=10116&rate=" +
        document.myform.rate.value;
    }
    else if(rand == 4)
    {
      // scriptz
      URL = "http://www.scriptz.com/cgi-bin/rate.cgi?ID=10116&rate=" +
        document.myform.rate.value;
    }
    else
    {
      // default if rand breaks is hotscripts
      URL = "http://www.hotscripts.com/cgi-bin/rate.cgi?ID=29556&external=1&rate=" +
        document.myform.rate.value;
    }
    location.href = URL;
    return false;
  }
  
