﻿// JScript File

function clickButton(buttonid)
{ 
    buttonid = "Registration1_"+buttonid;
	var bt = document.getElementById(buttonid); 
	if (bt)
	{ 
		if(navigator.appName.indexOf("Netscape")>(-1))
		{ 
			bt.click(); 
			return false; 
		}
		if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1))
		{
		    bt.click(); 
			return false; 
		} 
	}
} 

/**** calendar function start ****/

function opencalendar(textname)
{
    var  width = 220;
    var height = 200;
    var    top = 120;
    var   left = 105;
    var  props = "toolbars=no,status=no,resizable=no,scrollbars=no,width=" + 
    width + ",height=" + height + ",left=" + left + ",top=" + top;
    window.open("http://ebly.fr/academie/admin/admincalendar.aspx?txtName="+textname, "myWin", props);
    return false;
}

/**** calendar function end ****/



/**** Comments Section *****/
function WriteComment(pnlvisible,pnlblock)
{
    document.getElementById(pnlvisible).style.display = "";
    document.getElementById(pnlblock).style.display = "none";
    document.getElementById('videoHid').value = '2'
document.getElementById('CommentsCtrl1_lblError').innerHTML = '';
}
function chkPanels()
{
    document.getElementById('CommentsCtrl1_PnlwriteComments').style.display = "none";
    if(document.getElementById('videoHid').value == '1')
    {
        document.getElementById('CommentsCtrl1_PnlviewComments').style.display = "";
        document.getElementById('CommentsCtrl1_PnlwriteComments').style.display = "none";
    }
    if(document.getElementById('videoHid').value == '2')
    {
        document.getElementById('CommentsCtrl1_PnlwriteComments').style.display = "";
        document.getElementById('CommentsCtrl1_PnlviewComments').style.display = "none";
    }
}
/**** end Comments Section *****/

/********* lesvideos panel functions start ************/

function showpanel(menuid,panelno)
{
    
    
    if(panelno ==1)
    {
      obj = document.getElementById('LesVideosMenu1_imgMenu1');
      obj.src = 'images/lvideos_lnk'+panelno+'_selected.gif';
      obj.setAttribute("onmouseover","");
      obj.setAttribute("onmouseout","");
      
      obj = document.getElementById('LesVideosMenu1_imgMenu2');
      obj.src = 'images/lvideos_lnk2.gif';
      /*obj.setAttribute("onmouseover","this.src='images/lvideos_lnk2_over.gif'");
      obj.setAttribute("onmouseout","this.src='images/lvideos_lnk2.gif'");*/
      
      obj = document.getElementById('LesVideosMenu1_imgMenu3');
      obj.src = 'images/lvideos_lnk3.gif';
      /*obj.setAttribute("onmouseover","this.src='images/lvideos_lnk3_over.gif'");
      obj.setAttribute("onmouseout","this.src='images/lvideos_lnk3.gif'");*/
      
      obj = document.getElementById('LesVideosMenu1_imgMenu4');
      obj.src = 'images/lvideos_lnk4.gif';
      /*obj.setAttribute("onmouseover","this.src='images/lvideos_lnk4_over.gif'");
      obj.setAttribute("onmouseout","this.src='images/lvideos_lnk4.gif'");*/
      
      document.getElementById('pnlRecipe').style.display = "";
      document.getElementById('pnlComments').style.display = "none";
      document.getElementById('CommentsCtrl1_PnlviewComments').style.display = "none";
      document.getElementById('CommentsCtrl1_PnlwriteComments').style.display = "none";
      document.getElementById('pnlCommentSendFriend').style.display = "none";
      document.getElementById('pnlBlog').style.display = "none";
    }
    if(panelno ==2)
    {
    obj = document.getElementById('LesVideosMenu1_imgMenu1');
      obj.src = 'images/lvideos_lnk1.gif';
      /*obj.setAttribute("onmouseover","this.src='images/lvideos_lnk1_over.gif'");
      obj.setAttribute("onmouseout","this.src='images/lvideos_lnk1.gif'");*/
    obj=null;
    
      obj = document.getElementById('LesVideosMenu1_imgMenu2');
      obj.src = 'images/lvideos_lnk'+panelno+'_selected.gif';
    obj.setAttribute("onmouseover","");
    obj.setAttribute("onmouseout","");
    obj=null;
      
      obj = document.getElementById('LesVideosMenu1_imgMenu3');
      obj.src = 'images/lvideos_lnk3.gif';
      /*obj.setAttribute("onmouseover","this.src='images/lvideos_lnk3_over.gif'");
      obj.setAttribute("onmouseout","this.src='images/lvideos_lnk3.gif'");*/
    obj=null;
      
      obj = document.getElementById('LesVideosMenu1_imgMenu4');
      obj.src = 'images/lvideos_lnk4.gif';
      /*obj.setAttribute("onmouseover","this.src='images/lvideos_lnk4_over.gif'");
      obj.setAttribute("onmouseout","this.src='images/lvideos_lnk4.gif'");*/
    obj=null;
      
      document.getElementById('pnlRecipe').style.display = "none";
      document.getElementById('pnlComments').style.display = "";
      document.getElementById('CommentsCtrl1_PnlviewComments').style.display = "";
      document.getElementById('CommentsCtrl1_PnlwriteComments').style.display = "none";
      document.getElementById('pnlCommentSendFriend').style.display = "none";
      document.getElementById('pnlBlog').style.display = "none";
    }
    if(panelno ==3)
    {
    obj = document.getElementById('LesVideosMenu1_imgMenu1');
      obj.src = 'images/lvideos_lnk1.gif';
      /*obj.setAttribute("onmouseover","this.src='images/lvideos_lnk1_over.gif'");
      obj.setAttribute("onmouseout","this.src='images/lvideos_lnk1.gif'");*/
    obj=null;
    
      obj = document.getElementById('LesVideosMenu1_imgMenu2');
      obj.src = 'images/lvideos_lnk2.gif';
      /*obj.setAttribute("onmouseover","this.src='images/lvideos_lnk2_over.gif'");
      obj.setAttribute("onmouseout","this.src='images/lvideos_lnk2.gif'");*/
    obj=null;
      
      obj = document.getElementById('LesVideosMenu1_imgMenu3');
      obj.src = 'images/lvideos_lnk'+panelno+'_selected.gif';
    obj.setAttribute("onmouseover","");
    obj.setAttribute("onmouseout","");
    obj=null;
      
      obj = document.getElementById('LesVideosMenu1_imgMenu4');
      obj.src = 'images/lvideos_lnk4.gif';
      /*obj.setAttribute("onmouseover","this.src='images/lvideos_lnk4_over.gif'");
      obj.setAttribute("onmouseout","this.src='images/lvideos_lnk4.gif'");*/
    obj=null;
      
      document.getElementById('pnlRecipe').style.display = "none";
      document.getElementById('pnlComments').style.display = "none";
      document.getElementById('CommentsCtrl1_PnlviewComments').style.display = "none";
      document.getElementById('CommentsCtrl1_PnlwriteComments').style.display = "none";
      document.getElementById('pnlCommentSendFriend').style.display = "";
      document.getElementById('pnlBlog').style.display = "none";
document.getElementById('CommentsFriendCtrl1_lblError').innerHTML = '';
    }
    if(panelno ==4)
    {
    obj = document.getElementById('LesVideosMenu1_imgMenu1');
      obj.src = 'images/lvideos_lnk1.gif';
      /*obj.setAttribute("onmouseover","this.src='images/lvideos_lnk1_over.gif'");
      obj.setAttribute("onmouseout","this.src='images/lvideos_lnk1.gif'");*/
    obj=null;
    
      obj = document.getElementById('LesVideosMenu1_imgMenu2');
      obj.src = 'images/lvideos_lnk2.gif';
      /*obj.setAttribute("onmouseover","this.src='images/lvideos_lnk2_over.gif'");
      obj.setAttribute("onmouseout","this.src='images/lvideos_lnk2.gif'");*/
    obj=null;
      
      obj = document.getElementById('LesVideosMenu1_imgMenu3');
      obj.src = 'images/lvideos_lnk3.gif';
      /*obj.setAttribute("onmouseover","this.src='images/lvideos_lnk3_over.gif'");
      obj.setAttribute("onmouseout","this.src='images/lvideos_lnk3.gif'");*/
    obj=null;
      
      obj = document.getElementById('LesVideosMenu1_imgMenu4');
      obj.src = 'images/lvideos_lnk'+panelno+'_selected.gif';
    obj.setAttribute("onmouseover","");
    obj.setAttribute("onmouseout","");
    obj=null;
      
      document.getElementById('pnlRecipe').style.display = "none";
      document.getElementById('pnlComments').style.display = "none";
      document.getElementById('CommentsCtrl1_PnlviewComments').style.display = "none";
      document.getElementById('CommentsCtrl1_PnlwriteComments').style.display = "none";
      document.getElementById('pnlCommentSendFriend').style.display = "none";
      document.getElementById('pnlBlog').style.display = "";
    }
}

function CommentClear(obj,txtname)
{
    if(document.getElementById(obj).value == 'Votre nom')
    {
        document.getElementById(obj).value = '';
    }
    if(document.getElementById(obj).value == 'Votre texte')
    {
        document.getElementById(obj).value = '';
    }
    if(txtname == 'name')
     {document.getElementById(obj).className ='commentsNameOnfocusTxt';}
     else{document.getElementById(obj).className ='CommentsTxtOnFocusMulti';}
}

function AddTxt(obj,txtPage)
{
    if(document.getElementById(obj).value == '')
    {
         if(txtPage == 'name')
         {document.getElementById(obj).value = 'Votre nom';
         document.getElementById(obj).className ='commentsNameTxt';}
         else {document.getElementById(obj).value = 'Votre texte';
         document.getElementById(obj).className ='CommentsTxtMulti';}
    }
}


/********* lesvideos panel functions end ************/