﻿
// using (multiline textbox, Current label count, multiline textbox maxlength)
function checkCharacterTotal(sTextBox, lblCount, iMaxLength) 
{
	var oTextBox = document.getElementById(sTextBox);
	var olblCount = document.getElementById(lblCount);

	if (olblCount)
	{
		//if (lblCount > iMaxLength)
		if (oTextBox.value.length >= iMaxLength)
		{
			olblCount.innerHTML = iMaxLength - (oTextBox.value.length - 1);
			oTextBox.value = oTextBox.value.substring(0, iMaxLength);	
		}
		else
		{
			olblCount.innerHTML = iMaxLength - oTextBox.value.length;
		}	
	}		
}

var ThbWidth = 127;
var currProd = 0;
function scrol_jump(GetPo) {
    var prodWidth = $("#galleryBox").children("div.galleryItem").size();

    //TotalWidth = ((prodWidth * ThbWidth) - ((ThbWidth * 5) - 19)) * -1;

    //currPos = parseInt($("#galleryBox").css("left").split('px')[0]);

    currProd = currProd + GetPo;
    GalLeft = (currProd * -127)

    if ((currProd >= 0) && (currProd <= (prodWidth - 5))) {
        $("#galleryBox").animate({
            left: GalLeft + "px"
        }, 250);
    } else {
        currProd = currProd - GetPo;
    }
}

CLast = 1;
function GetReportPage(Gthis) {
    
    Celement = Gthis.value;
    
    $("#Report_" + Celement).show();
    $("#Report_" + CLast).hide();

    CLast = Celement;
}
LastID = 1;
function GetDetail(GetID) {
    var oLast = document.getElementById("List_" + LastID);
    var oGet = document.getElementById("List_" + GetID);

    oLast.style.display = 'none';
    oGet.style.display = 'block';

    LastID = GetID;
}

