function changeLanguage(code) 
{
	parent.window.location.href = 'main.asp?lang=' + code;
}

function gotoPage(link)
{
	window.location.href = link;
}

function jumpPage(item)
{
	var site=item.selectedIndex;
	if ((item.options[site].value !="") && (item.options[site].value != "0"))
	window.location.href = item.options[site].value;
}

function openLink(item)
{
	var site=item.selectedIndex;
	if ((item.options[site].value !="") && (item.options[site].value != "0"))
	window.open(item.options[site].value, 'Link', 'menubar=yes, toolbar=yes, location=yes, resizable=1');
}

function getPos(el,sProp) {
var iPos=0;
if (el!=null) {
iPos+=el["offset"+sProp];
el=el.offsetParent;
}
return iPos;
}

function ShowHideMenu(obj1, obj2, value) {
var val;
val = value == 'S'?'visible':'hidden';
with(obj2.style) {
	left=getPos(obj1,"Left");
	top=getPos(obj1,"Top") + obj1.offsetHeight - 5;
	visibility=val;
}
if (value=='S') {
	val = 'visible';
//	obj1.style.color = '#ffff00';
//	obj1.style.backgroundColor = '#4b7dff';
} else {
	val = 'hidden';
//	obj1.style.color = '#ffffff';
//	obj1.style.backgroundColor = '';
}
}	

function MM_preloadImages() {
  var d=document;
  if (d.images) {
	if (!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
    for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0) {
			d.MM_p[j]=new Image;
			d.MM_p[j++].src=a[i];
		}
	}
}

function Prev(pImg, pA, pSpan, max, pPath) {
  var i = pImg.src;
  var j = parseInt(i.charAt(i.length-5));
  if (j == 1) 
	j = max;
  else
	j = j - 1;
  pImg.src = pPath + 'thumb/' + imageList[j-1][0];
  pA.href = pPath + imageList[j-1][0];
  pSpan.innerText = imageList[j-1][1];
}

function Next(pImg, pA, pSpan, max, pPath) {
  var i = pImg.src;
  var j = parseInt(i.charAt(i.length-5));
  if (j == max) 
	j = 1;
  else
	j = j + 1;
  pImg.src = pPath + 'thumb/' + imageList[j-1][0];
  pA.href = pPath + imageList[j-1][0];
  pSpan.innerText = imageList[j-1][1];
}

function CheckDate(fd, fm, fy, td, tm, ty)
{
	var aDate;
	
	aDate = new Date(fy, fm-1, fd);
	if (aDate.getFullYear() != fy || (aDate.getMonth()+1) != fm || aDate.getDate() != fd) {
		alert("From Date is not valid!");
		return false;
	}
	
	aDate = new Date(ty, tm-1, td);
	if (aDate.getFullYear() != ty || (aDate.getMonth()+1) != tm || aDate.getDate() != td) {
		alert("To Date is not valid!");
		return false;
	}
	
	return true;
}