<!--
// 	THIS IS THE MAIN JAVASCRIPT FILE USED BY:
//	CREATIVE DOMAIN WEB (http://www.creativedomainweb.com)
//	ANY QUESTIONS OR COMMENTS PLEASE CONTACT:
//	DENNIS MARTIN - SENIOR HTML PRODUCER
//	(310) 845-3000
//	dennism@creativedomainweb.com
//	LAST UPDATED: JUNE 19th, 2000

//	THIS JAVASCRIPT FILE SHOULD BE USED WITH ALL CREATIVE DOMAIN'S WEB SITES IN ORDER TO MAINTAIN CONSISTENCY
//	DO NOT MODIFY TEMPLATE PORTION OF THIS FILE
//	ANY JAVASCRIPT THAT IS ADDED, SHOULD BE DONE SO BELOW TEMPLATE SECTION OF THIS FILE


//	**************************** //
//	***** TEMPLATE - START ***** //
//	**************************** //

//	MAIN FUNCTIONS IN THIS TEMPLATE:
//	MM_preloadImages 	-	PRELOADS IMAGES
//	MM_swapImage			-	ROLLOVERS/SWAP IMAGES
//	MM_swapImgRestore	-	RESTORES ROLLOVER/SWAP IMAGES
//	MM_showHideLayers	- SHOWS/HIDES LAYERS
//	adjustPopUp				- POPS UP A NEW WINDOW THAT IS SIZED IN THE HTML TAG (FOR UNIQUE SIZED WINDOWS)
//	fixedPopUp*				- POPS UP A NEW WINDOW THAT IS SIZED IN THE JAVASCRIPT (FOR MANY WIDOWS OF THE SAME SIZE AND TYPE)
//	WM_netscapeCssFix	-	FIXES THE CSS PROBLEM IN NETSCAPE WHEN WINDOW IS RESIZED


//	THIS IS THE ONLOAD ACTION

//	*** EXAMPLE - MORE THEN ONE "ONLOAD" ***
//	<body onLoad="WM_netscapeCssFixCheckIn(); MM_preloadImages('assets/images/blank.gif','assets/images/copyofblank.gif');">


// 	THIS IS THE PRELOAD IMAGE FUNCTION

//	*** EXAMPLE - PRELOAD IMAGE ***
//	<body onLoad="MM_preloadImages('assets/images/blank.gif','assets/images/copyofblank.gif')">
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


//	THIS IS THE ROLLOVER/SWAP IMAGE FUNCTION
//	*** EXAMPLE - ROLLOVER / SWAP IMGAE ***
// 	<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','assets/images/blank.gif',1)"><img src="assets/images/blank.gif" width="100" height="100" alt="" border="0" name="Image1"></a>

//	*** EXAMPLE 2  - ROLLOVER/SWAP IMAGE & SHOW/HIDE LAYERS/DIVS TOGETHER ***
//	<a href="#" onMouseOut="MM_swapImgRestore(); MM_showHideLayers('Layer1','','show')" onMouseOver="MM_swapImage('Image1','','assets/images/blank.gif',1); MM_showHideLayers('Layer1','','hide')">

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}


//	THIS IS THE SHOW/HIDE LAYER/DIV FUNCTION
//	*** EXAMPLE - SHOW/HIDE LAYER/DIV ***
//	<a href="#" onMouseOver="MM_showHideLayers('Layer1','','show')" onMouseOut="MM_showHideLayers('Layer1','','hide')">Rollover To Show</a>

//	*** EXAMPLE 2  - SHOW/HIDE LAYERS/DIVS & ROLLOVER/SWAP IMAGE TOGETHER***
//	<a href="#" onMouseOut="MM_swapImgRestore(); MM_showHideLayers('Layer1','','show')" onMouseOver="MM_swapImage('Image1','','assets/images/blank.gif',1); MM_showHideLayers('Layer1','','hide')">

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}


//	THIS IS THE THE SAME AS THE ADJUSTABLE POPUP WINDOW FUNCTION
//  EXCEPT THE SCROLLBARS ARE GUARANTEED IN ALL BROWSERS

//	*** EXAMPLE - ADJUSTABLE POPUP WINDOW ***
//	<a href="javascript:adjustPopUp('index.html','200','200','Name')">PopUp</a>
function adjustPopUpScroll (url, w, h, name) {
	var winopts = "toolbar=no,location=no,directories=no,status=no,";
	winopts = winopts + "menubar=no,scrollbars=yes,resizable=no,";
	winopts = winopts + "width=" + w + ",height=" + h; remote = window.open(url,name,winopts);
}

//	THIS IS THE ADJUSTABLE POPUP WINDOW FUNCTION

//	*** EXAMPLE - ADJUSTABLE POPUP WINDOW ***
//	<a href="javascript:adjustPopUp('index.html','200','200','Name')">PopUp</a>
function adjustPopUp(url, w, h, name) {
	var winopts = "toolbar=no,location=no,directories=no,status=no,";
	winopts = winopts + "menubar=no,scrollbars=no,resizable=no,";
	winopts = winopts + "width=" + w + ",height=" + h; remote = window.open(url,name,winopts);
}



//	THIS IS THE CSS NETSCAPE RESIZE FIX FUNCTION

//	*** EXAMPLE - SHOW/HIDE LAYER/DIV ***
//	<body onLoad="WM_netscapeCssFixCheckIn()">
function WM_netscapeCssFix() {
  /*
    Source: Webmonkey Code Library
    (http://www.hotwired.com/webmonkey/javascript/code_library/)

    Author: Taylor
    Author Email: taylor@wired.com
    Author URL: http://www.taylor.org/
    */

  // This part was inspired by Matthew_Baird@wayfarer.com
  // It gets around another unfortunate bug whereby Netscape
  // fires a resize event when the scrollbars pop up. This
  // checks to make sure that the window's available size
  // has actually changed.
  if (document.WM.WM_netscapeCssFix.initWindowWidth != window.innerWidth || document.WM.WM_netscapeCssFix.initWindowHeight != window.innerHeight) {
    document.location = document.location;
  }
}

function WM_netscapeCssFixCheckIn() {
  // This function checks to make sure the version of Netscape
  // in use contains the bug; if so, it records the window's
  // width and height and sets all resize events to be handled
  // by the WM_netscapeCssFix() function.
  if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
    if (typeof document.WM == 'undefined'){
      document.WM = new Object;
    }
    if (typeof document.WM.WM_scaleFont == 'undefined') {
      document.WM.WM_netscapeCssFix = new Object;
      document.WM.WM_netscapeCssFix.initWindowWidth = window.innerWidth;
      document.WM.WM_netscapeCssFix.initWindowHeight = window.innerHeight;
    }
    window.onresize = WM_netscapeCssFix;
  }
}

//	THIS IS THE FULL SCREEN
//	*** EXAMPLE - FULL SCREEN ***
//	<a href="#" onClick="fullScreen('home.html', 'jimi')">Test</a>
function fullScreen(link, windowName) {
        //window.open(theURL, 'title','fullscreen=yes,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=yes');

        var scw = 0;
        var sch = 0;

        if (navigator.appName == 'Microsoft Internet Explorer' && (navigator.platform.substring(0,3) == 'Win')) { //{ //
                window.open(link, windowName,'fullscreen=yes,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=yes');
        }

        else if (navigator.appName == 'Netscape' && navigator.platform == 'MacPPC') {
                var scw=screen.width;
                var sch=screen.height;
                window.open (link, windowName, "screenX=0,screenY=0,outerWidth=" + scw + ",outerHeight=" + sch);
        }
        else {
                var scw=screen.width;
                var sch=screen.height;
                window.open (link, windowName, "screenX=0,screenY=0,Width=" + scw + ",Height=" + sch);
        }
}

//	************************** //
//	***** TEMPLATE - END ***** //
//	************************** //


// ***************************************************** //
// ***** ADD ADDTIONAL JAVASCRIPT BELOW THIS POINT ***** //
// ***************************************************** //

//	THIS IS THE FIXED POPUP WINDOW FUNCTION

//	*** EXAMPLE - FIXED POPUP WINDOW ***
//	<a href="javascript:fixedPopUp('index.html','Name')">PopUp</a>
function fixedPopUp(url, name) {
	var winopts = "toolbar=no,location=no,directories=no,status=no,width=500,height=280";
	winopts = winopts + "menubar=no,scrollbars=no,resizable=no,";
	remote = window.open(url,name,winopts);
}


// THIS WILL POP OPEN A FIXED-SIZED WINDOW POSITIONED
// EXACTLY IN THE CENTER OF THE USER'S SCREEN

// *** EXAMPLE USAGE ***
// <a href="javascript:popOpenCentered('index.html','Name',500,300)">Click to open</a>
function popOpenCentered(url, name, width_x, height_y)
{
    if (navigator.appVersion.search("AOL") == -1) { // not AOL
	    var win_x = screen.availWidth;
	    var win_y = screen.availHeight;
	    var free_x = win_x - width_x;
	    var free_y = win_y - height_y;
	    var w_args = "scrollbars=no,toolbar=no,location=no,directories=no,status=no,width=" + width_x + ",height=" + height_y;
	    var nwin = window.open(url, name, w_args);
	    nwin.moveTo((free_x/2),(free_y/2));
    }
    else {
        adjustPopUp(url, width_x, height_y, name)
    }
}


// THIS WILL POP OPEN A FIXED-SIZED WINDOW POSITIONED
// EXACTLY IN THE CENTER OF THE USER'S SCREEN

// *** EXAMPLE USAGE ***
// <a href="javascript:popOpenCenteredScroll('index.html','Name',500,300)">Click to open</a>
function popOpenCenteredScroll(url, name, width_x, height_y)
{
    if (navigator.appVersion.search("AOL") == -1) { // not AOL
	    var win_x = screen.availWidth;
	    var win_y = screen.availHeight;
	    var free_x = win_x - width_x;
	    var free_y = win_y - height_y;
	    var w_args = "scrollbars=yes,toolbar=no,location=no,directories=no,status=no,width=" + width_x + ",height=" + height_y;
	    var nwin = window.open(url, name, w_args);
	    nwin.moveTo((free_x/2),(free_y/2));
    }
    else {
        adjustPopUp(url, width_x, height_y, name)
    }
}

function downloadalert()
{
var message = "On the web page that opens:\n"
message += "PC Netscape Users: Right Click On Image and Select \'Save Image As\'\n"
message += "PC Internet Explorer/AOL Users: Right Click On Image and Select \'Save Picture As\'"
window.alert(message)
}


/* Jeremy's media popup script
	example usage: javascript:popUpMedia('mtp_lie_det_for_mac.sit');
*/
function popUpMedia(m)
{
	var media = "../downloads/" + m;
	var n = window.open("", "", "height=100,width=200");
	n.window.location = media;
   n.window.close();
}



//-->
