// START Legal Lightbox Config
$(document).ready(function () {
    $(".lightbox").colorbox({
        open: false, initialWidth: '50px', initialHeight: '50px', opacity: 0.5, overlayClose: true
    });
	
	/*$.colorbox({onOpen:function(){alert("testing2.");
	if ($("div.cos-video").length > 0){
	$("div.cos-video").hide();
	}
	}});
	*/
	
	/*for player on tele section
	  $(".lightbox").colorbox({onClosed:function(){
	  alert('testing1.');
	                if ($("div.cos-video").length > 0){
                    $("div.cos-video").show();}
            }}); 
            $(".lightbox").colorbox({onOpen:function(){
			alert("testing2.");
			      if ($("div.cos-video").length > 0){
                    $("div.cos-video").pause();
                    $("div.cos-video").hide();
					}
            }}); */
			/*END for player on tele section*/
});
// END Legal Lightbox Config

function ch_image(o_obj, s_img){
	if ($(o_obj).hasClass('bj') == false) {
$(document).ready(function(){

		o_obj.src = s_img;
});

	}
}

// JavaScript Document
//to handle the highlight of the menu and footer menu


function getlanguage(url)
{
	var value="en";
	newPathname = url;
//	for ( i = 0; i<= pathArray.length; i++ ) {
//		newPathname += "/";
//		newPathname += pathArray[i];
//		}
   
	var index=   newPathname.indexOf("/fr/");

if (index>-1)
{
	 value="fr";
	}

return value;	
	}
	$(document).ready(function(){

var URL = window.location.pathname;
var PageName = URL.substring(URL.lastIndexOf('/') + 1);
var lang =getlanguage(URL);
     
if ((PageName=="MillerIndex.aspx")&&(lang=="en"))
{
   var image=document.getElementById("Home");
   image.src='/~/media/Miller Chill/images/menu/home_o.jpg';
   $('#Home').addClass('bj');
}
else
{
	if(PageName=="MillerIndex.aspx"){
   var image=document.getElementById("Home");
   image.src='/~/media/Miller Chill/images/menu/fr/home_o.jpg';
   $('#Home').addClass('bj');
   }
   
	}

if ((PageName=="about.aspx")&&(lang=="en"))
{
   var image=document.getElementById("About");
   image.src='/~/media/Miller Chill/images/menu/About_o.jpg';
   $('#About').addClass('bj');
}

else
{
	if(PageName=="about.aspx"){
	var image=document.getElementById("About");
   image.src='/~/media/Miller Chill/images/menu/fr/About_o.jpg';
   $('#About').addClass('bj');
   }
   
	}

if ((PageName=="tele.aspx")&&(lang=="en"))
{
   var image=document.getElementById("tele");
   image.src='/~/media/Miller Chill/images/menu/tv_o.jpg';
   $('#tele').addClass('bj');
}else
{ 
   if (PageName=="tele.aspx"){
   var image=document.getElementById("tele");
   image.src='/~/media/Miller Chill/images/menu/fr/tv_o.jpg';
   $('#tele').addClass('bj');
   }
   
   }

if ((PageName=="terms.aspx")&&(lang=="en"))
{
   var image=document.getElementById("term");
   image.src='/~/media/Miller Chill/images/en/term_o.jpg';
   $('#term').addClass('bj');
}
else
{
   if(PageName=="terms.aspx"){	 
   var image=document.getElementById("term");
   image.src='/~/media/Miller Chill/images/fr/term_o.jpg';
   $('#term').addClass('bj');
   }
   
   }

if ((PageName=="policy.aspx")&&(lang=="en"))
{
   var image=document.getElementById("privacy");
   image.src='/~/media/Miller Chill/images/en/privacy_o.jpg';
   $('#privacy').addClass('bj');
}
else
{  
  if(PageName=="policy.aspx"){
   var image=document.getElementById("privacy");
   image.src='/~/media/Miller Chill/images/fr/privacy_o.jpg';
   $('#privacy').addClass('bj');
   }
   
   }

if ((PageName=="ContactUs.aspx")&&(lang=="en"))
{
   var image=document.getElementById("contact");
   image.src='/~/media/Miller Chill/images/en/contact_o.jpg';
   $('#contact').addClass('bj');
}
else
{ 
  if(PageName=="ContactUs.aspx"){
   var image=document.getElementById("contact");
   image.src='/~/media/Miller Chill/images/fr/contact_o.jpg';
   $('#contact').addClass('bj');
   }
   
   }

});



