/* Change css according to screen resolution */

function Change_Css(){

var resWidth = window.screen.width; 
if(resWidth > 800) { 
document.write("<link media='screen' href='/system/css/style.css' type='text/css' rel='stylesheet'>"); 
} 
else if(resWidth <= 800) { 
document.write("<link media='screen' href='/system/css/style_small.css' type='text/css' rel='stylesheet'>"); 
} 

}

/* Change css according to screen resolution END */

/* Change top image according to screen resolution */

function Change_TopImage(){

var resWidth = window.screen.width; 
	var img_top;
	if(resWidth > 800) { 
	img_top = "<img name='top' id='logo' border='0' src='/system/images/top_image.gif'>"; 
	} 
	else if(resWidth <= 800) { 
	img_top = "<img name='top' id='logo' border='0' src='/system/images/top_image_small.gif'>"; 
	} 
	document.write(img_top); 
}

/* Change top image according to screen resolution END */

/* Print DIV */

function printMe(divId) {
   w=window.open('','newwin')
   w.document.write('<body onLoad="window.print()">'+document.getElementById(divId).innerHTML+'</body>')
   w.document.close()
}

/* Print DIV end */

/* Add Print button if Script enabled */

function Add_Print(){

document.write("<a title=\"Print this page\" class=\"header\" href=\"#\" onClick=\"return printMe(\'div1\')\"><font size=\"2\" face=\"Arial\" color=\"#FFFFFF\">Print this page</font></a>");
}

/* Add Print button if Script enabled END */

/* Update menu highlight */

var selected_menu = "home";
var menuon = "#000080";
var menuoff = "#58A4D8";

this.ua = navigator.userAgent.toLowerCase(); 
this.major = parseInt(navigator.appVersion); 
this.minor = parseFloat(navigator.appVersion); 

// MSIE 
this.ie = this.ua.indexOf('msie') != -1; 
if (this.ie) { 
this.ie3 = this.major < 4; 
this.ie4 = (this.major == 4 && this.ua.indexOf('msie 5') == -1 && this.ua.indexOf('msie 6') == -1); 
this.ie4up = this.major >= 4; 
this.ie5 = (this.major == 4 && this.ua.indexOf('msie 5.0') != -1); 
this.ie5up = !this.ie3 && !this.ie4; 
this.ie6 = (this.major == 4 && this.ua.indexOf('msie 6.0') != -1); 
this.ie6up = (!this.ie3 && !this.ie4 && !this.ie5 && this.ua.indexOf("msie 5.5") == -1); 

} 

function Change_Menu(obj){ 


var src_string;

src_string = document.frames['contents'].location.href;

document.getElementById(selected_menu).style.background=menuoff;

  switch (true)
  {
    case (src_string.indexOf("profile") > 0) :
      document.getElementById("profile").style.background=menuon;      
      selected_menu = "profile";
      break;
    case (src_string.indexOf("notes") > 0) :
      document.getElementById("notes").style.background=menuon;
      selected_menu = "notes";
      break;
    case (src_string.indexOf("directors") > 0) :
      document.getElementById("directors").style.background=menuon;
      selected_menu = "directors";      
      break;
    case (src_string.indexOf("actuaries") > 0) :
      document.getElementById("actuaries").style.background=menuon;
      selected_menu = "actuaries";  
    break;
    case (src_string.indexOf("info") > 0) :
      document.getElementById("info").style.background=menuon;
      selected_menu = "info";  
    break;
    case (src_string.indexOf("latest") > 0) :
      document.getElementById("latest").style.background=menuon;
      selected_menu = "latest";  
    break;
    case (src_string.indexOf("update") > 0) :
      document.getElementById("update").style.background=menuon;
      selected_menu = "update";  
    break;
    case (src_string.indexOf("forms") > 0) :
      document.getElementById("forms").style.background=menuon;
      selected_menu = "forms";  
    break;
    case (src_string.indexOf("guide") > 0) :
      document.getElementById("guide").style.background=menuon;
      selected_menu = "guide";  
    break;
    case (src_string.indexOf("press") > 0) :
      document.getElementById("press").style.background=menuon;
      selected_menu = "press";  
    break;
    case (src_string.indexOf("links") > 0) :
      document.getElementById("links").style.background=menuon;
      selected_menu = "links";  
    break;
    case (src_string.indexOf("conditions") > 0) :
      document.getElementById("conditions").style.background=menuon;
      selected_menu = "conditions";  
    break;
    case (src_string.indexOf("contact") > 0) :
      document.getElementById("contact").style.background=menuon;
      selected_menu = "contact";  
    break;
    case (src_string.indexOf("terms") > 0) :
      document.getElementById("terms").style.background=menuon;
      selected_menu = "terms";  
    break;
    default :
      document.getElementById("home").style.background=menuon;
      selected_menu = "home";
  }

src_string = " ";

resizeMe(obj);
parent.location.hash='top';
}

function Menu_Over(row){

	if (row == selected_menu){

	document.getElementById(row).style.background=menuoff;
	Add_Hand(row);
	}
	else{
	document.getElementById(row).style.background=menuon;
	Add_Hand(row);
	}
}

function Menu_Out(row){

	if (row == selected_menu){

	document.getElementById(row).style.background=menuon;
	Add_Hand(row);
	}
	else{
	document.getElementById(row).style.background=menuoff;
	Add_Hand(row);
	}
}

function Add_Hand(row){

	if (this.ie5up){
	
	document.getElementById(row).style.cursor="hand";

	}else{
	}
}


/* Update menu highlight END */

/* Resize iframe */

function resizeMe(obj){
docHeight = contents.document.body.scrollHeight;
obj.style.height = docHeight + 10 + 'px';
obj.style.scrolling = 'no';
}

/* Resize iframe END */

/* Print IFRAME */


  function PrintThisPage() 
  { 
           
         if (this.ie)
         {            

           document.contents.focus(); 
           document.contents.print(); 
                   
         }
         else 
         {  

           window.frames['contents'].focus(); 
           window.frames['contents'].print(); 
         } 

         
  }
/* Print IFRAME end */

/* Disable Submit button */

function skip () { this.blur(); }
function disableTextField (field) {
  if (document.all || document.getElementById) 
    field.disabled = true;
  else {
    field.oldOnFocus = field.onfocus;
    field.onfocus = skip;
  }
}
function enableTextField (field) {
  if (document.all || document.getElementById)
    field.disabled = false;
  else {
    field.onfocus = field.oldOnFocus;
  }
}

/* Disable Submit button end */

