//====================================================================================================
//	Function Name	:	Validate_Form
//----------------------------------------------------------------------------------------------------
var curImage = 1;
function changeImage(img, index, original_image)
{
	curImage = index;
	document.getElementById("img").src = img;
	document.getElementById("enlarge_image").href = original_image;
}

function nextprevImage(dir)
{
	var index = curImage;
	if(dir == 'next')
	{
		index++
		if(index >= arrImage.length)	index = 0;
	}
	else
	{
		index--
		if(index < 0)	index = arrImage.length-1;
	}
	
	curImage = index;
	document.getElementById("img").src = arrImage[index];
}

function popupWindowURL(url, winname, w, h, menu, resize, scroll)
{
    var x = (screen.width-w)/2;
    var y = (screen.height-h)/3;

	if(winname == null)
		winname	= "newWindow";
	
	if(w == null)
		w = 820;
	
	if(h == null)
		h = 600;
	
	if(resize == null)
		resize = 1;

	menutype   = "nomenubar";
	resizetype = "resizable";
	scrolltype = "scrollbars";
	
	if(menu)
		menutype	= "menubar";
	
	if(resize)
		resizetype	= "resizable";
	
	if(scroll)
		scrolltype	= "scrollbars";
	
    cwin = window.open(url, winname, "top=" + y + ",left=" + x + ",screenX=" + x + ",screenY=" + y + "," + "status," + menutype + "," + scrolltype + "," + resizetype + ",width=" + w + ",height=" + h);

	if(!cwin.opener)
		cwin.opener = self;

	cwin.focus();

	return true;
}

