function setDocHeight()
{
    try
    {
        var iframeElement = parent.document.getElementById('main'); 
        iframeElement.style.height = "10000px"; //100px or 100% 
                    
        var iframeElement2 = parent.document.getElementById('menu'); 
        iframeElement2.style.height = "10000px"; //100px or 100% 
                    
        //alert(iframeElement2);
                    
        docHeight = document.getElementById("marker").offsetTop;
                
        //alert(docHeight);
        
        //Min fönster bör vara ca 800    
        if(docHeight > 0)
        {
            if(docHeight > 1400)
            {
                var iframeElement = parent.document.getElementById('main'); 
                iframeElement.style.height = docHeight + "px"; //100px or 100% 
                    
                var iframeElement2 = parent.document.getElementById('menu'); 
                iframeElement2.style.height = docHeight + "px"; //100px or 100% 
            }
            else
            {
                docHeight = 1400;
                
                var iframeElement = parent.document.getElementById('main'); 
                iframeElement.style.height = docHeight + "px"; //100px or 100% 
                    
                var iframeElement2 = parent.document.getElementById('menu'); 
                iframeElement2.style.height = docHeight + "px"; //100px or 100% 
            }
        }
    }
    catch(err)
    {
        //Handle errors here
    }
}

function jumpScroll() 
{
    parent.window.scroll(0,0); // horizontal and vertical scroll targets
}

jumpScroll();

function OpenPopWin(url, w, h)
{
  window.open(url, '', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizeable=no,width=' + w + ', height=' + h +'');
}

function OpenPopWinAddAscent(gradeId, ascentName, crag, cragSector, cragCountryCode, ascentType, repeat)
{
    var url = 'EditAscent.aspx?Action=Add&GradeId=' + gradeId + '&AscentName=' + escape(ascentName) + '&Crag=' + escape(crag) + '&CragCountryCode=' + cragCountryCode + '&CragSector=' + escape(cragSector) + "&AscentType=" + ascentType + '&AscentClass=0&Repeat=' + repeat;
    window.open(url, '', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizeable=no,width=900, height=200');
}

function Close()
{
  window.close();
}

function RefreshOpenerWin()
{
  window.opener.location.reload(true);
  window.close();
}

function RefreshOpenerWinWithNewUrl(url)
{
  window.opener.location.href = url;
  window.close();
}

function GetDate(CtrlName)
{
  ChildWindow = window.open('../commonFunctions/Calendar.aspx?FormName=' + document.forms[0].name + '&CtrlName=' + CtrlName, "_blank", "width=270,height=300,top=200,left=200,toolbars=no,scrollbars=no,status=no,resizable=no");    
}

function ConfirmDelete(msg)
{
  if (confirm(msg) == true)
	return true;
  else
    return false;
}
