
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function showObject(objectName,hideObjectName)
{
	var arrObjectName = objectName.split("|");
	for(i = 0; i < arrObjectName.length;i++)
	{
		if(document.getElementById(arrObjectName[i]) != null)
		{
			document.getElementById(arrObjectName[i]).style.display = "";
		}
	}
	
	var arrHideObjectName = hideObjectName.split("|");
	for(i = 0; i < arrHideObjectName.length;i++)
	{
		if(document.getElementById(arrHideObjectName[i]) != null)
		{
			document.getElementById(arrHideObjectName[i]).style.display = "none";
		}
	}
	
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function FormatNumber(num)
{
	if(!isNaN(num))
	{
		//Round the number
		num = Math.round(num*100)/100;
		var strReturnValue = FormatNumberFull(num,2,true,false,true);
		var iStart = strReturnValue.indexOf(".");
		var strTempDecimal = strReturnValue.substring(iStart,strReturnValue.length);
		if(strTempDecimal.length == 2)
		{
		    strReturnValue = strReturnValue + "0";
		}
		return strReturnValue;
	}
	else
	{
		return "";
	}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function confirmAction(strMessage, strLink)
{
    if(confirm(strMessage))
    {
        window.location.href=strLink;
        return true;
    }
    else
    {
        return false;
    }
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function FormatNumberFull(num,decimalNum,bolLeadingZero,bolParens,bolCommas)
/**********************************************************************
	IN:
		NUM - the number to format
		decimalNum - the number of decimal places to format the number to
		bolLeadingZero - true / false - display a leading zero for
										numbers between -1 and 1
		bolParens - true / false - use parenthesis around negative numbers
		bolCommas - put commas as number separators.
 
	RETVAL:
		The formatted number!
 **********************************************************************/
{ 
        if (isNaN(parseInt(num))) return "NaN";

	var tmpNum = num;
	var iSign = num < 0 ? -1 : 1;		// Get sign of number
	 
	// Adjust number so only the specified number of numbers after
	// the decimal point are shown.
	tmpNum *= Math.pow(10,decimalNum);
	tmpNum = Math.round(Math.abs(tmpNum))
	tmpNum /= Math.pow(10,decimalNum);
	tmpNum *= iSign;					// Readjust for sign
	
	
	// Create a string object to do our formatting on
	var tmpNumStr = new String(tmpNum);

	// See if we need to strip out the leading zero or not.
	if (!bolLeadingZero && num < 1 && num > -1 && num != 0)
		if (num > 0)
			tmpNumStr = tmpNumStr.substring(1,tmpNumStr.length);
		else
			tmpNumStr = "-" + tmpNumStr.substring(2,tmpNumStr.length);
   
	// See if we need to put in the commas
	if (bolCommas && (num >= 1000 || num <= -1000)) {
		var iStart = tmpNumStr.indexOf(".");
		if (iStart < 0)
			iStart = tmpNumStr.length;

		iStart -= 3;
		while (iStart >= 1) {
			tmpNumStr = tmpNumStr.substring(0,iStart) + "," + tmpNumStr.substring(iStart,tmpNumStr.length)
			iStart -= 3;
		}		
	}

	// See if we need to use parenthesis
	if (bolParens && num < 0)
		tmpNumStr = "(" + tmpNumStr.substring(1,tmpNumStr.length) + ")";

	return tmpNumStr;		// Return our formatted string!
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function printMe(trHideName)
{
    window.open(window.location.href+ "&print=yes");
    /*
    var trHide = document.getElementById(trHideName)
    if(trHide != null)
    {
        trHide.style.display = "none";
    }
    window.print();
    */
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function GetDayInMonth(year, month)
{
     year = parseInt(year,10);
    month = parseInt(month,10);
     return 32 - new Date(year, month - 1, 32).getDate();
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function displayTipObject(objectName, objectToDisplay, numObject)
{
	//Hide all
	for(i = 0; i < numObject; i++)
	{
		var objHideDiv = document.getElementById(objectName + "_" + i);
		if(objHideDiv != null)
		{
			objHideDiv.style.display = "none";
		}
	}
	//Display the object
	var objDisplayDiv = document.getElementById(objectName + "_" + objectToDisplay);
	if(objDisplayDiv != null)
	{
		objDisplayDiv.style.display = "";
	}
		
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function showTable(strArrTable,tableName)
	{
		
		var arrTable = strArrTable.split("|");
		for(i = 0; i < arrTable.length;i++)
		{
			document.getElementById(arrTable[i]).style.display="none";
		}
		document.getElementById(tableName).style.display="";
	}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function changePayTypeView(hideControl,displayControl)
{
	var arrControl = getElementsByTagNames('span');
	for (i = 0; i < arrControl.length; i++)
	{	
		e = arrControl[i];
		if (e.id == hideControl)
		{
			e.style.display="none";
		}
		if (e.id == displayControl)
		{
			e.style.display="";
		}
	}
	/*
	if(document.getElementById(hideControl) != null)
	{
		document.getElementById(hideControl).style.display="none";
	}
	if(document.getElementById(displayControl) != null)
	{
		document.getElementById(displayControl).style.display="";
	}
	*/
}
function getElementsByTagNames(list,obj)
{
	if (!obj) var obj = document;
	var tagNames = list.split(',');
	var resultArray = new Array();
	for (var i=0;i<tagNames.length;i++)
	{
		var tags = obj.getElementsByTagName(tagNames[i]);
		for (var j=0;j<tags.length;j++)
		{
			resultArray.push(tags[j]);
		}
	}
	var testNode = resultArray[0];
	if (testNode.sourceIndex)
	{
		resultArray.sort(function (a,b) {
				return a.sourceIndex - b.sourceIndex;
		});
	}
	else if (testNode.compareDocumentPosition)
	{
		resultArray.sort(function (a,b) {
				return 3 - (a.compareDocumentPosition(b) & 6);
		});
	}
	return resultArray;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function changeHiddenID(ID)
{
	document.getElementById("hHiddenID").value = ID;
	return true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function priceRangeCompare(strUrl, MenuID)
{
	var PriceFrom = document.getElementById("txtPriceFrom" + "_" + MenuID + "").value;
	var CurrencyFrom = document.getElementById("cbCurrencyFrom" + "_" + MenuID + "").value;
	var PriceTo = document.getElementById("txtPriceTo" + "_" + MenuID + "").value;
	var CurrencyTo = document.getElementById("cbCurrencyTo" + "_" + MenuID + "").value;
	strUrl = strUrl + "&pricefrom=" + PriceFrom;
	strUrl = strUrl + "&currencyfrom=" + CurrencyFrom;
	strUrl = strUrl + "&priceto=" + PriceTo;
	strUrl = strUrl + "&currencyto=" + CurrencyTo;
	window.location.href=strUrl;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function productAttributeFilter(strUrl, MenuID,ListProductAttributeDetailID,AppendUrl)
{
	
	var count = 0;
	var strAlert = "";
	var strQueryListProductAttributeID = "";
	var arrListProductAttributeDetailID = ListProductAttributeDetailID.split("|");
	for (i = 0; i < arrListProductAttributeDetailID.length; i++)
	{	
		if(arrListProductAttributeDetailID[i] != "")
		{
			var e = document.getElementById("ckProductAttribute_" + MenuID + "_" + arrListProductAttributeDetailID[i]);
			if (e.checked == true)
			{
				strQueryListProductAttributeID = strQueryListProductAttributeID + "&padid=" + e.value;
				count++;
			}
		}
	}
	if (count > 0)
	{
	}
	else
	{
		alert("You must select at least one  attribute to filter!");
		return false;
	}
	strUrl = strUrl + strQueryListProductAttributeID;
	strUrl = strUrl + AppendUrl;
	window.location.href=strUrl;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function productAttributeFilterEx(strUrl, MenuID,ListProductAttributeDetailID,ListPriceRangeID)
{
	
	var count = 0;
	var strAlert = "";
	var strQueryListProductAttributeID = "";
	var arrListProductAttributeDetailID = ListProductAttributeDetailID.split("|");
	for (i = 0; i < arrListProductAttributeDetailID.length; i++)
	{	
		if(arrListProductAttributeDetailID[i] != "")
		{
			var e = document.getElementById("ckProductAttribute_" + MenuID + "_" + arrListProductAttributeDetailID[i]);
			if (e.checked == true)
			{
				strQueryListProductAttributeID = strQueryListProductAttributeID + "&padid=" + e.value;
				count++;
			}
		}
	}
	
	strUrl = strUrl + strQueryListProductAttributeID;
	//Append for price range
	
	var arrListPriceRangeID = ListPriceRangeID.split("|");
	//alert(strUrl);
	for (i = 0; i < arrListPriceRangeID.length; i++)
	{	
		if(arrListPriceRangeID[i] != "")
		{
			var e = document.getElementById("ckPriceRange_" + MenuID + "_" + arrListPriceRangeID[i]);
			if (e.checked == true)
			{
				strUrl = strUrl + e.value;
				count++;
			}
		}
	}
	
	if (count > 0)
	{
	}
	else
	{
		alert("You must select at least one condition to filter!");
		return false;
	}
	window.location.href=strUrl;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function priceRangeFilter(strUrl, MenuID,ListPriceRangeID,AppendUrl)
{
	
	var count = 0;
	var strAlert = "";
	var strQueryListPriceRangeID = "";
	var arrListPriceRangeID = ListPriceRangeID.split("|");
	//alert(strUrl);
	for (i = 0; i < arrListPriceRangeID.length; i++)
	{	
		if(arrListPriceRangeID[i] != "")
		{
			var e = document.getElementById("ckPriceRange_" + MenuID + "_" + arrListPriceRangeID[i]);
			if (e.checked == true)
			{
				strUrl = strUrl + e.value;
				count++;
			}
		}
	}
	if (count > 0)
	{
	}
	else
	{
		alert("You must select at least one  to filter!");
		return false;
	}
	strUrl = strUrl + AppendUrl;
	//alert(strUrl);
	window.location.href=strUrl;
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function changeComboBoxUrl(target)
{
	var strUrl = target.value
	window.location.href=strUrl;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function changeComboBox(target, queryKey, queryValue, strUrl)
{
    var strType = "&";
    if(strUrl.indexOf("?") <= 0)
    {
        strType = "?";
    }
	if((strUrl.indexOf("?" + queryKey + "=") > 0) || (strUrl.indexOf("&" + queryKey + "=") > 0))
	{
		strUrl = strUrl.replace("?" + queryKey + "=" + queryValue, "?" + queryKey + "=" + target.value);
		strUrl = strUrl.replace("&" + queryKey + "=" + queryValue, "&" + queryKey + "=" + target.value);
	}
	else
	{
		strUrl = strUrl + strType + queryKey + "=" + target.value
	}
	window.location.href=strUrl;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function changeComboAppend(target, queryKey, queryValue, strUrl)
{
	//
	strUrl = strUrl + "&" + queryKey + "=" + target.value
	window.location.href=strUrl;
}




////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function OpenWindow(urlImage, iWidth, iHeight)
{
	var url = urlImage;
	var width=iWidth-10;
	var height=iHeight-10;
	var LeftPosition = (screen.width) ? (screen.width-width)/2 : 0;
	var TopPosition = (screen.height) ? (screen.height-height)/2 : 0;
	if(iHeight<screen.height)
	{
		window.open(url,'wealthmagazine','top='+TopPosition+',left='+LeftPosition+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+width+',height='+height+'').focus();
	}
	else
	{
		window.open(url,'wealthmagazine','top='+TopPosition+',left='+LeftPosition+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+width+',height='+height+'').focus();
	}
}



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function openEditor(formName, ImageFolder, strUrl)
{
	
	strUrl = strUrl + "?form=" + formName + "&folder=" + ImageFolder;
	var width=680;
	var height=400;
	var LeftPosition = (screen.width) ? (screen.width-width)/2 : 0;
	var TopPosition = (screen.height) ? (screen.height-height)/2 : 0;
	window.open(strUrl,'OnlineEditor','top='+TopPosition+',left='+LeftPosition+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+width+',height='+height+'').focus();

}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Get Website Url
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function GetWebsiteUrl()
{
	var strReturnValue = "";
	var strUrl = window.location.href.toLowerCase();
	strUrl = strUrl.replace("http://","");
	var iLastIndex = strUrl.lastIndexOf("/");
	//Prevent for infinite loop
	var iLoopIndex = 0; 
	while((iLastIndex > 0) && (iLoopIndex < 20))
	{
		strUrl = strUrl.substring(0,iLastIndex);
		iLastIndex = strUrl.lastIndexOf("/");
		iLoopIndex++;
	}
	strUrl = "http://" + strUrl + "/";
	return strUrl;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function actionMe(action, actionWho)
	{
		var count = 0;
		var strAlert = "";
		for (i = 0; i < document.frmForm.elements.length; i++)
		{	
			e = document.frmForm.elements[i];
			if (e.name == "ckSelect[]" && e.checked == true)
			{
				count++;
			}
		}
		if (count > 0)
			if(strAlert != "")
			{
				alert(strAlert);
				return false;
			}
			else
			{
				return confirm("You are about to " + action + " " + count + " selected  " + actionWho + "(s). Do you wish to continue?")
			}
		else
		{
			alert("You must select at least one  " + actionWho + " to " + action + "!");
			return false;
		}
	}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function actionMeEx(action, actionWho, appendMessage)
	{
		var count = 0;
		var strAlert = "";
		for (i = 0; i < document.frmForm.elements.length; i++)
		{	
			e = document.frmForm.elements[i];
			if (e.name == "ckSelect[]" && e.checked == true)
			{
				count++;
			}
		}
		if (count > 0)
			if(strAlert != "")
			{
				alert(strAlert);
				return false;
			}
			else
			{
				return confirm("You are about to " + action + " " + count + " selected  " + actionWho + "(s).\n" + appendMessage +".\n Do you wish to continue?")
			}
		else
		{
			alert("You must select at least one  " + actionWho + " to " + action + "!");
			return false;
		}
	}	
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	function sortMe(strUrl, Sort, strQueryString, target)
	{
		if(strUrl.indexOf("order=") > 0)
		{
			strUrl = strUrl.replace("order=" + Sort,"order=" + target.value);
		}
		else
		{
			if(strQueryString == "")
			{
				strUrl = strUrl + "?" + "order=" + target.value;
			}
			else
			{
				strUrl = strUrl + "&" + "order=" + target.value;
			}
		}
		window.location.href=strUrl;
	}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	function sortbyMe(strUrl, SortBy, strQueryString, target)
	{
		if(strUrl.indexOf("orderdirection=") > 0)
		{
			strUrl = strUrl.replace("orderdirection=" + SortBy,"orderdirection=" + target.value);
		}
		else
		{
			if(strQueryString == "")
			{
				strUrl = strUrl + "?" + "orderdirection=" + target.value;
			}
			else
			{
				strUrl = strUrl + "&" + "orderdirection=" + target.value;
			}
		}
		window.location.href=strUrl;
	}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Check All function
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	function checkAll(coltrolName, target)
	{
		var iIndex = 1;
		for (i = 0; i < document.frmForm.elements.length; i++)
		{	
			e = document.frmForm.elements[i];
			if ((e.name == coltrolName) && (e.disabled == false))
			{
				e.checked = target.checked;
				/*var trRow = document.getElementById("trRow" + iIndex);
				if(target.checked)
				{
					trRow.bgColor = "#CEDAEF";
				}
				else
				{
					trRow.bgColor = "#EFEFEF";
				}
				*/
			}
			if ((e.name == coltrolName))
			{
				iIndex++;
			}
		}
	}
	
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	function checkSelect(target, iIndex)
	{
		var trRow = document.getElementById("trRow" + iIndex);
		if(target.checked)
		{
			trRow.bgColor = "#CEDAEF";
		}
		else
		{
			trRow.bgColor = "#EFEFEF";
		}
	}
	
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function changeCountry(target,ProvinceComboboxName,ProvinceDivID,DistrictComboboxName,DistrictDivID)
		{
			var CountryCode = target.value;
			var iIndex = GetArrayIndex(arrCountryArray,CountryCode);
			var strProvinceControl = "";
			if(iIndex >= 0)
			{
				var strListProvinceCode = arrProvinceListArrayCode[iIndex]
				var strListProvinceName = arrProvinceListArrayName[iIndex]
				var arrProvinceCode = strListProvinceCode.split("|");
				var arrProvinceName = strListProvinceName.split("|");
				if(arrProvinceCode.length > 0)
				{
					strProvinceControl = strProvinceControl + "<select  class=\"TEXTBOX\" id=\"" + ProvinceComboboxName + "\" name=\"" + ProvinceComboboxName + "\" onchange=\"changeProvince(this,'" + DistrictComboboxName + "','" + DistrictDivID + "')\">";
					for(i = 0; i < arrProvinceCode.length;i++)
					{
						strProvinceControl = strProvinceControl + "<option value=\"" + arrProvinceCode[i] + "\">" + arrProvinceName[i] + "</option>";
					}
					strProvinceControl = strProvinceControl + "</select>";
				}
			}
			else
			{
				strProvinceControl = strProvinceControl + "<select  class=\"TEXTBOX\" id=\"" + ProvinceComboboxName + "\" name=\"" + ProvinceComboboxName + "\">";
				strProvinceControl = strProvinceControl + "<option value=\"\">---</option>";
				strProvinceControl = strProvinceControl + "</select>";
				document.getElementById(DistrictDivID).innerHTML = strProvinceControl;
			}
			document.getElementById(ProvinceDivID).innerHTML = strProvinceControl;
		}
		////////////////////////////////////////////////////////////////////////////////////
		//
		////////////////////////////////////////////////////////////////////////////////////
		function changeProvince(target,DistrictComboboxName,DistrictDivID)
		{
			var ProvinceCode = target.value;
			var iIndex = GetArrayIndex(arrProvinceArray,ProvinceCode);
			
			var strDistrictControl = "";
			if(iIndex >= 0)
			{
				var strListDistrictCode = arrDistrictListArrayCode[iIndex]
				var strListDistrictName = arrDistrictListArrayName[iIndex]
				var arrDistrictCode = strListDistrictCode.split("|");
				var arrDistrictName = strListDistrictName.split("|");
				if(arrDistrictCode.length > 0)
				{
					strDistrictControl = strDistrictControl + "<select class=\"TEXTBOX\" id=\"" + DistrictComboboxName + "\" name=\"" + DistrictComboboxName + "\" onchange=\"changeProvince(this,'" + DistrictComboboxName + "','" + DistrictDivID + "')\">";
					for(i = 0; i < arrDistrictCode.length;i++)
					{
						strDistrictControl = strDistrictControl + "<option value=\"" + arrDistrictCode[i] + "\">" + arrDistrictName[i] + "</option>";
					}
					strDistrictControl = strDistrictControl + "</select>";
				}
			}
			else
			{
				strDistrictControl = strDistrictControl + "<select class=\"TEXTBOX\" id=\"" + DistrictComboboxName + "\" name=\"" + DistrictComboboxName + "\">";
				strProvinceControl = strProvinceControl + "<option value=\"\">---</option>";
				strDistrictControl = strDistrictControl + "</select>";
			}
			document.getElementById(DistrictDivID).innerHTML = strDistrictControl;
			
		}
		////////////////////////////////////////////////////////////////////////////////////
		//
		////////////////////////////////////////////////////////////////////////////////////
		function GetArrayIndex(arrArray,value)
		{
			var iReturnValue = -1;
			for(i = 0; i < arrArray.length;i++)
			{
				if(arrArray[i] == value)
				{
					iReturnValue = i;
				}
			}
			return iReturnValue;
		}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  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 MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



///////////////////////////////////////////////////////////////////////////////////////////
	//
	///////////////////////////////////////////////////////////////////////////////////////////
	function setTopPosition(divObject,scrollTop)
	{
		divObject.style.top = scrollTop  + "px";
	}
	///////////////////////////////////////////////////////////////////////////////////////////
	//
	///////////////////////////////////////////////////////////////////////////////////////////
	function setLeftPosition(divObject,scrollLeft)
	{
		divObject.style.left = scrollLeft + "px";
	}
	
	//////////////////////////////////////////////////////////////////////////////////
	//Get Offset left of object
	//////////////////////////////////////////////////////////////////////////////////
	function getOffsetLeft(obj)
	{
		var offsetParent = obj.offsetParent;
		var offsetLeft = obj.offsetLeft
		
		var iMaxParentLevel = 40;
		var i = 0;
		//Try to get container offset
		while((offsetParent != null) && (i < iMaxParentLevel))
		{
			offsetLeft = parseInt(offsetParent.offsetLeft,10) +  parseInt(offsetLeft,10);
			offsetParent = offsetParent.offsetParent;
			i++;
		}
		
		return offsetLeft;
	}
	//////////////////////////////////////////////////////////////////////////////////
	//Get Offset top of object
	//////////////////////////////////////////////////////////////////////////////////
	function getOffsetTop(obj)
	{
		var offsetParent = obj.offsetParent;
		var offsetTop = obj.offsetTop;
		
		var iMaxParentLevel = 40;
		var i = 0;
		//Try to get container offset
		while((offsetParent != null) && (i < iMaxParentLevel))
		{
			offsetTop = parseInt(offsetParent.offsetTop,10) +  parseInt(offsetTop,10);
			offsetParent = offsetParent.offsetParent;
			i++;
		}
		
		return offsetTop;
	}


