//############################################################################
// JavaScript Library
// Copyright (C) 1999-2000 DIGITAL DREAM, Inc.
//############################################################################



/* FIREWORKS Ver3.0 SwapImage  type : FRONTPAGE */
function CheckNavi(){
	var isNS6 = navigator.userAgent.toUpperCase().indexOf("GECKO") >=0;
	if( isNS6 ) return false;
	else return true;
}

function MM_findObj(n, d) { //v3.0
//	if(CheckNavi() == true){
  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;
//  }
}
/* Functions that swaps images. */
function MM_swapImage() { //v3.0
//	if(CheckNavi() == true){

  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
//	if(CheckNavi() == true){
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
//	}
}

/* Functions that handle preload. */
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];}}
}



/* SubWindow Open */

var newWin = null;
function openSubWindow( PAGE_URL, title, width, height, scroll ){
	var isNS = navigator.appName.charAt(0) == "N";
	var isMAC = navigator.userAgent.toUpperCase().indexOf("MAC" ) >= 0;
	var isWIN = navigator.userAgent.toUpperCase().indexOf("WIN" ) >= 0;
	var isIE55 = navigator.userAgent.indexOf("5.5") >= 0;
	var isNS6 = navigator.userAgent.toUpperCase().indexOf("GECKO") >=0;
	var WINDOW_SIZE = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=" + scroll + ",resizable=yes,dependent=yes,width=" + width + ",height=" + height + "";

	if ( isNS ) {
		if( isNS6 ){
			if( newWin != null && !newWin.closed ){
				newWin.close();
			}
			newWin = window.open( PAGE_URL, title, WINDOW_SIZE );
			newWin.focus();
		}
		else{
			newWin = window.open( '', title, WINDOW_SIZE );
			newWin.location.href = PAGE_URL;
			newWin.focus();
		}
	}
	else {
		if ( isMAC ) {
			if( newWin != null && !newWin.closed ){
				newWin.close();
			}
			newWin = window.open( PAGE_URL, title, WINDOW_SIZE );
		}
		if ( isWIN ) {
			if( newWin != null && !newWin.closed ){
				newWin.close();
			}
				if( isIE55 ){ // for IE5.5 Bug
					newWin = window.open( PAGE_URL, title, WINDOW_SIZE );
					newWin.location.reload();
				} else {
					newWin = window.open( "", title, WINDOW_SIZE );
					newWin.location.href = PAGE_URL;
				}
		}
	}
}


function openSubWindowMenu( PAGE_URL, title, width, height, scroll ){
	var isNS = navigator.appName.charAt(0) == "N";
	var isMAC = navigator.userAgent.toUpperCase().indexOf("MAC" ) >= 0;
	var isWIN = navigator.userAgent.toUpperCase().indexOf("WIN" ) >= 0;
	var isIE55 = navigator.userAgent.indexOf("5.5") >= 0;
	var isNS6 = navigator.userAgent.toUpperCase().indexOf("GECKO") >=0;
	var WINDOW_SIZE = "toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=" + scroll + ",resizable=yes,dependent=yes,width=" + width + ",height=" + height + "";

	if ( isNS ) {
		if( isNS6 ){
			if( newWin != null && !newWin.closed ){
				newWin.close();
			}
			newWin = window.open( PAGE_URL, title, WINDOW_SIZE );
			newWin.focus();
		}
		else{
			newWin = window.open( '', title, WINDOW_SIZE );
			newWin.location.href = PAGE_URL;
			newWin.focus();
		}
	}
	else {
		if ( isMAC ) {
			if( newWin != null && !newWin.closed ){
				newWin.close();
			}
			newWin = window.open( PAGE_URL, title, WINDOW_SIZE );
		}
		if ( isWIN ) {
			if( newWin != null && !newWin.closed ){
				newWin.close();
			}
				if( isIE55 ){ // for IE5.5 Bug
					newWin = window.open( PAGE_URL, title, WINDOW_SIZE );
					newWin.location.reload();
				} else {
					newWin = window.open( "", title, WINDOW_SIZE );
					newWin.location.href = PAGE_URL;
				}
		}
	}
}


function announce(){
	alert('Sorry, Under Construction.');
}

isFixSize = false;
function setSize( width, height )
{
	if( !isFixSize ){
		isNS = navigator.appName.charAt(0) == "N";
		isMAC = navigator.userAgent.toUpperCase().indexOf("MAC" ) >= 0;
		isWIN = navigator.userAgent.toUpperCase().indexOf("WIN" ) >= 0;

		if( isMAC && !isNS ) { width += 8; height += 10; }
		if( isWIN && !isNS ) { width += 20; height += 45; }
		if( isMAC && isNS ) { width += 10; height += 15; }
		if( isWIN && isNS ) { width += 8; height += 8; }
		if( !isMAC && !isWIN && isNS ) { width += 8; height += 8; }

		resizeTo( width, height );
		isFixSize=true;
	}
}


function goHome(){
	opener.location.href = "/";
	window.close();
}


function showcase(){
	openSubWindow('/showcase/','show',680,490,'no');
}

function showIFAd(){
	openSubWindow('/ifreestyle/ad.htm','show',580,390,'no');
}
