function init() {
        DynLayerInit();
        imageScroll = new LoopScroll('imageScroll',galaxyWindow,galaxyContent,5,10);
}
function MM_popupMsg(msg) { 
  alert(msg);
}

function init() {
        DynLayerInit();
		    imageScroll = new LoopScroll('imageScroll',galaxyWindow,galaxyContent,2,10);
					
}

function replace(string,text,by) {
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}

function poplgImage(imgName, imgsrc, mainImgsrc)
{
		var description = replace((imgName.substr(3,10)),'_roll','')
		document.images[imgName].src = '/images/pictures/smsize_on/'+ imgsrc
		if(browser == "Netscape")
		document.mainimg.src='/images/pictures/midsizent/'+ mainImgsrc 
		else
		document.mainimg.src='/images/pictures/midsize/'+ mainImgsrc 
			var largeIMG = mainImgsrc
		showSec(description)
		//document.all.maintable.background = '/images/pictures/smsize_on/'+ mainImgsrc ;
		document.formPop.poppop.value = mainImgsrc
}

function popUpImage(x)
{
	if(x)
	{
			var popW = 572, popH = 534;
	}
	else	
		var popW = 572, popH = 557;
		
		var w = 480, h = 340;
		if (document.all || document.layers) {
		   w = screen.availWidth;
		   h = screen.availHeight;
		}

		var leftPos = (w-popW)/2, topPos = (h-popH)/2;
		var querySt = document.formPop.poppop.value
			//window.open ('popup.asp?file='+querySt ,'popMe','width=572,height=557')//document.formPop.poppop.value)
			window.open('popup.asp?file='+querySt ,'popMe','width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos);
}
function restoreImg( imgName, imgsrc)
{
		var description = replace((imgName.substr(3,10)),'_roll','')
		document.images[imgName].src = '/images/pictures/smsize/'+ imgsrc 
		hideSec(description)
		}
		ns4 = (document.layers) ? true:false 
		ie4 = (document.all) ? true:false 
		ng5 = (document.getElementById) ? true:false 

function hideSec(n) { 
		if (ng5) document.getElementById('sec' +  n).style.visibility = "hidden" 
		else if (ns4) document.layers["sec" + n].visibility = "hide" 
		else if (ie4) document.all["sec" + n].visibility ="hidden" 

}
function showSec(n) { 
	if(browser == "Netscape")
	{
	middle(n)
	}
		if (ng5) document.getElementById('sec' + n).style.visibility = "visible"; 
		else if (ns4) document.layers["sec" + n].visibility = "show"; 
		else if (ie4) document.all["sec" + n].style.visibility = "visible"; 
		}
		if (document.layers) {
		    width = window.innerWidth;
		}
		else if (document.all) {
		    width = document.body.clientWidth;
}
function middle(n) {

    if (document.layers) {  // if netscape 
				width = window.innerWidth;
		 		document.layers['sec'+n].pageX = width/2 - document.layers['dummy'].document.width/2;
      	document.layers['sec'+n].pageY = '260'
    }
    else if (document.all) {  // if IE
		 		width = document.body.clientWidth;
				var layerwidth = replace((document.all('dummy').style.width),'px','')
		    document.all('myLayer').style.posLeft = (width/2) - layerwidth/2
        document.all('myLayer').style.posTop = '255'
    }
		else  //if netscape6 
		{
				width = window.innerWidth;
				var layerwidth2 = replace((document.getElementById('dummy').style.width),'px','')
				document.getElementById('sec'+n).style.left  = width/2 - layerwidth2/2 +10;
      	document.getElementById('sec'+n).style.top  = '260'
				width = window.innerWidth;
								
		}
}
