/*
function ChangeLanguage(sLink) {
	if(this.top.menu != null) {this.top.menu.location.reload(sLink);};
}

function SizeScrollZone(sDiv, nHeader)
{
	var w = ( document.body.offsetHeight - nHeader);
	var style = "height:" + w + ";overflow:auto;width:100%"
	var master = document.getElementById(sDiv);
	if (master != null ) {master.style.cssText = style;};
}
*/

function OpenCalendar2(field) 
{
    if (location.hostname) {
        if (location.hostname.toLowerCase() == 'localhost') {
            Mypath = 'https://' + location.hostname + '/swa09';
        }
        else {
            Mypath = 'https://' + location.hostname;
        }
    }
    OpenCalendar(Mypath + '/_top_ctrl/TextBoxDate/calendar.aspx', field) 
}

function OpenPopup(wname, wurl, wattrs)
{ 
	var ww = screen.width;
	var wh = screen.height;
	var w = ww*.95; h = wh*.95;
	var x = (ww - w) / 2;
	var y = (wh - h) / 2;
	var attrs = "width=" + w + ",height=" + h + ",left=" + x + ",top=" + y + ",resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no";
	var w = window.open(wurl, wname, attrs, true);
	w.focus();
}



function CloseWindows()
{ 
window.opener = null;window.close(); 
}

function CloseWindowsAndReload()
{
	//debugger;
 if (window.opener != null)
	{
	window.opener.__doPostBack("", "");
	window.close();
	}
}

function CloseWindowsAndRefresh()
{
  //debugger;
 if (window.opener != null)
	{

	window.opener.__doPostBack("ctl00$ContentPlaceHolder1$refresh","");//("refresh", "");
	window.close();
	}
}

function Image_Over(img_id) {
		//debugger;
		var obj;
		var src;
		var ext;
		obj = document.getElementById(img_id);
		if (obj != null) {
		    src = obj.src;
		    ext = src.substring(src.length - 4, src.length);
		    obj.src = src.replace(ext, '_over' + ext);
		}
	}	

	function Image_Out(img_id) {
		var obj;
		var src;
		var ext;
		obj = document.getElementById(img_id);
		if (obj != null) {
		    src = obj.src;
		    obj.src = src.replace('_over', "");
		}
	}	


function HyperlinkImage_Over(img_id) {
		//debugger;
		var obj;
		var src;
		obj = document.getElementById(img_id);
		src = obj.innerHTML;
		if (src.indexOf("_over.") == -1)  
			{
				src=src.replace('.gif','_over.gif');
				obj.innerHTML = src;
			}
	}	

function HyperlinkImage_Out(img_id) {
		//debugger;
		var obj;
		var src;
		obj = document.getElementById(img_id); 
		src = obj.innerHTML;
		obj.innerHTML = src.replace('_over',"");
	}	
	
	
 			//This code is used to provide a reference to the radwindow "wrapper"
			function GetRadWindow()
			{
				var oWindow = null;
				if (window.radWindow) oWindow = window.radWindow;
				else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
				return oWindow;
			}		
			
			function Cancel_Clicked()
			{
				var oWindow = GetRadWindow();	
				oWindow.Close();
			}	
			
				
			function Save_Clicked()
			{
			
			    //update the Page_IsValid flag
			    Page_ClientValidate();
			        
			    //if page is not valid -> exit the function
			    //if the is left out, clientside validation will NOT work
			    if (!Page_IsValid) return;
			    
				var oWindow = GetRadWindow();
				
				oWindow.Close("save");
            }

            function Save_Clicked_NoVal() 
            {
                var oWindow = GetRadWindow();
                oWindow.Close("save");
            }	
 