﻿var isV5 = false;
var isIE = false;
var navmenuout = true
var navmenutimeoutID = 1
var mouseout_menuarticle = true
var menutimeoutID = 1
var pollanswer = false

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_showHideLayers() {
if(parseInt(navigator.appVersion) == 5){
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  if(document.getElementById){
   for (i=0; i<(args.length-2); i+=3){
   obj=document.getElementById(args[i]);v=args[i+2];
v=(v=='show')?'visible':(v='hide')?'hidden':v;
   if(obj)obj.style.visibility=v;
   }
  }
  else{
  for (i=0; i<(args.length-2); i+=3) if ((obj=findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
 }
 }
else{
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("##")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0C
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0C
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//script for new menu
function navmenu_over() {
navmenuout = false ;
clearTimeout(navmenutimeoutID);
}

function navmenu_out() {
navmenuout = true ;
navmenutimeoutID = setTimeout("autohide_menu()","10");
}

function autohide_menu() {
if (navmenuout == true) {
  MM_showHideLayers('submain','','hide');MM_swapImage('Image2','','images/share/main_butt_03.gif',1);
  MM_showHideLayers('foreword','','hide');MM_swapImage('Image2','','images/share/main_butt_03.gif','Image7','','images/share/main_butt_layer_01.gif',1);
  MM_showHideLayers('ourc','','hide');MM_swapImage('Image2','','images/share/main_butt_03.gif','Image8','','images/share/main_butt_layer_02.gif',1);
  MM_showHideLayers('ouro','','hide');MM_swapImage('Image2','','images/share/main_butt_03.gif','Image9','','images/share/main_butt_layer_03.gif',1);
  MM_showHideLayers('targets','','hide');MM_swapImage('Image2','','images/share/main_butt_03.gif','Image10','','images/share/main_butt_layer_04.gif',1);
  MM_swapImage('Image1','','images/share/main_butt_02.gif',1);
  MM_swapImage('Image2','','images/share/main_butt_03.gif',1);
  MM_swapImage('Image3','','images/share/main_butt_04.gif',1);
  MM_swapImage('Image4','','images/share/main_butt_05.gif',1);
  MM_swapImage('Image5','','images/share/main_butt_06.gif',1);
  MM_swapImage('Image6','','images/share/main_butt_07.gif',1);
  MM_swapImage('Image11','','images/share/main_butt_08.gif',1);
  MM_swapImage('Image12','','images/share/main_butt_09.gif',1);
}
}

function hideother(layername) {
if (layername != 'image1'){
MM_swapImage('Image1','','images/share/main_butt_02.gif','Image2','','images/share/main_butt_03.gif',1);MM_showHideLayers('submain','','hide','foreword','','hide','ourc','','hide','ouro','','hide','targets','','hide');
}
if (layername != 'image3'){
MM_swapImage('Image3','','images/share/main_butt_04.gif','Image2','','images/share/main_butt_03.gif',1);MM_showHideLayers('submain','','hide','foreword','','hide','ourc','','hide','ouro','','hide','targets','','hide');
}
if (layername != 'image4'){
MM_swapImage('Image4','','images/share/main_butt_05.gif','Image2','','images/share/main_butt_03.gif',1);MM_showHideLayers('submain','','hide','foreword','','hide','ourc','','hide','ouro','','hide','targets','','hide');
}
if (layername != 'image5'){
MM_swapImage('Image5','','images/share/main_butt_06.gif','Image2','','images/share/main_butt_03.gif',1);MM_showHideLayers('submain','','hide','foreword','','hide','ourc','','hide','ouro','','hide','targets','','hide');
}
if (layername != 'image6'){
MM_swapImage('Image6','','images/share/main_butt_07.gif','Image2','','images/share/main_butt_03.gif',1);MM_showHideLayers('submain','','hide','foreword','','hide','ourc','','hide','ouro','','hide','targets','','hide');
}
}

function menu_over() {
mouseout_menuarticle = false ;
clearTimeout(menutimeoutID);
}

function swapimg(page, imgid, imgpath) {
	// if this is page x then img x.src change to imgpath
	if (top.location.href.search(page)!=-1) document.getElementById(imgid).src = imgpath;
}

function makevisible(page, divid) {
	// if this is page x then make div x visible
	if (top.location.href.search(page)!=-1) document.getElementById(divid).style.visibility = "visible";
}

function highlightmenu() {
	// for main menu
	swapimg("home.htm", "imghome", imgpath + "home_bn2.gif");
	swapimg("highlight.htm", "imgnew", imgpath + "new_bn2.gif");
	//swapimg("event.htm", "imgnew", imgpath + "new_bn2.gif");
	swapimg("press.htm", "imgnew", imgpath + "new_bn2.gif");
	swapimg("w_solicitor.htm", "imgoff", imgpath + "off_bn2.gif");
	swapimg("appointment.htm", "imgoff", imgpath + "off_bn2.gif");
	swapimg("faq.htm", "imgoff", imgpath + "off_bn2.gif");
	swapimg("stat.htm", "imgstat", imgpath + "stat_bn2.gif");
	swapimg("pub.htm", "imgpub", imgpath + "pub_bn2.gif");
	swapimg("link.htm", "imglink", imgpath + "link_bn2.gif");
	swapimg("contact.htm", "imgcontact", imgpath + "contactus_bn2.gif"); //added  12 Aug 2009
	swapimg("aboutus.htm", "imgaboutus", imgpath + "aboutus_bn2.gif"); //added  24 Aug 2009
	swapimg("chart.htm", "imgaboutus", imgpath + "aboutus_bn2.gif");
	swapimg("event.htm", "imgaboutus", imgpath + "aboutus_bn2.gif");
	swapimg("opening.htm", "imgaboutus", imgpath + "aboutus_bn2.gif");
	
	// for sub menu - mouse over
	swapimg("highlight.htm", "imghighlight", imgpath + "highlight_b2.gif");
	//swapimg("event.htm", "imgevent", imgpath + "event_b2.gif");
	swapimg("press.htm", "imgpress", imgpath + "press_b2.gif");
	swapimg("w_solicitor.htm", "imgw_solicitor", imgpath + "w_solicitor_b2.gif");
	swapimg("appointment.htm", "imgappointment", imgpath + "appointment_b2.gif");
	swapimg("faq.htm", "imgfaq", imgpath + "faq_b2.gif");
	//swapimg("contact.htm", "imgw_contus", imgpath + "contactus_bn2.gif"); //added  12 Aug 2009
	swapimg("chart.htm", "imgchart", imgpath + "chart_bn2.gif"); //added  24 Aug 2009
	swapimg("event.htm", "imgevent", imgpath + "event_b2.gif");
	swapimg("opening.htm", "imgopening", imgpath + "opening_bn2.gif"); //added  24 Aug 2009
	 

	// for sub menu - Make the sub menu visible 
	makevisible("highlight.htm", "submain");
	//makevisible("event.htm", "submain");
	makevisible("press.htm", "submain");
	makevisible("w_solicitor.htm", "ourc");
	makevisible("appointment.htm", "ourc");
	makevisible("faq.htm", "ourc");
	//makevisible("home.htm", "div5day");
	//makevisible("link.htm", "ctus"); 
	//makevisible("contact.htm", "ctus"); //added  12 Aug 2009
	//makevisible("aboutus.htm", "aboutus");
	makevisible("chart.htm", "aboutus"); //added  24 Aug 2009
	makevisible("event.htm", "aboutus");
	makevisible("opening.htm", "aboutus"); //added  24 Aug 2009
	//
}
