﻿// JScript File
function selectFile(url, filename, foldername)
{
    window.open(url + "backoffice/selectfile.aspx?TextBox=" + filename + "&folderName=" + foldername,'selectfile','scrollbars=no, menubar=no, width=420px, height=400px, left='+ screen.width/2+ ', top='+ screen.height/2);
}
function openPopup(filename, windowname, options)
{
    window.open(filename, windowname, options);
}
function showPic(Pic)
{
    window.open('display_pic.aspx?pic='+Pic, null, 'resizable=1, width=200px, height=200px');
}
function checkImageResize1(imgObj, txtWidth, txtHeight, val1, val2, val3, val4)
{
    if(imgObj)
    {
        if(imgObj.checked)
        {
            txtWidth.disabled = false;
            txtHeight.disabled = false;
            ValidatorEnable(document.getElementById(val1), true); 
            ValidatorEnable(document.getElementById(val2), true); 
            ValidatorEnable(document.getElementById(val3), true); 
            ValidatorEnable(document.getElementById(val4), true); 
        }
        else
        {
            txtWidth.disabled = true;
            txtHeight.disabled = true;
            txtWidth.value = "";
            txtHeight.value = "";
            ValidatorEnable(document.getElementById(val1), false); 
            ValidatorEnable(document.getElementById(val2), false); 
            ValidatorEnable(document.getElementById(val3), false); 
            ValidatorEnable(document.getElementById(val4), false); 
        }
    }
}
function trim(str)
{
	return str.replace(/^\s*|\s*$/g,"");
}
//-------------------------------------------------------------------------
//    returns absolute top position of the object on the page

function GetAbsoluteTop(Element)
{
	var ElementParent = Element;
	var Top = Element.offsetTop;
	
	while(ElementParent.offsetParent != null)
	{
		ElementParent = ElementParent.offsetParent;
		if(ElementParent.offsetParent != null) 
			Top += ElementParent.offsetTop;
	}	
	return(Top);
}
//-------------------------------------------------------------------------
//    returns absolute left position of the object on the page

function GetAbsoluteLeft(Element)
{
	var ElementParent = Element;
	var Left = Element.offsetLeft;
	
	while(ElementParent.offsetParent != null)
	{
		ElementParent = ElementParent.offsetParent;
		if(ElementParent.offsetParent != null) 
			Left += ElementParent.offsetLeft;
	}
	return(Left);
}
