/* 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 */

/* Add Print button if Script enabled */

function Add_Print(){

document.write("<img src='/system_colin/images/print.gif'>&nbsp;<a href='javascript:PrintThisPage()'>Print this page</a>&nbsp;&nbsp;");

}

/* Add Print button if Script enabled END */

/* Update menu highlight */

var selected_menu = "section1";
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).src='/system/images/' + selected_menu + '.gif';

  switch (true)
  {
    case (src_string.indexOf("meetings") > 0) :
      document.getElementById("section2").src='/system/images/section2_selected.gif';     
      selected_menu = "section2";
      break;
    case (src_string.indexOf("members") > 0) :
      document.getElementById("section3").src='/system/images/section3_selected.gif';
      selected_menu = "section3";
      break;
    case (src_string.indexOf("rideouts") > 0) :
      document.getElementById("section4").src='/system/images/section4_selected.gif';
      selected_menu = "section4";      
      break;   
    case (src_string.indexOf("history") > 0) :
      document.getElementById("section5").src='/system/images/section5_selected.gif';
      selected_menu = "section5";      
      break;   
   case (src_string.indexOf("dos") > 0) :
      document.getElementById("section6").src='/system/images/section6_selected.gif';
      selected_menu = "section6";      
      break;
   case (src_string.indexOf("for_sale") > 0) :
      document.getElementById("section7").src='/system/images/section7_selected.gif';
      selected_menu = "section7";      
      break;
   case (src_string.indexOf("contact") > 0) :
      document.getElementById("section8").src='/system/images/section8_selected.gif';
      selected_menu = "section8";      
      break; 
case (src_string.indexOf("guestbook") > 0) :
      document.getElementById("section9").src='/system/images/section9_selected.gif';
      selected_menu = "section9";      
      break; 
case (src_string.indexOf("links") > 0) :
      document.getElementById("section10").src='/system/images/section10_selected.gif';
      selected_menu = "section10";      
      break; 
   default :
      document.getElementById("section1").src='/system/images/section1_selected.gif';
      selected_menu = "section1";
  }

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 */
