// JavaScript Document

// Example: preloadImages('file.gif', 'http://www.x.com/y.gif');

function preloadImages()
{
	if(document.images) {
		if(!document.imageArray) document.imageArray = new Array();
		var i,j = document.imageArray.length, args = preloadImages.arguments;
    		for(i=0; i<args.length; i++) {
			if (args[i].indexOf("#")!=0) {
        			document.imageArray[j] = new Image;
        			document.imageArray[j++].src = args[i];
			}
		}
	}
}

function MM_swapImgRestore()
{
	var i, x;
	var a = document.MM_sr;

	for(i=0; a && i<a.length && (x=a[i]) && x.oSrc; i++)
		x.src = x.oSrc;
}

function MM_findObj(n, d)
{
	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);
	if(!x && document.getElementById)
		x = document.getElementById(n);
	return x;
}

function MM_swapImage()
{
	var i, x;
	var j = 0;
	var 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 checkIE()
{
if ( (navigator.appVersion.indexOf("MSIE")!=-1) )
     	return true;
else
	return false;
}

function loadSplash()
{
	if(checkIE())
		location.replace("splash_ie.htm");
	else
		location.replace("splash.htm");
}

function openMain()
{
	openInPopUp("aboutus.htm");
}

function openInfo()
{
	openInPopUp("info.htm");
}

function openInPopUp(url)
{
	var x = (screen.availWidth - 768) / 2; // width of the visible screen, minus the width of the pop-up window
	var y = (screen.availHeight - 576) / 2; // height of the visible screen, minus width of the pop-up window
	var attribs = "width=768,height=576,screenx="+x+",left="+x+",screeny="+y+",top="+y+",toolbar=no,resizable=no,location=no,menubar=no,directories=no,copyhistory=no,personalbar=no,scrollbars=no,status=no"
	var w = window.open( url, "MainPopUp", attribs, true );
	w.focus();
}

function openMap()
{
	var x = (screen.availWidth - 576) / 2; // width of the visible screen, minus the width of the pop-up window
	var y = (screen.availHeight - 520) / 2; // height of the visible screen, minus width of the pop-up window
	var attribs = "width=576,height=576,screenx="+x+",left="+x+",screeny="+y+",top="+y+",toolbar=no,resizable=no,location=no,menubar=yes,directories=no,copyhistory=no,personalbar=no,scrollbars=no,status=no"
	var w = window.open( "salonmap.htm", "MainPopUp", attribs, true );
	w.focus();
}

function openPhotoWindow(ind)
{
	var x, y;
	
	// Test for horizontal windows first
	if(ind == 3 || ind == 4 || ind == 5 || ind == 6) {
		x = 700;
		y = 520;
	} else {
		x = 520;
		y = 700;
	}
	
	var attribs = "width="+x+",height="+y+",screenx=50,left=50,screeny="+y+",top="+y+",toolbar=no,resizable=no,location=no,menubar=no,directories=no,copyhistory=no,personalbar=no,scrollbars=no,status=no"
	var w = window.open( "photo_0"+ind+".htm", "_photo", attribs, true );
	w.focus();
}

var flag = true;

function crap()
{
	if(flag == true)
		flag = false;
	else
		flag = true;
	self.statusbar.visible = flag;
	self.movTo(100,100);
	window.alert(self.statusbar.visible);
}