/** 
* Toggle edit mode
**/
function editmode() {
	var href = window.location.href;
	if (href.indexOf("p_edit=true") != -1) {
		window.location.href = href.replace("true","false");
	} else if (href.indexOf("p_edit=false") != -1) {
		window.location.href = href.replace("false","true");
	} else if (href.indexOf("?") != -1) {
		window.location.href = href + "&p_edit=true";
	} else {
		window.location.href = href + "?p_edit=true";
	}
}

function show_form(obj){
  if (obj.selectedIndex != "0"){
    window.open(obj.value);
  }
}

/**
* Workaround to be able to open office documents in a new window.
**/
function show_form2(obj){
  if (obj.selectedIndex != "0"){
    window.open('/ikbViewer/page/gard/doc?p_url='+obj.value);
  }
}


function show_page(obj){
  if (obj.selectedIndex != "0"){
    window.location.href = obj.value;
  }
}

function show_product(obj){
  
  if (obj.selectedIndex != "0"){
    if (obj.value.charAt(0)>0){
      call_ikb_homeplace(obj.value,'TITLE_REDIRECT','10','2','7641','17567','0','');
    }else{
      window.open(obj.value);
    }
  }
}

function language_claims(obj){
   if (obj != '0'){
   window.location = '/ikbViewer/page/covering-risks/small-craft/claims?p_lang=' + obj;
  }
}

  function language_application(obj){
   window.location = '/ikbViewer/page/covering-risks/small-craft/form?p_lang=' + obj;
  }



var xcord = 900;
var ycord = 430;

/* Used to position mouse over on list of correspondents map */
function setDiv(id) {
  if (jQuery('#europe').css('display') != 'block' && jQuery('#africa').css('display') != 'block' && jQuery('#northamerica').css('display') != 'block' && jQuery('#southamerica').css('display') != 'block' && jQuery('#oceania').css('display') != 'block' && jQuery('#asia').css('display') != 'block' ) {
    jQuery(id).css({'top' : ycord, 'left' : xcord});
    jQuery(id).show();
  }
}

jQuery('#corr_map').mousemove(function(e) {
  xcord = e.pageX - 30;
  ycord = e.pageY - 30;
});

