// *********************  Pop Up Window Function *************************
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos)
{
	if(pos=="random")
	{
		LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
		TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}
	if(pos=="center")
	{
		LeftPosition=(screen.width)?(screen.width-w)/2:100;
		TopPosition=(screen.height)?(screen.height-h)/2:100;
	}
	else if((pos!="center" && pos!="random") || pos==null)
	{
		LeftPosition=0;TopPosition=20
	}
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win=window.open(mypage,myname,settings);
}

// *********************  SMART NAVIGATION *************************

var scroll = (window.scrollTo) ? 1 : 0; 

function saveScroll(ASPPageName) 
{ 
	try 
	{ 
		if (!scroll) return; 
		var x = document.body.scrollLeft; 
		var y = document.body.scrollTop; 
		var DocumentTitle = ASPPageName; 
		var cookieDate = new Date(); 
		cookieDate.setTime(cookieDate.getTime() + 3*1000); //3 seconds 
		var Expires = ";expires=" + cookieDate.toString(); 
		document.cookie="xy=" + x + "_" + y + "_" + DocumentTitle + Expires; // 
	} 
	catch(e) 
	{ 

	} 
} 

function loadScroll(ASPPageName) 
{ 
	try 
	{ 
		if (!scroll) return; 
		var xy = ReadACookie("xy"); 
		if (!xy) return; 
		var ar = xy.split("_"); 
		if (ar.length == 3) 
		{ 
			if (ar[2] == ASPPageName) 
			{ 
				window.scrollTo(parseInt(ar[0]), parseInt(ar[1])); 
			} 
		} 
	} 
	catch(e) 
	{ 

	} 
} 

function ReadACookie(TheName) 
{ 
	try 
	{ 
		var cookieData = new String(document.cookie); 
		var cookieHeader = TheName + "="; 
		var cookieStart = cookieData.indexOf(cookieHeader) + cookieHeader.length; 
		var cookieEnd = cookieData.indexOf(";",cookieStart); 
		if(cookieEnd == -1) 
		{ 
			cookieEnd = cookieData.length 
		} 
		if(cookieData.indexOf(cookieHeader) != -1) 
		{ 
			return cookieData.substring(cookieStart,cookieEnd); 
		} 
		else 
		{ 
			//no cookie 
			return "" 
		} 
	} 

	catch(e) 
	{ 
		return "" 
	} 
}

// ***************** END SMART NAVIGATION ******************************

// ***************** DHTML PHOTO DISPLAY *******************************
function go1()
{
  if (document.selecter1.select1.options[document.selecter1.select1.selectedIndex].value != "none") 
  {
   location = document.selecter1.select1.options[document.selecter1.select1.selectedIndex].value
  }
}


function disppic(x,w,s)
{	 
	var y='"'+x+'"';
	var h=s;
	parent.disp.location.src="display.html";
	var picture=parent.disp.document.getElementById("pic");
	if (!parent.disp.document.images[0])
	 	{
	 	var newimage=parent.disp.document.createElement("IMG");
 	 	newimage.src=x;
 	 	newimage.id="imageid";
 	 	newimage.height=h;
 	 	newimage.width=w;
 	 	newimage.alt="Slightly Something Photos";
 	 	picture.appendChild(newimage);
 	 	}
 	else
 		{
 		var swap= parent.disp.document.getElementById("imageid");
		swap.src=x;
		swap.height=h;
		swap.width=w;
		}
}
// ************************************************************************************


