<!--

function BodyOnLoadGeneral()
{
  /* all dv pages should have <body ...  onload="BodyOnLoadGeneral(); > to call this function */

	/* page specific js functionality  ; 
	   OnLoadThisPage(); js fn placed in html by an 
	   <xsl:template name="HTMLHeadJavaScriptOnLoadThisPage"> template in each xslt 
	*/
	if( typeof(OnLoadThisPage) != 'undefined' ) 
	{
		OnLoadThisPage();
	} 
	/* site wide JS functionality */
	if( typeof(OnLoadDVGlobal) != 'undefined' ) 
	{
		OnLoadDVGlobal() ;
	} 
}



function highlightResolution(refRes) {
	clearResolutions();
	var e1 = document.getElementById(refRes).cbe;
	e1.background('#ffccff');
}

function clearResolutions() {
	var e1 = document.getElementById('ResLow').cbe;
	e1.background('#e9ecf2');
	var e2 = document.getElementById('ResMed').cbe;
	e2.background('#e9ecf2');
	var e3 = document.getElementById('ResHigh').cbe;
	e3.background('#e9ecf2');
	var e4 = document.getElementById('ResSuper').cbe;
	e4.background('#e9ecf2');
}

//***********************//
//  window manipulation  //
//***********************//

//****************//
// callback popup //
//****************//

function open_callback_win() {
	dlg = window.open('/callback/DVCallbackPopup.asp?CMD=CallbackViewForm','Callback','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=420,height=515');
	}

//**************************//
// motion clip viewer popup //
//**************************//

function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=345,height=455');
return false;
}


function ConfirmBox(vstrMessage) {
	if (window.confirm(vstrMessage)) {
		return true;
	} else {
		return false;
	}  
}


//*******************//
//  Rollover script  //
//*******************//
//*********************************//
//  Rollover Variable Declaration  //
//*********************************//
var mouseOutDisabledImage;

function MouseOver(image) {
  if(image && document.images && image.src.indexOf('_over.gif')==-1) {
    image.src = image.src.substring(0,(image.src.indexOf('.gif'))) + '_over.gif';
    }
}
function MouseOut(image) {
  if(image && image!=mouseOutDisabledImage && document.images && image.src.indexOf('_over.gif')!=-1) {
    image.src = image.src.substring(0,(image.src.indexOf('_over.gif'))) + '.gif';
    }
}

function submitForm(form) {
	form.submit();
}


//******************//
// set focus onload //
//******************//

function focusFirstForm() {

// if there is a form
  if (document.forms) {

    theElems = document.forms[0].elements

    // loop over the elements until finding a non-hidden one
    for (i = 0; i < theElems.length; i++) {
      theElem = theElems[i];
      if (theElem.type && theElem.type == "hidden" ) {
        continue;
      }
      // focus on the first non-hidden element
      theElem.focus();
      break;
    }
  }
}

//******************//
// pop up windows - //
// motion and music //
//******************//

function popupMusic(in_sStockCode, in_sEdit) {
window.open('/search/dvsearch.asp?CMD=POPUPMUSIC&STOCKCODE='+in_sStockCode+'&EDIT='+in_sEdit,'audioplayer','width=258,height=210,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
}


function popupMotion(in_sStockCode) {
	//window.open('/search/dvsearch.asp?CMD=POPUPMOTION&STOCKCODE='+in_sStockCode,'videoplayer','width=346,height=440,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
	window.open('/search/dvsearch.asp?CMD=POPUPMOTIONPREVIEW&STOCKCODE='+in_sStockCode,'videoplayer','width=600,height=625,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
}

function popupImage(in_sStockCode) {
	window.open('/search/dvsearch.asp?CMD=POPUPIMAGE&STOCKCODE='+in_sStockCode,'videoplayer','width=600,height=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
}

function popupMotionPreview(in_sStockCode) {
	window.open('/search/dvsearch.asp?CMD=POPUPMOTIONPREVIEW&STOCKCODE='+in_sStockCode,'videoplayer','width=600,height=625,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
}

function popupClip(in_sURL) {
	window.open('/case_study/popupClip.asp?'+in_sURL,'videoplayer','width=346,height=314,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
} 

function popupMotionDist(in_sStockCode) {
	window.open('/DVDist/DVDistW2.asp?CMD=DistMotionPlayerPopup&StockCode='+in_sStockCode,'videoplayer','width=600,height=625,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
}


//*****************************************//
//  for redirecting from advanced search  //
//***************************************//
function go() {
    
	var strSelectedSearch = document.Search.previous_searches[document.Search.previous_searches.selectedIndex].value
	
	if (strSelectedSearch != 'false'){
	location.href = "/search/dvsearch.asp?" + strSelectedSearch;
	}
}

//*******************************************//
//  popup window for contact us location map //
//*******************************************//

function open_location_win(href) {
	dlg = window.open(href,'locationMap','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=485,height=600');
	}

//************************//
//  popup window for help //
//************************//

function open_help_win(href) {
	dlg = window.open(href,'help','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=576,height=600');
	}
	
//************************//
//  popup window for tour //
//************************//

function open_tour_win(href) {
	dlg = window.open(href,'help','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=576,height=600');
	}

//********************************************//
//  communicate with parent window from popup //
//********************************************//
	
function targetparent(strhref){
	window.opener.location.href=strhref
	}

//****************//
// gallery popup //
//****************//

function open_gallery_win(href) {
	dlg = window.open(href,'gallery','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=780,height=610');
	}

//****************//
// single image viewer popup //
//****************//

function open_singleimageviewer_win(href) {
	dlg = window.open(href,'singleimageviewer','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=580,height=400');
	}

//****************//
// music sampler popup //
//****************//

function open_dvsampler_win(href) {
	dlg = window.open(href,'sampler','width=258,height=210,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
	}

//****************//
// tutorial 0604 popup //
//****************//

function open_tutorial_win(href) {
	dlg = window.open(href,'tutorial','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=420,height=430');
	}

	
//****************//
// tutorial 0904 popup //
//****************//

function open_tutorial0904_win(href) {
	dlg = window.open(href,'tutorial','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=543,height=446');
	}

	
function open_tutorial0305_win(href) {
	dlg = window.open(href,'tutorial','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=450,height=390');
	}

//***********************//
// aspin casestudy popup //
//***********************//

//function open_casestudyaspin_win(href) {
//	dlg = window.open(href,'casestudy','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=350,height=500');

//	}


var dlg = null;

function open_casestudyaspin_win(href)
{
  dlg = window.open(href,'casestudy','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=370,height=520');
  dlg.focus();
}

	
-->
