/*********************
 * Enkel Ok/Cancel test
 **********************
 */
function confirm_entry()
{
  input_box=confirm("Er du sikker?");
  if (input_box==true) { 
      return true;
  } else {
    return false;
  } 
}

/***********************
 * Printer hjelpe pop-up
 ***********************
 */
function help(topic) {
  day = new Date();
  id = day.getTime();
  URL = '../includes/help.php?t='+topic;

  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=237,height=222,left = 500,top = 200');");
}

/***********************************
 * Sender formen til gitt plassering
 ***********************************
 */
function changeActionSubmit(id, action, submit, confirm)
{
  var myElem = eval('document.'+id);
  myElem.action = action;
  if (submit==1){
    if(confirm==1){
      if(confirm_entry()){
	myElem.submit();
      }
    }else{ myElem.submit(); }
  }
  return id;
}
/********************************
 * Gå til link med bekreftelse
 ********************************
 */
function linkConfirm(link) {
  if (confirm_entry()){
    window.location.href = link;
  }
}
/********************************
 * Gå til link
 ********************************
 */
function link(link) {
  window.location.href = link;
}
/********************************
 * Bildeupload
 ********************************
 */
function img_upl(item) {
 day = new Date();
 id = day.getTime();
  
 URL = '../includes/image_upl.php?item='+item;
 eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=600,left = 500,top = 200');"); 
}
/********************************
 * Epostmelding
 ********************************
 */
function mail_text(type, klageid) {
 day = new Date();
 id = day.getTime();
  
 URL = '../includes/mail_text.php?type='+type+'&id='+klageid; 
/*mail_text.php?type='+type;*/
 eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=520,height=500,left = 500,top = 200');"); 
}

/*******************************
 * Lager en gerenell popup
 *******************************
 */
function quiz_popup(page){
  day = new Date();
  id = day.getTime();
  URL = page;
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=520,height=500,left = 500,top = 200');"); 
}
/**
 * Brukes til å skrive ut annonser
 * @author Ola Juliussen
 * @version 1.00 18.05.2006
 */
function adprint(adText)
{
  document.write(adText);
}
