﻿// JScript File
var popWindow;
function openwindow(URL)
{
	popWindow = window.open(URL,'_blank','height=600,width=600,status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes');
	popWindow.focus;
}
var imageWindow;
function openimagewindow(URL,height,width)
{
	imageWindow = window.open(URL,'imageWindow','height=' + (height+100) + ',width=' + (width+100) + ',status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,titlebar=no',true);
	imageWindow.resizeTo(width+60,height+128);
		imageWindow.setActive;

}
function showRadImageDialog(DialogName,ImageURL,ImageTitle,height,width)
{                    
    //Force reload in order to guarantee that the onload event handler of the dialog which configures it executes on every show.
    var oWnd = window.radopen(null, DialogName);
    oWnd.setSize (width+ 20, height + 43);
    oWnd.set_title (ImageTitle);
    oWnd.Argument = ImageURL;
    
    //oWnd.setUrl(oWnd.get_navigateUrl());
    
    //var oWnd = $find(DialogName);
    oWnd.setUrl('ImageViewer.aspx?ImageURL=' + ImageURL );
    oWnd.center();
    oWnd.show();
}
function OnRadImageDialogShow(radWindow)
{                    
    //Get current content of textarea
    var oText = document.getElementById("InfoArea").value;
    
    //Create a new Object to be used as an argument to the radWindow
    var arg = new Object();                    
    //Using an Object as a argument is convenient as it allows setting many properties.
    arg.TextValue = oText;
    arg.Color = "red";
    arg.BackColor = "yellow";
                        
    //Set the argument object to the radWindow        
    radWindow.Argument = arg;
}               
function getElementPosition(elemID){
var offsetTrail = document.getElementById(elemID);
var offsetLeft = 0;
var offsetTop = 0;
while (offsetTrail){
offsetLeft += offsetTrail.offsetLeft;
offsetTop += offsetTrail.offsetTop;
offsetTrail = offsetTrail.offsetParent;
}
if (navigator.userAgent.indexOf('Mac') != -1 && typeof document.body.leftMargin != 'undefined'){
offsetLeft += document.body.leftMargin;
offsetTop += document.body.topMargin;
}
return {left:offsetLeft,top:offsetTop};
}

function movePanel(elemID, tagWidth){
var obj = document.getElementById(elemID);
//            alert(getElementPosition('ctl00_Panel1').left);
            obj.style.position ="relative";
            obj.style.overflow ="hidden";
//            document.getElementById('ctl00_pnlNews').style.left = getElementPosition('ctl00_Panel1').left;
            obj.style.left = obj.parentElement.offsetWidth - tagWidth;
            obj.style.width = tagWidth;

}

