function gen_target_check_url (p1)
{
  var is_q=p1.indexOf('?');
  if (is_q== -1) return p1 + '?';
  else return p1 + '&';
}
	
function call_ikb_popup(p1, dest, p2, p3, p4, p5, p6, p7, p8, p9)
{
  // Last updated : 12.03.2010 12:02:39
if (! window.focus) return true;
var href;
if (typeof p1 == "undefined") url=""; else url=p1;
if (typeof p1 == "undefined") p1=""; else p1=encodeURIComponent(p1);
if (typeof p2 == "undefined") p2=""; else p2=encodeURIComponent(p2);
if (typeof p3 == "undefined") p3=""; else p3=encodeURIComponent(p3);
if (typeof p4 == "undefined") p4=""; else p4=encodeURIComponent(p4);
if (typeof p5 == "undefined") p5=""; else p5=encodeURIComponent(p5);
if (typeof p6 == "undefined") p6=""; else p6=encodeURIComponent(p6);
if (typeof p7 == "undefined") p7=""; else p7=encodeURIComponent(p7);
if (typeof p8 == "undefined") p8=""; else p8=encodeURIComponent(p8);
if (typeof p9 == "undefined") p9=""; else p9=encodeURIComponent(p9);

var ppath = '/portal/page/portal/';
var ipath = '/ikbViewer/page';
if (dest == "241")
window.location = ppath + '29EE2952CDCAD25EE040007F01003801?p_workflow_id='+ p1;
else if (dest == "282")
window.location = ppath + '29ECDD63A7F2437AE040007F010037FF?p_gencode_id='+ p1;
else if (dest == "288")
window.location = ppath + '29ECD34FF08A440FE040007F010037FD?p_doctype_id='+ p1;
else if (dest == "304")
window.location = ppath + '29EBC95DDC4F586AE040007F010037E0?p_attribute_id='+ p1;
else if (dest == "321")
window.location = ppath + '29EE2952CDD5D25EE040007F01003801?p_dimension_id='+ p1;
else if (dest == "303")
{ window.open(ppath + '29FE781D2A6A1B78E040007F01007124?maxCount='+ p2+ '&cbFunction='+ p3+ '&mode='+ p1+ '&cbClosure='+ p4,'_dimnav','height=500,top=' + (screen.height-500)/2 + ',width=400,left=' + (screen.width-400)/2 + ',scrollbars=yes,resizable=yes').focus();}
else if (dest == "481")
window.location = ppath + '29EBC216BB358AB3E040007F010037DE?p_styleset_id=41';
else if (dest == "383")
window.location = ppath + '29ED13D29F5CE466E040007F010037DC?p_group_id='+ p1;
else if (dest == "401")
window.location = ppath + '29ED13D29F22E466E040007F010037DC?p_acl_id='+ p1;
else if (dest == "403")
window.location = ppath + '29EBC216BB228AB3E040007F010037DE?p_user_id='+ p1;
else if (dest == "422")
window.location = ppath + '29FE823A7B0B65F9E040007F01007438?p_dimension_id='+ p1;
else if (dest == "461")
{ window.open(ppath + '29ECABF61ADDE2FBE040007F010037FB?p_document_id='+ p1,'imagedetails','scrollbars=no').focus();}
else if (dest == "424")
{ window.open(ppath + '29FE823A7B4165F9E040007F01007438?maxCount='+ p2+ '&cbFunction='+ p3+ '&mode='+ p1+ '&cbClosure='+ p4,'_dimnav2','height=500,top=' + (screen.height-500)/2 + ',width=400,left=' + (screen.width-400)/2 + ',scrollbars=yes,resizable=yes').focus();}
else if (dest == "462")
{ window.open(ppath + '29ECD34FF071440FE040007F010037FD?p_d_i=-161&p_d_c=&p_d_v='+ p1+ '&p_dimension_id='+ p1,'imagelist','scrollbars=no').focus();}
else if (dest == "463")
{ window.open(ppath + '29ED13D29F24E466E040007F010037DC?tema='+ p1+ '&p_dimension_id='+ p1,'doclist','scrollbars=no').focus();}
else if (dest == "464")
{ window.open(ppath + '29EBC216BB358AB3E040007F010037DE','_parent','scrollbars=no').focus();}
else if (dest == "465")
window.location = ppath + '29ECB23AE8584904E040007F01003CF8?p_document_id='+ p1+ '&p_style_id='+ p2;
else if (dest == "466")
{ window.open(ppath + '29ECB23AE8584904E040007F01003CF8?p_document_id='+ p1,'_parent','scrollbars=no').focus();}
else if (dest == "467")
window.location = ppath + '29ECDD63A82D437AE040007F010037FF?p_searchcode_id='+ p1;
else if (dest == "501")
{ window.open(ppath + '29FE781D2A601B78E040007F01007124?img_url='+ p1+ '&img_title='+ p2+ '&editorname='+ p3+ '&img_id='+ p4+ '&cbFunction='+ p5+ '&cbClosure='+ p6+ '&img_props='+ p7,'ImageInformation','scrollbars=no').focus();}
else if (dest == "525")
window.location = ppath + '29FAD9503F5BD822E040007F01005719?p_document_id='+ p1+ '&p_d_i=-201&p_d_c=&p_d_v='+ p1;
else if (dest == "541")
window.location = ppath + '29ECB23AE84E4904E040007F01003CF8?search_string='+ p1+ '&p_search_id='+ p2+ '&p_operation='+ p3;
else if (dest == "542")
window.location = ppath + '29EE2952CDE2D25EE040007F01003801?search_string='+ p1+ '&p_search_id='+ p2 + '&p_operation=reset';
else if (dest == "563")
{ window.open(ppath + '29EE2952CDD5D25EE040007F01003801?p_dimension_id='+ p1,'EditDimensionWithStyle','scrollbars=no').focus();}
else if (dest == "603")
{ window.open(ppath + '29FE781D2A601B78E040007F01007124?img_url='+ p1+ '&img_title='+ p2+ '&editorname='+ p3,'picFrame','scrollbars=no').focus();}
else if (dest == "645")
window.location = ppath + '29ECD34FF091440FE040007F010037FD';
else if (dest == "842")
{ window.open(ppath + '29FE823A7B4165F9E040007F01007438','_dimselector','height=500,top=' + (screen.height-500)/2 + ',width=600,left=' + (screen.width-600)/2 + ',scrollbars=yes,resizable=yes').focus();}
else if (dest == "843")
{ window.open(ppath + '29FE781D2A501B78E040007F01007124','_imageselector','height=703,top=' + (screen.height-703)/2 + ',width=900,left=' + (screen.width-900)/2 + ',scrollbars=yes,resizable=yes').focus();}
else if (dest == "844")
{ window.open(ppath + '29FE823A7B1665F9E040007F01007438?p_operation=new','_linkselector','height=451,top=' + (screen.height-451)/2 + ',width=945,left=' + (screen.width-945)/2 + ',scrollbars=yes,resizable=yes').focus();}
else if (dest == "850")
window.location = ppath + '2C3F568D57A343369917EA5260960DD5';
else if (dest == "855")
window.location = ppath + '1882614CF9FB42D6AA7598D3CA1D68FE';
else if (dest == "942")
{ window.open(ppath + '29ED13D29F63E466E040007F010037DC','_editimage','height=520,top=' + (screen.height-520)/2 + ',width=615,left=' + (screen.width-615)/2 + ',scrollbars=yes,resizable=yes').focus();}
else if (dest == "4377")
{ window.open(ppath + '66751E869E5B4411B786CF0B82636EF4?p_document_id='+ p1,'_new','height=400,top=' + (screen.height-400)/2 + ',width=1045,left=' + (screen.width-1045)/2 + ',scrollbars=yes,resizable=yes').focus();}
else if (dest == "4376")
{ window.open(ppath + 'CB971260AECC4692BEFDCA42C7D526BF','_form','width=1000,left=' + (screen.width-1000)/2 + ',scrollbars=yes,resizable=yes').focus();}
else if (dest == "4385")
{ window.open(ppath + 'B3D7A663830C49E4AC740D59D1AB5103?p_document_id='+ p1,'_thread','scrollbars=no').focus();}
else if (dest == "4382")
{ window.open(ppath + '146AE4FCCF8846B99918334EC49AD76E?p_document_id='+ p1+ '&tema='+ p2,'_processdoc','scrollbars=no').focus();}
else if (dest == "4381")
{ window.open(ppath + '025A00B8765F4BD8BBFBB5879C465824?p_document_id='+ p1,'_parent','scrollbars=no').focus();}
else if (dest == "4383")
window.location = 'about:blank?p_document_id='+ p1+ '&p_d_i=-4862&p_d_c=&p_d_v='+ p1;
else if (dest == "4388")
window.location = ppath + '2CF650947C794B9D89CEAABAC83F4978?p_document_id='+ p1;
else if (dest == "4397")
{ window.open(ppath + 'A6904FD88B7745B69581C47147D93723?p_document_id='+ p1,'_new','height=400,top=' + (screen.height-400)/2 + ',width=1045,left=' + (screen.width-1045)/2 + ',scrollbars=yes,resizable=yes').focus();}
else if (dest == "4884")
window.location = ppath + '29ECABF61AEDE2FBE040007F010037FB?p_dimensionattribute_id='+ p1;
else if (dest == "8350")
{ window.open(ppath + 'EAF50D043A9B48CEBF3CDAB77FB63362?p_document_id='+ p1,'_blank','height=600,top=' + (screen.height-600)/2 + ',width=600,left=' + (screen.width-600)/2 + ',scrollbars=yes,resizable=yes').focus();}
else if (dest == "8359")
window.location = ppath + '8B821002580747F2804DF5393131AC24?p_d_i=-161&p_d_c=&p_d_v='+ p1+ '&p_dimension_id='+ p1+ '&tema='+ p1;
else if (dest == "8360")
window.location = ppath + '66184E4A6A89472786CDA0F22347EC80?p_document_id='+ p1;
else if (dest == "8522")
window.location =  gen_target_check_url(url) + 'p_operation=New';
else if (dest == "7567")
{ window.open(ppath + '29FCE18C18206A9EE040007F01006C40?p_document_id='+ p1,'_new','height=400,top=' + (screen.height-400)/2 + ',width=1030,left=' + (screen.width-1030)/2 + ',scrollbars=no,resizable=yes').focus();}
else if (dest == "7320")
{ window.open(ppath + '29FE823A7B3165F9E040007F01007438','_imageselector','height=550,top=' + (screen.height-550)/2 + ',width=900,left=' + (screen.width-900)/2 + ',scrollbars=yes,resizable=yes').focus();}
else if (dest == "7583")
{ window.open(ppath + '29E96C1017A2B917E040007F01001DAF?p_document_id='+ p1,'_parent','scrollbars=no').focus();}
else if (dest == "7584")
{ window.open(ppath + '29FE781D29FD1B78E040007F01007124?p_document_id='+ p1+ '&p_d_i=-125&p_d_c=&p_d_v='+ p1+ '&p_d_i=-127&p_d_c=&p_d_v='+ p1,'_parent','scrollbars=no').focus();}
else if (dest == "7670")
window.location = ppath + 'F0BA2C377EEA455181C92A2209F97FD0?p_d_i=-161&p_d_c=&p_d_v='+ p1+ '&p_dimension_id='+ p1+ '&tema='+ p1;
else if (dest == "7814" || dest=="DEV_DESKTOP")
{ window.open(ppath + '29FE781D2A3E1B78E040007F01007124?p_mainmenuid='+ p1+ '&p_action='+ p2,'_new','height=800,top=' + (screen.height-800)/2 + ',width=1050,left=' + (screen.width-1050)/2 + ',scrollbars=yes,resizable=yes,menubar=1,toolbar=yes').focus();}
else if (dest == "7826")
{ window.open(ppath + '18DB5EEAD52C40CC94F973C08EFB4625?p_document_id='+ p1,'float_iframe_docaction','scrollbars=no').focus();}
else if (dest == "7813")
window.location = ppath + '29ECD34FF08A440FE040007F010037FD';
else if (dest == "7858")
window.location = ppath + '46F729C591FB48EAAA06FCBB8203F31C?p_document_id='+ p1;
else if (dest == "7860")
window.location = ppath + '6E3AD55EB9BE401DADEECB304D7C7AB4?p_document_id='+ p1;
else if (dest == "7873")
{ window.open(ppath + 'BE47913F54B242579712027E6C309917?p_document_id='+ p1,'_printout','height=500,top=' + (screen.height-500)/2 + ',width=550,left=' + (screen.width-550)/2 + ',scrollbars=yes,resizable=yes').focus();}
else if (dest == "7894")
window.location = ppath + 'AD1C677FCD7E42019761FE9D408521CD?p_d_i=-161&p_d_c=&p_d_v='+ p1+ '&p_dimension_id='+ p1+ '&tema='+ p1;
else if (dest == "7938")
window.location = ppath + 'A8FED6CA04D248A280602520CCFE24B6?p_d_i=-161&p_d_c=&p_d_v='+ p1+ '&p_dimension_id='+ p1+ '&tema='+ p1;
else if (dest == "7955")
window.location = ppath + '340C7EDB2107461A91CA4ECC956899DC?p_d_i=-161&p_d_c=&p_d_v='+ p1+ '&p_dimension_id='+ p1+ '&tema='+ p1;
else if (dest == "7958")
window.location = ppath + 'A49839CF466948A4B3C5330ABAD4E4FE?p_d_i=-161&p_d_c=&p_d_v='+ p1+ '&p_dimension_id='+ p1+ '&tema='+ p1;
else if (dest == "7963")
window.location = ppath + '9D852088165640F7A450DF56212AC228?tema='+ p1+ '&p_dimension_id='+ p1+ '&p_d_i=-161&p_d_c=&p_d_v='+ p1;
else if (dest == "7968")
window.location = ppath + '858248FFBF6F49DB86430911A2D5DDCE?tema='+ p1+ '&p_dimension_id='+ p1+ '&p_d_i=-161&p_d_c=&p_d_v='+ p1;
else if (dest == "7981")
window.location = ppath + 'CAEEBFD66A614F1DA424776A9581E41F?search_string='+ p1+ '&p_search_id='+ p2 + '&p_operation=New';
else if (dest == "8067")
window.location = ppath + 'FC56781CC118465D81A688075D4C2A7F?p_d_i=-161&p_d_c=&p_d_v='+ p1+ '&p_dimension_id='+ p1;
else if (dest == "8022")
window.location = ppath + '9ED63276B10D4AC681E3218372239693?p_document_id='+ p1;
else if (dest == "8100")
window.location = ppath + '8FCA1E938E51452AB03E06CF86751EEA?tema='+ p1+ '&p_dimension_id='+ p1+ '&p_d_i=-161&p_d_c=&p_d_v='+ p1;
else if (dest == "8090")
{ window.open(ppath + '572FF7D57B27477DABF51A9C688FB175?p_document_id='+ p1,'_parent','scrollbars=no').focus();}
else if (dest == "8130")
window.location = ppath + '086F6EBEEAF74C9A81DF0BF7D8A43C46?tema='+ p1+ '&p_dimension_id='+ p1+ '&p_d_i=-8272&p_d_c=&p_d_v='+ p1;
else if (dest == "8202")
window.location = ppath + '163A9226F0AB49FBA8B118B7F0079636?p_document_id='+ p1+ '&p_d_i=-8233&p_d_c=&p_d_v='+ p1;
else if (dest == "8225")
{ window.open(ppath + '56D65DA9AA1549D09A5E8840176BC605?p_document_id='+ p1,'_discussion','scrollbars=no').focus();}
else if (dest == "8252")
window.location = ppath + 'F8FB0F816AA940A6A5DBAF768991DEE5?p_document_id='+ p1+ '&p_d_i=-8238&p_d_c=&p_d_v='+ p1;
else if (dest == "8304")
window.location = ppath + '2258CA0584B648AB916636FD3D772748?p_document_id='+ p1;
else if (dest == "8305")
window.location = ppath + '00A712842D03443DA58ADACDA7F99107?p_document_id='+ p1;
else if (dest == "8337")
window.location = ppath + '7510F6AB635046CB9F28B8FD2C8FA285';
else if (dest == "9296")
window.location = ppath + 'DFB561ECC19C48E588A2682AAFCF842A';
else if (dest == "9297")
window.location = ppath + '1E3547B75AA54D1AB3B5F4157E1AFB09?p_document_id='+ p1;
else if (dest == "9312")
window.location = ppath + 'B32170D6468F49508B8D38073AF54DBB';
else if (dest == "9384")
window.location = ppath + '29ECDD63A80F437AE040007F010037FF?p_search_id='+ p2;
else if (dest == "9421")
window.location = ppath + 'EC8DFC3599624D58993995BA10A6CD0C';
else if (dest == "9678")
window.location = ppath + 'CB971260AECC4692BEFDCA42C7D526BF?p_style_id=9680';
else if (dest == "9672")
window.location = ppath + 'CB971260AECC4692BEFDCA42C7D526BF?p_document_id='+ p1+ '&p_notification_id='+ p2+ '&p_style_id='+ p3+ '&p_document_id='+ p4+ '&p_origin_url='+ p5;
else if (dest == "9457" || dest=="SHOW_IN_CONTEXT")
{ window.open('http://www.krf.no/ikbViewer/pls/ikb_portlet_formatting_set.show_in_context?p_guid='+ p1+ '&p_app='+ p2,'_new','height=800,top=' + (screen.height-800)/2 + ',width=1050,left=' + (screen.width-1050)/2 + ',scrollbars=yes,resizable=yes,menubar=1,toolbar=yes').focus();}
else if (dest == "9460" || dest=="SUBSYSTEM")
{ window.open('http://www.krf.no/ikbViewer/development/subsystem/list_by_subsystem.jsp?cbFunction=returnMetadata&cbClosure='+ p1+ '&cbMetadatatype='+ p2+ '&cbLang='+ p3+ '&cbSite='+ p4,'_metadata_select','height=600,top=' + (screen.height-600)/2 + ',width=400,left=' + (screen.width-400)/2 + ',scrollbars=yes,resizable=yes').focus();}
else if (dest == "10143")
{ window.open(ppath + '4F2DEF3655494051A7847639E02CD471','_parent','scrollbars=no').focus();}
else if (dest == "10144")
{ window.open(ppath + 'C5769D48F705491AB49EDC94ACE7666D','_parent','scrollbars=no').focus();}
else if (dest == "10159" || dest=="TITLE_REDIRECT")
window.location = 'http://www.krf.no/ikbViewer/pls/portlet_manage_redirect.redirect?p_document_id='+ p1+ '&p_site_id='+ p2+ '&p_target_id='+ p3+ '&p_domain_name='+ p5+ '&p_document_type_id='+ p4 + '&p_debug=0';
else if (dest == "10166")
window.location = ppath + '36B38815E76893DBE040007F0100270A?p_document_id='+ p1+ '&p_version_no='+ p2;
else if (dest == "10257")
window.location = ipath + '/ikbdemo/contentpage?p_d_i=-161&p_d_c=&p_d_v='+ p1+ '&p_dimension_id='+ p1;
else if (dest == "15699")
window.location = ipath + '/krf/nyheter/tema?tema='+ p1;
else if (dest == "15752")
window.location = ipath + '/krf/artikkel?p_document_id='+ p1+ '&hovedtema='+ p2+ '&person='+ p3+ '&hva='+ p4;
else if (dest == "15819")
window.location = ipath + '/krf/presse?side='+ p1;
else if (dest == "15827")
window.location = ipath + '/krf/kontakt-oss?side='+ p1;
else if (dest == "15749")
window.location = ipath + '/krf/artikkel/hva-mener-krf?p_document_id='+ p1;
else if (dest == "15830")
window.location = ipath + '/krf/organisasjon?side='+ p1;
else if (dest == "15831")
window.location = ipath + '/krf/medlemssider/foredrag/artikkel?p_document_id='+ p1;
else if (dest == "15835")
window.location = ipath + '/krf/sokeresultat?search_string='+ p1;
else if (dest == "15838")
window.location = ipath + '/krf/politikk?side='+ p1;
else if (dest == "15854")
window.location = ipath + '/krf/nyheter-old?side='+ p1;
else if (dest == "15855")
window.location = ipath + '/krf/nyheter/side?side='+ p1;
else if (dest == "15946")
window.location = ipath + '/krf/politikk/side?p_document_id='+ p1;
else if (dest == "15929")
window.location = ipath + '/krf/pressemelding?p_document_id='+ p1;
else if (dest == "15971")
window.location = ipath + '/krf/politikk/english/side?p_document_id='+ p1;
else if (dest == "16007")
window.location = ipath + '/krf/nyheter/debatt/debatt?p_document_id='+ p1;
else if (dest == "16047")
window.location = ipath + '/krf/organisasjon/kalender/detaljer?p_document_id='+ p1;
else if (dest == "16253")
window.location = ipath + '/krf/organisasjon/fylkes-og-lokallag/forside?org='+ p1;
else if (dest == "16283")
window.location = ipath + '/krf/organisasjon/fylkes-og-lokallag/kalender/detaljer?p_document_id='+ p1+ '&org='+ p2;
else if (dest == "16309")
window.location = ipath + '/krf/organisasjon/fylkes-og-lokallag/nyheter/artikkel?p_document_id='+ p1+ '&org='+ p2;
else if (dest == "16348")
window.location = ipath + '/krf/blogg/forside?blogg='+ p1;
else if (dest == "16448")
window.location = ipath + '/krf/blogg/artikkel?p_document_id='+ p1+ '&blogg='+ p2;
else if (dest == "16535")
window.location = ipath + '/krf/artikkel/rss?p_document_id='+ p1;
else if (dest == "16573")
window.location = ipath + '/krf/redirect?p_document_id='+ p1;
else if (dest == "16579")
window.location = ipath + '/krf/politikk/politisk-program/artikkel?p_document_id='+ p1;
else if (dest == "16571")
window.location = ipath + '/krf/artikkel/politikk/politiske-dokumenter?p_document_id='+ p1;
else if (dest == "16905")
window.location = ipath + '/krf/artikkel?p_document_id='+ p1+ '&hovedtema='+ p2+ '&person='+ p3+ '&hva='+ p4;
else if (dest == "16717")
{ window.open(ipath + '/krf/utskriftsvennlig?p_document_id='+ p1,'_printout','height=600,top=' + (screen.height-600)/2 + ',width=900,left=' + (screen.width-900)/2 + ',scrollbars=yes,resizable=yes').focus();}
else if (dest == "16852")
window.location = ipath + '/krf/nyheter/ide-krfs-medlemsmagasin/artikkel?p_document_id='+ p1;
else if (dest == "17028")
window.location = ipath + '/krf/krf-kvinner/artikkel?p_document_id='+ p1;
else if (dest == "17065")
window.location = ipath + '/krf/medlemssider/krf-har-svart/artikkel?p_document_id='+ p1;
else if (dest == "17069")
window.location = ipath + '/krf/medlemssider/idebanken/artikkel?p_document_id='+ p1;
else if (dest == "17072")
window.location = ipath + '/krf/medlemssider/interne-dokumenter/artikkel?p_document_id='+ p1;
else if (dest == "17075")
window.location = ipath + '/krf/medlemssider/valg/artikkel?p_document_id='+ p1;
else if (dest == "17100")
window.location = ipath + '/krf/medlemssider/medlemsnytt/artikkel?p_document_id='+ p1;
else if (dest == "17107")
window.location = ipath + '/krf/medlemssider/rundskriv/artikkel?p_document_id='+ p1;
else if (dest == "17118")
window.location = ipath + '/krf/medlemssider/kurs-og-konferanser/artikkel?p_document_id='+ p1;
else if (dest == "17137")
window.location = ipath + '/krf/blogg/artikkel?blogg='+ p1+ '&p_document_id='+ p2;
else if (dest == "30701")
window.location = ipath + '/krf/nettbutikk?varegruppe='+ p1;
else if (dest == "33107")
window.location = ipath + '/krf/artikkel/vare-hovedsaker?p_document_id='+ p1;
else if (dest == "35087")
window.location = ipath + '/krf/artikkel?dokid='+ p1+ '&hovedtema='+ p2+ '&person='+ p3+ '&hva='+ p4;
else if (dest == "34434")
window.location = ipath + '/krf/artikkel/landsmoetet?p_document_id='+ p1;
else if (dest == "34602")
window.location = ipath + '/iknowshop?varegruppe='+ p1;
else if (dest == "34604")
window.location = ipath + '/iknowshop/ordre?p_document_id='+ p1;
else if (dest == "34810")
window.location = ipath + '/krf/organisasjon/bli-medlem/takk';
else if (dest == "37120")
window.location = ipath + '/krf/medlemssider/krfkvinner/artikkel?p_document_id='+ p1;
 else call_ikb_popup_dynamic(p1,dest,p2,p3,p4,p5,p6,p7,p8,p9);
return false;
}
function call_ikb_homeplace(documentid, target, siteid, domainid, documenttype, viewertarget, viewdebug, versionno)
{
if (typeof documentid == "undefined")
   documentid="";
if (typeof siteid == "undefined")
	siteid="";
if (typeof domainid == "undefined")
	domainid="";
if (typeof documenttype == "undefined")
	documenttype="";
if (typeof viewertarget == "undefined")
	viewertarget="";
if (typeof viewdebug == "undefined")
	viewdebug ="";
if (typeof versionno == "undefined")
	versionno ="";

  var run_url = "/ikbViewer/pls/portlet_manage_redirect.redirect?p_document_id="+ encodeURIComponent(documentid)+ "&p_site_id="+ encodeURIComponent(siteid)+ "&p_target_id="+ encodeURIComponent(viewertarget)+ "&p_domain_name="+ encodeURIComponent(domainid)+ "&p_document_type_id="+ encodeURIComponent(documenttype) + "&p_debug="+ encodeURIComponent(viewdebug) + "&p_version_no="+ encodeURIComponent(versionno);
		 var code = jQuery.ajax({
		  url: run_url,
		  async: false
		 }).responseText;
		 if (code != null)
			if (viewdebug == "1")
				alert(code);
			else
				eval(code);

             return false;
             }
            
function set_new_version (doc_id, version_no, site_id)
        {
         var run_url = "/ikbViewer/pls/ikb_ce_custom_editor_portlet.switch_version?p_document_id="+ encodeURIComponent(doc_id)+ "&p_site_id="+ encodeURIComponent(site_id)+ "&p_version_no="+ encodeURIComponent(version_no);

         var code = jQuery.ajax({
          url: run_url,
          async: false
         }).responseText;

	if (code != "OK")
		alert(code);
	else
        	window.location.reload();
        }
