function changeImage(name)
	{
		document.mainimage.src = name
	}

var origImage, origHeight, origWidth
function SelectImg(hostedsitepath, imageName) {
	var imgMaxWidth = 289;
	var imgMaxHeight = 385;
	var imgName = document.getElementById('image')
	origImage = document.getElementById('image').src
	origHeight = document.getElementById('image').height
	origWidth = document.getElementById('image').width
	imgName.src = hostedsitepath + imageName;
	document.getElementById('hid_imageName').name = imageName;

	imgName.removeAttribute('width');
	imgName.removeAttribute('height');
	var imgWidth = imgName.naturalWidth || imgName.width;
	var imgHeight = imgName.naturalHeight || imgName.height;

	if (imgWidth > imgMaxWidth)
	{
		imgName.width = imgMaxWidth;
	} else if (imgHeight > imgMaxHeight)
	{
		imgName.height = imgMaxHeight;
	} else {
		imgName.height = imgHeight;
		imgName.width = imgWidth;
	}
}
function RestoreImg() {
	var imgName = document.getElementById('image')
	imgName.src = origImage;
	imgName.height = origHeight;
	imgName.width = origWidth;
}

var preloaded = new Array();
function preload_images() {
	for (var i = 0; i < arguments.length; i++){
		preloaded[i] = document.createElement('img');
		preloaded[i].setAttribute('src',arguments[i]);
	}
}



// Set the horizontal and vertical position for the popup
PositionX = 100;
PositionY = 100;
// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)
defaultWidth  = 500;
defaultHeight = 500;
// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows
var AutoClose = false;
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function popImage(hostedsitepath, imageName,imageTitle,thumb){
	if (thumb) {
		imageURL = hostedsitepath + imageName
	} else {
		imageURL = hostedsitepath + document.getElementById('hid_imageName').name
	}
	if (isNN){imgWin=window.open('about:blank','',optNN);}
	if (isIE){imgWin=window.open('about:blank','',optIE);}
	with (imgWin.document){
		writeln('<html><head><title>Loading...</title><style>body{margin:0px;} a {color: #000; font: 12px arial;}</style>');
		writeln('<sc'+'ript>');
		writeln('var isNN,isIE;');
		writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('isNN=(navigator.appName=="Netscape")?1:0;');
		writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		writeln('function reSizeToImage(){');
		writeln('	 if (isIE){');
		writeln('		window.resizeTo(100,100);');
		writeln('		width=document.images[0].width');
		writeln('		height=100-(document.body.clientHeight-document.images[0].height)+50;');
		writeln('		window.resizeTo(width,height);}');
		writeln('	 if (isNN){');
		writeln('		window.innerWidth=document.images["img_imageToDisplay"].width+20;');
		writeln('		window.innerHeight=document.images["img_imageToDisplay"].height+40;}}');
		writeln('function doTitle(){document.title="'+imageTitle+'";}');
		writeln('</sc'+'ript>');
		if (!AutoClose) 
			writeln('</head><body bgcolor="#FFFFFF" scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
		else 
		writeln('</head><body bgcolor="#FFFFFF" scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
		writeln('<CENTER><a href="javascript:window.close();"><img name="img_imageToDisplay" src='+imageURL+' style="display:block"><BR />Close window</a></CENTER></body></html>');
		close();
	}
}

function validate(f){
	var tempArr = new Array()
	var valid = true;
	var count = 0;
	var maxItems = 3;
	var msg ="You have made an error.\n";

	for(var i = 0;i<f.chk_small.length;i++){
		if(f.chk_small[i].checked){
			count++
		}
	}
	if (count < maxItems || count > maxItems)
	{
		msg += "\n - Please select " + maxItems + " homepage small websites.";
		valid = false;
	}



	count = 0;
	for(var i = 0;i<f.rad_large.length;i++){
		if(f.rad_large[i].checked){
			count++
		}
	}
	if (count != 1)
	{
		msg += "\n - Please select a large homepage item";
		valid = false;
	}

	if (valid == false)
	{
		alert(msg)
	}
	return valid;
}

//Manual Scroller- © Dynamic Drive 2001
//For full source code, visit http://www.dynamicdrive.com
function movedown(pageNo){
	if (window.moveupvar) clearTimeout(moveupvar)
	if (iens6&&parseInt(crossobj.style.top)>=(contentheight*(-1)+100) && parseInt(crossobj.style.top)>=pageNo)
		crossobj.style.top=parseInt(crossobj.style.top)-speed+"px"
	else if (ns4&&crossobj.top>=(contentheight*(-1)+100))
		crossobj.top-=speed
	movedownvar=setTimeout("movedown(" + pageNo + ")",20)
}

function moveup(pageNo){
if (window.movedownvar) clearTimeout(movedownvar)
	if (iens6&&parseInt(crossobj.style.top)<=0 && parseInt(crossobj.style.top)<=pageNo)
		crossobj.style.top=parseInt(crossobj.style.top)+speed+"px"
	else if (ns4&&crossobj.top<=0)
		crossobj.top+=speed
	moveupvar=setTimeout("moveup(" + pageNo + ")",20)
}

function stopscroll(){
if (window.moveupvar) clearTimeout(moveupvar)
if (window.movedownvar) clearTimeout(movedownvar)
}

function moveDownHeight(){
	stopscroll()
	if (parseInt(crossobj.style.top) != 0) { moveupvar=setTimeout("moveup(parseInt(crossobj.style.top)+" + scrollHeight + ")",20) }
}
function moveUpHeight(){
	stopscroll()
	if (parseInt(crossobj.style.top) >= ((contentheight-scrollHeight)*-1)) { movedownvar=setTimeout("movedown(parseInt(crossobj.style.top)-" + scrollHeight + ")",20) }
}
//