var isNN,isIE;
if (parseInt(navigator.appVersion.charAt(0))>=4){
	//alert(navigator.appName);
	isNN=(navigator.appName=="Netscape")?1:0;
	isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
}

if (isIE){
	//document.write('<style type="text/css"> .menu a {width:100%;} </style>');
}

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];}
}

//validate prepaid cards
function ValidatePrepaidCards(SN, PIN){
	if (Trim(document.getElementById(SN).value)=="" || Trim(document.getElementById(PIN).value)=="")
	 {
		 alert("Please enter the Serial Number and the Pin Code");
		 return false;
	}
	else
	{
	   return true;
	}
	

}

//validate login
function CheckLogin(username, password){
	if (Trim(document.getElementById(username).value)=="" || Trim(document.getElementById(password).value)=="")
	 {
		 alert("Please enter your User Name and your Password");
		 return false;
	}
	else
	{
	   return true;
	}
	//alert("LBC Group members area is currently undergoing maintenance, sorry for the inconvenience.\nPlease come back soon") 
	//return false;

}

function ValidateSearchWebtv(){
	if (document.getElementById("WebTV_txtkeyword").value=="")
	//|| (document.getElementById("WebTVControl_txtFromDate").value=="") || (document.getElementById("WebTVControl_txtToDate").value=="") || (Trim(document.getElementById("WebTVControl_txtkeyword").value)=="") 
	 {
		 alert("The following fields are required:\n - Keyword");
		 return false;
	}
	else
	{
	   return true;
	}
}
function ValidateSearchWebtvJump(){
	if (document.getElementById("JumpWebTV1_txtkeyword").value=="" || document.getElementById("JumpWebTV1_txtkeyword").value=="Keyword")
	//|| (document.getElementById("WebTVControl_txtFromDate").value=="") || (document.getElementById("WebTVControl_txtToDate").value=="") || (Trim(document.getElementById("WebTVControl_txtkeyword").value)=="") 
	 {
		 alert("Keyword is required\n");
		 return false;
	}
	else
	{
	   return true;
	}
}
function ValidateSearchNews(){
	if (document.getElementById("WebTV_lstCategories").selectedIndex==0)
	//|| (document.getElementById("WebTVControl_txtFromDate").value=="") || (document.getElementById("WebTVControl_txtToDate").value=="") || (Trim(document.getElementById("WebTVControl_txtkeyword").value)=="") 
	 {
		 alert("The following fields are required:\n - Category");
		 return false;
	}
	else
	{
	   return true;
	}
}
function ValidateSearchProgPage(){

	if (Trim(document.getElementById("txtkeyword").value)==""){
		alert("The following fields are required:\n - Keyword");
		return false;
	}
	else{
		if(Trim(document.getElementById("txtkeyword").value).length<3){
			alert("Keyword must be at least 3 characters");
			return false;
		}
		else{
			return true;
		}
	}
	
}
function ValidateSearchWebtvPage(){
	if (Trim(document.getElementById("txtkeyword").value)=="")
	//|| (document.getElementById("txtFromDate").value=="") || (document.getElementById("txtToDate").value=="")|| (Trim(document.getElementById("txtkeyword").value)=="") 
	 {
		 alert("The following fields are required:\n - Keyword\n ");
		 return false;
	}
	else
	{
	   return true;
	}
}

//validate Advertise
function ValidateAdvertise()
  {
	 
   var msg;
   var msg2;
   msg=""
    msg2="";
	
  
    if (document.Form1.txtFName.value=="")
		msg +="- First Name is required\n" 
	if (document.Form1.txtLName.value=="")
		msg +="- Last Name is required\n" 
	if (document.Form1.txtCompany.value=="")
		msg +="- Company is required\n" 
	if (document.Form1.txtPosition.value=="")
		msg +="- Position is required\n" 
	if (document.Form1.txtEmail.value=="")
		msg +="- Email is required\n"
	else{ 
	     var strvalmail=IsValidEmail(document.Form1.txtEmail);
		 if (strvalmail.length>0)
	     msg2=strvalmail
	}
	if (document.Form1.txtPhone.value=="")
		msg +="- Phone is required\n"
	if (document.Form1.txtFax.value=="")
		msg +="- Fax is required\n"
	if (document.Form1.txtAddress.value=="")
		msg +="- Address is required\n"
	
	if (document.Form1.txtComments.value=="")
		msg +="- Comments/Inquiry \n" 
    
	if (msg!="")
	{
	   msg="Please check the following and submit again:\n" + msg +msg2
		alert(msg);
		return false;
	}
	else{
	   if (msg2==""){
	   return true;
	   }else{
	    alert(msg2);
		return false;}
		}
	}


//validate Contact Us Form
function ValidateForm()
  {
	 
   var msg;
   var msg2;
   msg=""
    msg2="";
    if (document.Form1.txtFirstName.value=="")
		msg +="- First Name is required\n" 
	if (document.Form1.txtLastName.value=="")
		msg +="- Last Name is required\n" 
	if (document.Form1.txtEmail.value=="")
		msg +="- Email is required\n"
	else{ 
	     var strvalmail=IsValidEmail(document.Form1.txtEmail);
		 if (strvalmail.length>0)
	     msg2=strvalmail
	}
	if (document.Form1.txtMessage.value=="")
		msg +="- Message\n" 
    
	if (msg!="")
	{
	   msg="Please check the following and submit again:\n" + msg +msg2
		alert(msg);
		return false;
	}
	else{
	   if (msg2==""){
	   return true;
	   }else{
	    alert(msg2);
		return false;}
		}
	}
//validate Email
function IsValidEmail(txt){
    var stremail="";
	if(txt.value !=""){ 
		var goodEmail = txt.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
		if (goodEmail){
		    return true;
		} else {
			stremail="- The Email address is not valid\n";
			return stremail;
		}
	}
}
//validate registration
function ValidateRegister()
{
	var msg="";
	var msg1="";
	if (Trim(document.Form1.txtUserName.value)=="")
		msg+="- User Name\n"
	if (Trim(document.Form1.txtPassword.value)=="")
		msg+="- Password\n"
	if (Trim(document.Form1.txtConfirm.value)=="")
		msg+="- Confirm Password\n"	
	if (Trim(document.Form1.txtPassword.value)!=Trim(document.Form1.txtConfirm.value))
	    msg1+="- New password and its confirmation do not match.\n"	
	if (Trim(document.Form1.txtFName.value)=="")
		msg+="- First Name\n"
	if (Trim(document.Form1.txtLName.value)=="")
		msg+="- Last Name\n"
		if (Trim(document.Form1.txtNickName.value)=="")
		msg+="- Nick Name\n"
	if (CheckGender()==false)
		msg+="- Gender\n"
	if (document.Form1.lstAge.selectedIndex==0)
		msg+="- Age Group\n"
	if (document.Form1.lstCountry.selectedIndex==0)
	   msg+="- Country\n"
	if (document.Form1.lstNationality.selectedIndex==0)
	   msg+="- Nationality\n"
	if (Trim(document.Form1.txtEmail.value)==""){
		msg+="- Email\n"
		}
    else{
		var strvalmail=IsValidEmail(document.Form1.txtEmail);
	    if (strvalmail.length>0)
	     msg1+=strvalmail
	    } 
	if (Trim(document.Form1.txtConfirmEmail.value)=="")
		msg+="- Confirm Email\n"
	if (Trim(document.Form1.txtEmail.value)!=Trim(document.Form1.txtConfirmEmail.value))
	    msg1="Email and its confirmation do not match.\n"	
	    	
	if (msg==""){
		if (msg1=="")
		   return true
        else
		{
			alert(msg1);
			return false;}
	}
	else{  
	   alert("The following fields are required,\n please be sure to fill them and try again:\n\n" + msg )
		return false;
		}
}
function ValidateEdit()
{
	var msg="";
	var msg1="";
	if (Trim(document.Form1.txtUserName.value)=="")
		msg+="- User Name\n"
	if (Trim(document.Form1.txtFName.value)=="")
		msg+="- First Name\n"
	if (Trim(document.Form1.txtLName.value)=="")
		msg+="- Last Name\n"
		if (Trim(document.Form1.txtNickName.value)=="")
		msg+="- Nick Name\n"
	if (CheckGender()==false)
		msg+="- Gender\n"
	if (document.Form1.lstAge.selectedIndex==0)
		msg+="- Age Group\n"
	if (document.Form1.lstCountry.selectedIndex==0)
	   msg+="- Country\n"
	if (document.Form1.lstNationality.selectedIndex==0)
	   msg+="- Nationality\n"
	if (Trim(document.Form1.txtEmail.value)==""){
		msg+="- Email\n"
		}
    else{
		var strvalmail=IsValidEmail(document.Form1.txtEmail);
	    if (strvalmail.length>0)
	     msg1+=strvalmail
	    } 
  	
	if (msg==""){
		if (msg1=="")
		   return true
        else
		{
			alert(msg1);
			return false;}
	}
	else{  
	   alert("The following fields are required,\n please be sure to fill them and try again:\n\n" + msg )
		return false;
		}
}

//validate Careers
function ValidateCareersForm()
{
	var msg="";
	var msg1="";
	if (Trim(document.Form1.txtFName.value)=="")
		msg+="- First Name\n"
	if (Trim(document.Form1.txtLName.value)=="")
		msg+="- Last Name\n"
	if (CheckGender()==false)
		msg+="- Gender\n"
	if (CheckRadioButton(document.Form1.rdMaritalStatus)==false)
		msg+="- Marital Status\n"
	if (document.Form1.lstYearOfBirth.selectedIndex==0)
		msg+="- Year Of Birth\n"
	if (Trim(document.Form1.txtEmail.value)==""){
		msg+="- Email\n"
		}
    else{
		var strvalmail=IsValidEmail(document.Form1.txtEmail);
	    if (strvalmail.length>0)
	     msg1+=strvalmail
	    } 
	if (Trim(document.Form1.txtConfirmEmail.value)=="")
		msg+="- Confirm Email\n"
	if (Trim(document.Form1.txtEmail.value)!=Trim(document.Form1.txtConfirmEmail.value))
	    msg1="- Email and its confirmation do not match.\n"
	if (Trim(document.Form1.txtPhone.value)=="")
		msg+="- Phone\n"
	if (document.Form1.lstNationality.selectedIndex==0)
		msg+="- Nationality\n"
	if (Trim(document.Form1.txtPositionRequested.value)=="")
		msg+="- Position Requested\n"
	if (document.Form1.lstAvailableToStart.selectedIndex==0)
	   msg+="- Available To Start\n"
	if (document.Form1.txtCV.value=="")
	   msg+="- Kindly Attach Your CV\n"
		
	    	
	if (msg==""){
		if (msg1=="")
		   return true
        else
		{
			alert(msg1);
			return false;}
	}
	else{  
	   alert("The following fields are required,\n please be sure to fill them and try again:\n\n" + msg )
		return false;
		}
}

//validate gender radiobutton
function CheckGender(){
   var check=false;
   var i=0;
   
   for (i=0;i<document.Form1.rdGender.length;i++){
       if(document.Form1.rdGender[i].checked==true) 
       check=true
   } 
  
   if (check==false)
      return false;
   else
      return true;
}
function CheckRadioButton(rbtnName){
   var check=false;
   var i=0;
   
   for (i=0;i<rbtnName.length;i++){
       if(rbtnName[i].checked==true) 
       check=true
   } 
  
   if (check==false)
      return false;
   else
      return true;
}
//validate ForgotPassword form
function validateforgot()
{
	if (Trim(document.Form1.txtEmail.value)==""){
		alert("Please enter your email");
		return false;
	}
	else{
		var strvalmail=IsValidEmail(document.Form1.txtEmail);
	    if (strvalmail.length>0){
			alert("Please enter a valid email address");
			return false;
	     }
	     else
			return true;
		}
}
//validate Change Pasword
function CheckPassword(){
    if (Trim(document.Form1.txtOldpwd.value)=="" || Trim(document.Form1.txtNewPwd.value)=="" || Trim(document.Form1.txtConfirm.value)=="")
	{
		alert("The following fields are required:\n - Old Password \n - New Password \n - Confirm New Password");
	    return false;
	  }
	else{
		if (document.Form1.txtNewPwd.value!=document.Form1.txtConfirm.value){
			alert("New Password and Confirm New Password do not match");
			return false;
			}
		else{
			return true;
		}
	}
}
//check vote
function Checkvote(btns, ItemsCount, lang)
{
   var i;
   var ItemChecked=false;
   for (i=0; i< ItemsCount;i++){
        if (document.getElementById(btns + "_" + i ).checked==true)
           ItemChecked=true
   }
   
   if (ItemChecked==true){
       return true
   }
   else {
       /* if (lang=="ar"){
        alert("Please select an answer")}
        else{*/
        alert("Please select an answer")
       // }
        return false;}
 }
 function changerecurrent()
 {
 if(document.getElementById("chkRecurrent").checked ==true)
        {
        document.getElementById("LblInfoMessage").innerText = "You will be charged on recurrent basis";
        }
        else
        {
                document.getElementById("LblInfoMessage").innerText = "";

        }
 }
 //subscription selection 
function ChangeSubSelection(Count1,Count2, Index, type1){
		Index=Index+2
		//alert(Count1 + "<<>" + Count2+ "<<>" + Index + "<<>" + type)
		  if(type1=="0")
		   { 
		for (i=2;i<Count1+2;i++){
		//alert(document.getElementById("dgSubscription__ctl" + i + "_rdSubScription"))
		
		
		 	
		       
		  // alert(i)
		   //document.getElementById("dgSubscription0_ctl0" + i + "_rdSubScription0").checked=false; 
		    document.getElementById("dgSubscription0_ctl0" + i + "_rdSubScription").checked=false; 
		    document.getElementById("dgSubscription_ctl0" + i + "_rdSubScription").checked=false;		   
           
           document.getElementById("dgSubscription_ctl0" + Index + "_rdSubScription").checked=true;
         
           
        }
        }else{
        
        for (i=2;i<Count2+2;i++){
		//alert(document.getElementById("dgSubscription__ctl" + i + "_rdSubScription"))
		
	 
		    
		        document.getElementById("dgSubscription0_ctl0" + i + "_rdSubScription").checked=false; 
		        document.getElementById("dgSubscription_ctl0" + i + "_rdSubScription").checked=false;
		   // alert(Index)    
                document.getElementById("dgSubscription0_ctl0" + Index + "_rdSubScription").checked=true;
          
        }
        }
        if (type1=="0")
        {
        document.getElementById("chkRecurrent").checked =true;
        document.getElementById("chkRecurrent").disabled = true;
        document.getElementById("LblInfoMessage").innerText = "You will be charged on recurrent basis";
        
        }
        else
        {
        //document.getElementById("chkRecurrent").checked =false;
        document.getElementById("chkRecurrent").disabled = false;
        if(document.getElementById("chkRecurrent").checked ==true)
        {
        document.getElementById("LblInfoMessage").innerText = "You will be charged on recurrent basis";
        }
        else
        {
                document.getElementById("LblInfoMessage").innerText = "";

        }
        }
}
function OpenTerms(URL){
     OpenWnd('terms.html', '', 688, 610, 'yes');
     
}
function OpenMac(URL){
     OpenWnd('/LBC/snaagent/testmac.aspx', '', 200, 100, 'yes');
     }
function OpenPrivacy(URL){
     OpenWnd('Privacy.html', '', 670, 575, 'no');
}
function OpenWnd(mypage, myname, w, h, scroll)

{
      var winl = (screen.width - w) / 2;
      var wint = (screen.height - h) / 2;
      winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=No'
      win = window.open(mypage, myname, winprops)
      if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

}

function CheckSubSelection(Count){
var radiochecked=false;
Count=Count+2
//alert(Count)
	for (i=2;i<Count;i++){
		//alert(i)
		//alert(document.getElementById("dgSubscription__ctl" + i + "_rdSubScription"))
	   if (document.getElementById("dgSubscription_ctl0" + i + "_rdSubScription").checked==true) {
               radiochecked=true;
              }    
       if (document.getElementById("dgSubscription0_ctl0" + i + "_rdSubScription").checked==true) {
               radiochecked=true;
              }    
      }   
       

    if (radiochecked==false){
    alert("Please choose a plan");
    return false;
    }
    else{
   
		 if (document.getElementById("agree").checked==false){
			alert("Please review and approve the website's terms of use in order to proceed\n");
			return false;
		}
		else{
		return true;
		}
	}
    
      
}
 
//TRIM Functions
function Trim(TRIM_VALUE){
if(TRIM_VALUE.length < 1){
return"";
}
TRIM_VALUE = RTrim(TRIM_VALUE);
TRIM_VALUE = LTrim(TRIM_VALUE);
if(TRIM_VALUE==""){
return "";
}
else{
return TRIM_VALUE;
}
} //End Function

function RTrim(VALUE){
var w_space = String.fromCharCode(32);
var v_length = VALUE.length;
var strTemp = "";
if(v_length < 0){
return"";
}
var iTemp = v_length -1;

while(iTemp > -1){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(0,iTemp +1);
break;
}
iTemp = iTemp-1;

} //End While
return strTemp;

} //End Function

function LTrim(VALUE){
var w_space = String.fromCharCode(32);
if(v_length < 1){
return"";
}
var v_length = VALUE.length;
var strTemp = "";

var iTemp = 0;

while(iTemp < v_length){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(iTemp,v_length);
break;
}
iTemp = iTemp + 1;
} //End While
return strTemp;
} //End Function

/* used to open image in a new window*/
function openIT(u,W,H, sc) {
		var x = (screen.width - W) / 2;
		var y = (screen.height - H) / 2;
		//window.moveBy(left, top);
		window.open(u, '',"width="+W+",height="+H+",scrollbars="+(sc ? "yes" : "no")+", left="+250+",top="+200);
}
function popImage(img, caption)
{
	caption = escape(caption);
	openIT('/LBC/pop_gl.htm?img='+img+"&caption="+caption,550,550);
}

function popVideo(ID,ch)
{
	openIT('/LBC/Templates/GalleryVideo.aspx?ID='+ID+'&ch='+ch,639,395,'yes');
}

function popFeedback(ID,type)
{
	window.open('/LBC/Templates/SendFeedback.aspx?ID='+ID+'&type='+type,'','width=660,height=390');
}


function printArticle() {

            if (window.print) {

                        setTimeout('window.print();',200);

            }

            else if (agt.indexOf("mac") != -1) {

                        alert("Press 'Cmd+p' on your keyboard to print article.");

            }

            else {

                        alert("Press 'Ctrl+p' on your keyboard to print article.")

            }

}

function CheckDateFilter(){
   if (document.Form1.txtFromDate.value==""){
       alert("Please select a date");
       return false;
    }
	else
		return true;

}

function MM_showHideLayers() { //v6.0
  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 SubmitLogin(btn) {
 // process only the Enter key 
 if (event.keyCode == 13) {
  // cancel the default submit 
  event.returnValue=false; 
  event.cancel = true; 
  // submit the form by programmatically clicking the specified button 
  document.getElementById(btn).click();
   } 
  }
  
function ConfirmRedirection(path){
   var confmsg=confirm("You are navigating away from the current video.\n Are you sure you want to proceed?")
   if (confmsg==true){
     document.location.href=path;
  }
}
function RedirectParent(path){
window.opener.document.location=path;
window.opener.focus();
}
function redirecturl(){
	if (document.Form1.Sites.options(document.Form1.Sites.selectedIndex).value !=""){
		if (document.Form1.Sites.options(document.Form1.Sites.selectedIndex).value=="/LBC/Templates/Programs.aspx"){
		   document.location=document.Form1.Sites.options(document.Form1.Sites.selectedIndex).value
		}
		else{
		    window.open(document.Form1.Sites.options(document.Form1.Sites.selectedIndex).value)
		} 
	}
}
function openVideo(VideoID){
	//window.open("/LBC/Templates/ViewVideo.aspx?ID=" + VideoID,"View Video","width=500,height=500")
	openIT('/LBC/Templates/ViewVideo.aspx?ID=' + VideoID,639,509,'yes')
		}
function openflvVideo(VideoID){
	//window.open("/LBC/Templates/ViewVideo.aspx?ID=" + VideoID,"View Video","width=500,height=500")
	openIT('/LBC/Templates/ViewflvVideo.aspx?ID=' + VideoID,639,509,'yes')
		}
function openLiveVideo(VideoID){
   //openIT('/LBC/snaagent/ViewVideo.aspx?type=live&ID=' + VideoID,639,509,'yes')
	   openIT('/LBC/snaagent/ShowLiveStream.aspx',720,620,'yes')

}

function openNewsVideo(){
   openIT('/LBC/Templates/ViewVideo.aspx?type=NewsVideo',639,509,'yes')
	
}

function CheckPopUpsBlocked(){
var mine = window.open('','','width=1,height=1,left=0,top=0,scrollbars=no');
if(mine){
	var popUpsBlocked = false;
	mine.close();
} else {
	var popUpsBlocked = true;
}
return popUpsBlocked;
}

function LoggedInAlert(){
alert("This account is already logged in")
}


/*forum*/
function ValidateThread()
{   var msg="";
	if (Trim(document.Form1.txtTitle.value)=="")
		msg+="-Topic Title is required\n";
	if (Trim(document.Form1.txtDescription.value)=="")
		msg+="-Topic Description is required";	
	
	if (msg!="")
	    {alert(msg);
		return false;
		}
    else
		return true;
}

function ValidateSearch(){
	var msg="";
	if (Trim(document.getElementById("SearchForums1_txtKeyword").value)=="")
		msg+=" - Keyword is required\n";
    /*if (document.getElementById("SearchForums1_lstCategories").selectedIndex==0)
		msg+=" - Category is required";*/
	if (msg!="")
		{alert(msg);
		return false;
	}
	else
		return true;
}

function toggleBlock(d, i)
{
	var e = MM_findObj(d);
	var img = MM_findObj(i);
	if (!e) return;
	if (e.style.display == "block"){
		e.style.display = "none";
		//img.src = "images/expand.gif";
	} else {
		e.style.display = "block";
		//img.src = "images/collapse.gif";
	}
}

function toggleBlock2(d, i)
{
	var e = MM_findObj(d);
	var img = MM_findObj(i);
	if (!e) return;
	if (e.style.display == "none"){
		e.style.display = "block";
		img.src = "/LBC/images/collapse.gif";
	} else {
		e.style.display = "none";
		img.src = "/LBC/images/expand.gif";
	}
}

var activediv = "";
var activeimg = "";
var activeimgsrc = "";
function toggleBlock3(div_id, img_id, img_src, newimg_src){
	var d = MM_findObj(div_id);
	var i = MM_findObj(img_id);
	if(activediv != ""){
		ad = MM_findObj(activediv);
		ai = MM_findObj(activeimg);
		if((ad.style.display == "block") && (activediv!=div_id)){
			ad.style.display = "none";
			ai.src = activeimgsrc;		
			}
		}
	if(d != null){
		if(d.style.display == "block"){
			d.style.display = "none";
			i.src = img_src;
		} else {
			d.style.display = "block";
			i.src = newimg_src;
			activediv = div_id;
			activeimg=img_id;
			activeimgsrc=img_src;
		}
	}
}

var activedivdist = "";
function toggleBlock4(div_id){
	var d = MM_findObj(div_id);
	if(activedivdist != ""){
		ad = MM_findObj(activedivdist);
		if((ad.style.display == "block") && (activedivdist!=div_id)){
			ad.style.display = "none";
			}
		}
	if(d != null){
		if(d.style.display == "block"){
			d.style.display = "none";
		} else {
			d.style.display = "block";
			activedivdist = div_id;
		}
	}
}

function ValidatePost(){
	var msg="";
	if (Trim(document.getElementById("txtTitle").value)=="")
		msg+=" - Title is required\n";
   /* if (document.getElementById("radEditorTextRE").value=="")
		msg+=" - Message is required";*/
	if (msg!="")
		{alert(msg);
		return false;
	}
	else
		return true;
}

function ValidateSendEcard(){
	var msg="";
	var msg1="";
	if (document.Form1.txtSenderName.value=="")
		msg+="- Sender Name is required\n";
	if (document.Form1.txtSenderEmail.value=="")
		msg+="- Sender Email is required\n";
	else{
		var strvalmail=IsValidEmail(document.Form1.txtSenderEmail);
	    if (strvalmail.length>0)
			msg1+="Please enter a valid Sender Email Address\n";
	}
	if (document.Form1.txtReceiverName.value=="")
		msg+="- Receiver Name is required\n";
	if (document.Form1.txtReceiverEmail.value=="")
		msg+="- Receiver Email is required\n";
	else{
		var strvalmail=IsValidEmail(document.Form1.txtReceiverEmail);
	    if (strvalmail.length>0)
			msg1+="Please enter a valid Receiver Email Address\n";
		}
	if (document.Form1.txtReceiverName2.value!="" && document.Form1.txtReceiverEmail2.value=="")
		msg+="- Receiver 2 Email is required\n";
	if (document.Form1.txtReceiverName2.value=="" && document.Form1.txtReceiverEmail2.value!="")
		msg+="- Receiver 2 Name is required\n";
	if (document.Form1.txtReceiverName3.value!="" && document.Form1.txtReceiverEmail3.value=="")
		msg+="- Receiver 3 Email is required\n";
	if (document.Form1.txtReceiverName3.value=="" && document.Form1.txtReceiverEmail3.value!="")
		msg+="- Receiver 3 Name is required\n";
	if (document.Form1.txtReceiverName4.value!="" && document.Form1.txtReceiverEmail4.value=="")
		msg+="- Receiver 4 Email is required\n";
	if (document.Form1.txtReceiverName4.value=="" && document.Form1.txtReceiverEmail4.value!="")
		msg+="- Receiver 4 Name is required\n";
	if (document.Form1.txtReceiverEmail2.value!=""){
		var strvalmail=IsValidEmail(document.Form1.txtReceiverEmail2);
	    if (strvalmail.length>0)
			msg1+="Please enter a valid Receiver 2 Email Address\n";
		}
	if (document.Form1.txtReceiverEmail3.value!=""){
		var strvalmail=IsValidEmail(document.Form1.txtReceiverEmail3);
	    if (strvalmail.length>0)
			msg1+="Please enter a valid Receiver 3 Email Address\n";
		}
	if (document.Form1.txtReceiverEmail4.value!=""){
		var strvalmail=IsValidEmail(document.Form1.txtReceiverEmail4);
	    if (strvalmail.length>0)
			msg1+="Please enter a valid Receiver 4 Email Address\n";
	}
		
	
	if (msg==""){
		if (msg1=="")
			return true;
		else{
			alert(msg1);
			return false;}
	}	
	else{
		alert(msg);
		return false;}

		
}

function PopPreview(EcardID){
	var FlashVars;
	var MemberPic;
	FlashVars=document.getElementById("txtFlashVars").value;
	MemberPic=document.getElementById("txtMemberPic").value;
	openIT('/LBC/Templates/PreviewEcard.aspx?ID=' + EcardID + "&FlashVars=" + FlashVars + "&MemberPic=" + MemberPic,700,600,true);
	}

function OpenAlbiDaliliQuiz(){
	window.open('/LBC/AlbiDalili/Boy.aspx','AlbiDalili','width=620,height=620,scrollbars=yes');
	document.location.href='/LBC/en/sub+content/albi+dalili'
}
function ValidateFeedback(){
	var msg="";
	var msg1="";
	var strvalmail=""
	if (document.Form1.txtName.value=="")
		msg+=" - Name\n";
	if (document.Form1.txtEmail.value=="")
		msg+=" - Email\n";
	else{
		strvalmail=IsValidEmail(document.Form1.txtEmail);
	    if (strvalmail.length>0)
			msg1+=" Invalid Email Address\n";
	    } 
	if (document.Form1.txtMessage.value=="")
		msg+=" - Message\n";
	
	if (msg==""){
		if (msg1=="")
		   return true
        else
		{
			alert(msg1);
			return false;}
	}
	else{  
	   alert("The following fields are required,\n please be sure to fill them and try again:\n" + msg )
		return false;
		}	
	}
	
function ClearFieldMsg(Msg, FieldID){
	if(document.getElementById(FieldID).value==Msg)
		document.getElementById(FieldID).value="";
	}
	function toggleTvDiv(div_id)
		{
			var d = document.getElementById('divnew');
			var d2 = document.getElementById('divmostVviewed');
			if (div_id == 'divnew'){
				d.style.display = 'block';
				d2.style.display = 'none';
			} else {
				d2.style.display = 'block';
				d.style.display = 'none';
			}
		}
function ValidateJoin(){
	if (document.getElementById("JumpNewsLetter1_txtEmail").value==""){
		alert("Please enter your e-mail");
		return false;
	}
	else {
		strvalmail=IsValidEmail(document.getElementById("JumpNewsLetter1_txtEmail"));
		if (strvalmail.length>0){
			alert("Invalid Email Address");
			return false;
		}
		else
			return true;
	}
		
}
