
// Print functions from the old site.
// Added by Tony Flodberg, Nextech 2004-01-28
function open_newgac_window(url)
{
	var bredde=580;
	var hojde=490;
	var w=screen.width; var leftPos=((w-bredde)/2-20);
	var h=screen.height; var topPos=((h-hojde)/2-20);
	//alert (w+'-'+h+'-'+leftPos+'-'+topPos)
	var nytvindue=window.open(url,'listeside','toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width='+bredde+',height='+hojde+',top='+topPos+',left='+leftPos);
}

function print_main(pageid)
{
	var bredde=350;
	var hojde=400;
	var w=screen.width; var leftPos=((w-bredde)/2-20);
	var h=screen.height; var topPos=((h-hojde)/2-20);
	//alert (w+'-'+h+'-'+leftPos+'-'+topPos)
	var nytvindue=window.open('/templates/gac_Print.aspx?id='+pageid,'listeside','toolbar=no,location=no,directories=no,status=yes,menubar=yes,resizable=yes,copyhistory=no,scrollbars=yes,width='+bredde+',height='+hojde+',top='+topPos+',left='+leftPos);
}

function print_main_directory(jscontact,jsselect,jssearch,jsserviceid)
{
	var bredde=350;
	var hojde=400;
	var w=screen.width; var leftPos=((w-bredde)/2-20);
	var h=screen.height; var topPos=((h-hojde)/2-20);
	//alert (w+'-'+h+'-'+leftPos+'-'+topPos)
	var nytvindue=window.open('/templates/gac_PrintDirectorySearch.aspx?contact='+jscontact+'&select='+jsselect+'&search='+jssearch+'&serviceid='+jsserviceid,'listeside','toolbar=no,location=no,directories=no,status=yes,menubar=yes,resizable=yes,copyhistory=no,scrollbars=yes,width='+bredde+',height='+hojde+',top='+topPos+',left='+leftPos);
}

function print_main_directory_office(jsps,jsofficeid)
{
	var bredde=350;
	var hojde=400;
	var w=screen.width; var leftPos=((w-bredde)/2-20);
	var h=screen.height; var topPos=((h-hojde)/2-20);
	//alert (w+'-'+h+'-'+leftPos+'-'+topPos)
	var nytvindue=window.open('/templates/gac_PrintDirectorySearchOffice.aspx?ps='+jsps+'&officeid='+jsofficeid,'listeside','toolbar=no,location=no,directories=no,status=yes,menubar=yes,resizable=yes,copyhistory=no,scrollbars=yes,width='+bredde+',height='+hojde+',top='+topPos+',left='+leftPos);
}

function print_main_directory_contact(jsofficeid,jscontactid)
{
	var bredde=350;
	var hojde=400;
	var w=screen.width; var leftPos=((w-bredde)/2-20);
	var h=screen.height; var topPos=((h-hojde)/2-20);
	//alert (w+'-'+h+'-'+leftPos+'-'+topPos)
	var nytvindue=window.open('/templates/gac_PrintDirectorySearchOffice.aspx?officeid='+jsofficeid+'&contactid='+jscontactid,'listeside','toolbar=no,location=no,directories=no,status=yes,menubar=yes,resizable=yes,copyhistory=no,scrollbars=yes,width='+bredde+',height='+hojde+',top='+topPos+',left='+leftPos);
}

function print_main_port(jscountrystring,jssearchstring,jsletterstring,jssortstring)
{
	var bredde=350;
	var hojde=400;
	var w=screen.width; var leftPos=((w-bredde)/2-20);
	var h=screen.height; var topPos=((h-hojde)/2-20);
	//alert (w+'-'+h+'-'+leftPos+'-'+topPos)
	var nytvindue=window.open('/templates/gac_PrintPortSearch.aspx?countrystring='+jscountrystring+'&searchstring='+jssearchstring+'&letterstring='+jsletterstring+'&sortstring='+jssortstring,'listeside','toolbar=no,location=no,directories=no,status=yes,menubar=yes,resizable=yes,copyhistory=no,scrollbars=yes,width='+bredde+',height='+hojde+',top='+topPos+',left='+leftPos);
}

function print_main_contact(jspageid)
{
	var bredde=350;
	var hojde=400;
	var w=screen.width; var leftPos=((w-bredde)/2-20);
	var h=screen.height; var topPos=((h-hojde)/2-20);
	//alert (w+'-'+h+'-'+leftPos+'-'+topPos)
	var nytvindue=window.open('/templates/gac_PrintContactSearch.aspx?PageID='+jspageid,'listeside','toolbar=no,location=no,directories=no,status=yes,menubar=yes,resizable=yes,copyhistory=no,scrollbars=yes,width='+bredde+',height='+hojde+',top='+topPos+',left='+leftPos);
}

function print_main_contact_office(jsps,jsofficeid)
{
	var bredde=350;
	var hojde=400;
	var w=screen.width; var leftPos=((w-bredde)/2-20);
	var h=screen.height; var topPos=((h-hojde)/2-20);
	//alert (w+'-'+h+'-'+leftPos+'-'+topPos)
	var nytvindue=window.open('/templates/gac_PrintContactOfficeSearch.aspx?ps='+jsps+'&officeid='+jsofficeid,'listeside','toolbar=no,location=no,directories=no,status=yes,menubar=yes,resizable=yes,copyhistory=no,scrollbars=yes,width='+bredde+',height='+hojde+',top='+topPos+',left='+leftPos);
}

function print_main_normal_search(jssearch,jsstart)
{
	var bredde=350;
	var hojde=400;
	var w=screen.width; var leftPos=((w-bredde)/2-20);
	var h=screen.height; var topPos=((h-hojde)/2-20);
	//alert (w+'-'+h+'-'+leftPos+'-'+topPos)
	var nytvindue=window.open('/templates/gac_PrintNormalSearch.aspx?id=45663&searchstring='+jssearch+'&start='+jsstart,'listeside','toolbar=no,location=no,directories=no,status=yes,menubar=yes,resizable=yes,copyhistory=no,scrollbars=yes,width='+bredde+',height='+hojde+',top='+topPos+',left='+leftPos);
}



function convertRolloutListBranch() {
  $("ul.rollout_branch > li > p, ul.ROLLOUT_BRANCH > li > p").each(function() {
    if ($(this).children(":eq(1)").is("br")) {
      var clonedMe = $(this).clone();
      var clonedStrong = clonedMe.children(":eq(0)");
      var clonedSiblings = $(this).siblings().clone();

      clonedMe.children(":eq(0)").remove();
      clonedMe.children(":eq(0)").remove();
      $(this).siblings().remove();

      var insideHtml = clonedMe.html();
      $(this).html("");
      clonedStrong.css({ 'cursor': 'pointer' });
      
      $(this).append('<strong><a href="#" onclick="return false;" >' + clonedStrong.text() + '</a></strong>');
      var newDiv = $('<div class="rollout-content_branch">' + clonedMe.text() + '</div>');
      newDiv.append(clonedSiblings);
      newDiv.hide();
      $(this).append(newDiv);
    }
  });
  $('ul.rollout_branch li, ul.ROLLOUT_BRANCH li').click(function() {
    if ($(this).hasClass('opened') == false) {
      $('div.rollout-content_branch').slideUp();
      $('ul.rollout_branch li').each(function() {
        $(this).removeClass('opened');
      });
      $(this).find('div.rollout-content_branch').slideDown();
      $(this).addClass('opened');
    }
  });
}


