function toggleClipDisplayMode(dmode)
  {
  if (dmode.toString() == "show-short")
    {
    jQuery('[id^=short_]').show();
    jQuery('[id^=mini_]').hide();
    document.frmClipList.sel_display.value = 1;
    document.frmClipList2.sel_display.value = 1;
    }
  else
    {
    jQuery('[id^=mini_]').show();
    jQuery('[id^=short_]').hide();
    document.frmClipList.sel_display.value = 0;
    document.frmClipList2.sel_display.value = 0;
    }
  } // toggleClipDisplayMode()

jQuery(document).ready(function($) {

	$("#show-short").click(function() {
		jQuery('[id^=short_]').show();
		jQuery('[id^=mini_]').hide();
		document.frmClipList.sel_display.value = 1;
		document.frmClipList2.sel_display.value = 1;
	});
	$("#show-mini").click(function() {
		jQuery('[id^=mini_]').show();
		jQuery('[id^=short_]').hide();
		document.frmClipList.sel_display.value = 0;
		document.frmClipList2.sel_display.value = 0;
	});

	$("#show-advanced-filtering").click(function() {
    if (document.frmClipList.hdnFilterDisplay.value.toString() == "1")
      {
      document.frmClipList.hdnFilterDisplay.value = 0;
      document.frmClipList2.hdnFilterDisplay.value = 0;
      }
    else
      {
      document.frmClipList.hdnFilterDisplay.value = 1;
      document.frmClipList2.hdnFilterDisplay.value = 1;
      }
		$("#filters").slideToggle();
	});

	});


	function scroll(clipid)
	  {
		document.body.scrollTop = document.getElementById(clipid).offsetTop;
	  } // scroll

	  function goOtherStore()
	    {
	    idx = document.frmClipList.selOtherStore.selectedIndex;
	    storeID = document.frmClipList.selOtherStore.options[idx].value;
	    //document.frmClipList.hdnStoreID.value = storeID;
	    window.location = store_page + '?st=' + storeID.toString();
	    //document.frmClipList.submit();
	    } // goOtherStore()


		/**
		* This function is called when a new format is chosen and submits the form.
		*/
		function goOtherFormat(form) {
			var element = form.elements['format'];
			var index = element.selectedIndex;
			var formatID = element[index].value
			formatID = formatID.toString();
			form.submit();
		} // goOtherFormat()

	function set_hidden_display() {

				if (document.frmClipList.sel_display.value == 0) {

				document.frmClipList.sel_display.value = 1;

			} else {

				document.frmClipList.sel_display.value = 0;

			}

	}

	  function goLogin()
	    {
	    document.frmClipList.action.value = 'Login';
	    document.frmClipList.submit();
	    }

	  function go2257(cpid)
	    {

	    w2257 = window.open(url_2257 + 'cp=' + cpid.toString(),'win2257','toolbar=0, scrollbars=1, location=0, statusbar=0, menubar=0,resizable=0,width=620,height=400');
	    } // go2257()

	  function goPage(form, nPage)
	    {
	    form.selPageNumber.value = nPage;
	    form.hdnNoRefresh.value = 1;
	    form.submit();
	    } // goPage()


	  if (over_18 == "show" && !jQuery.inArray(filename,avoverlay_exempt)) {
			jQuery(document).ready(function(){
				warning($);
			});
		}

	  function goCheckDelete()
	    {
	    if (confirm('<?php print t("are you sure you wish to delete this item from your wish list?"); ?>'))
	      {
	      document.frmDelete.submit();
	      }
	    } // goCheckDelete()

	// Hide the contents of a div
	  function HideDiv(divname) {
	  	document.getElementById(divname).style.visibility = 'hidden';
	  }
	  // Hide the contents of a div
	  function ShowDiv(divname) {
	  	document.getElementById(divname).style.visibility = 'visible';
	  }
	  // Process whether to show or hide a div by checkbox state
	  function ShowHideDiv(divname) {

	  	if (document.frmCustomer.chkValidateCC.checked) {
	  		ShowDiv(divname);
	  	}
	  	else {
	  		HideDiv(divname);
	  	}

	  }

	  function popupwindow(type) {

	  	if (type=='check') {
	  		window.open('https://signup.nationala-1.com/hotmovies/images/check_graphic_large.gif','Check','width=300,height=250,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes');
	  	} else {
	  		window.open('images/CVV.gif','CVV','width=300,height=240,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes');
	  	}

	  	return false;
	  }

	  jQuery(document).ready(function($) {

			$("#downloaded_hide").click(function() {
		    // alert('this is coming from the jQuery code.');
		    $("tr").filter(".clip_downloaded").toggle();
		    $("a").filter("#downloaded_hide").hide();
		    $("a").filter("#downloaded_show").show();
			});

			$("#downloaded_show").click(function() {
		    // alert('this is coming from the jQuery code.');
		    $("tr").filter(".clip_downloaded").toggle();
		    $("a").filter("#downloaded_hide").show();
		    $("a").filter("#downloaded_show").hide();
			});

		}); // jQuery.ready()

	  function bookmarkThis(url, title, alt)
	  {
	  /* alert("bookmarkThis(" + url.toString() + ")"); */
	  if (document.all)
	    {
	    window.external.AddFavorite(url.toString(), title.toString());
	    }
	  else
	    {
	    document.getElementById(alt.toString()).style.display = '';
	    }
	  } // bookmarkThis()

	function closeDiv(name)
	  {
	  document.getElementById(name.toString()).style.display = "none";
	  } // closeDiv()

