
email_Format=/^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-zA-Z]{2,6}(\.[a-zA-Z]{2})?$/i;function header_login_validate()
{var uname1=trim(document.getElementById('username').value);var pass1=trim(document.getElementById('password').value);document.getElementById('header_message').innerHTML="";pass1=pass1.replace(/&/g,'#*amp;*#');if(uname1==""||pass1==""||uname1.search(email_Format)==-1)
{document.getElementById('login_section').style.display='none';document.getElementById('fb_headerlogindiv').style.display='none';if(document.getElementById('fb_customheaderlogindiv'))
document.getElementById('fb_customheaderlogindiv').style.display='none';document.getElementById('header_message').style.display='block';document.getElementById('header_message').className='headermessage error_message';document.getElementById('header_message').innerHTML=document.getElementById('header_login_error_msg').value;setTimeout("toggle_login_section()",2000);return(false);}
if(trim(document.getElementById('username').value)!=""&&uname1.search(email_Format)!=-1&&document.getElementById('password').value!="")
{var login_user=trim(document.getElementById('username').value);var login_password=document.getElementById('password').value;login_password=login_password.replace(/&/g,'#*amp;*#');if(document.getElementById('rem_me').checked==true){var remember_me=document.getElementById('rem_me').value;}
else{var remember_me="0";}
var url=WEBTV_ROOTPATH+"includes/ajax/ajax_login.php";var parameters="uname="+login_user+"&password="+login_password+"&remember_me="+remember_me;document.getElementById('login_section').style.display='none';document.getElementById('load_img_display').style.display='block';if(window.XMLHttpRequest)
{user_login_req=new XMLHttpRequest();}
else if(window.ActiveXObject)
{user_login_req=new ActiveXObject("Microsoft.XMLHTTP");}
user_login_req.open("POST",url,true);user_login_req.setRequestHeader("Content-type","application/x-www-form-urlencoded;");user_login_req.setRequestHeader("Content-length",parameters.length);user_login_req.setRequestHeader("Connection","close");user_login_req.onreadystatechange=callback_header_login_validate;user_login_req.send(parameters);}}
function callback_header_login_validate(){if(user_login_req.readyState==4){if(user_login_req.status==200){user_login_response=user_login_req.responseText;document.getElementById('load_img_display').style.display='none';if(document.getElementById('fb_customheaderlogindiv'))
document.getElementById('fb_customheaderlogindiv').style.display='none';if(user_login_response=="SUCESS")
{header_getPage();document.getElementById('fb_headerlogindiv').style.display='none';}
else if(user_login_response!="SUCESS"&&user_login_response!=0&&user_login_response!="")
{document.getElementById('message_fbid_present').innerHTML=user_login_response;document.getElementById('message_fbid_present').style.display='block';setTimeout("document.getElementById('message_fbid_present').style.display = 'none'",2000);}else if(user_login_response==0||user_login_response=="")
{document.getElementById('fb_headerlogindiv').style.display='none';if(document.getElementById('fb_customheaderlogindiv'))
document.getElementById('fb_customheaderlogindiv').style.display='none';document.getElementById('header_message').style.display='block';document.getElementById('header_message').className='headermessage error_message';document.getElementById('header_message').innerHTML=document.getElementById('header_login_error_msg').value;setTimeout("toggle_login_section()",2000);}
return false;}else{document.getElementById('header_message').className='headermessage error_message';document.getElementById('header_message').innerHTML=document.getElementById('header_ajax_response_error').value;setTimeout("toggle_login_section()",2000);}}}
function clearEmailField(obj,lan){if(obj.value==lan){obj.value="";}}
function FillEmailField(obj,lan){if(obj.value==""){obj.value=lan;}}
function clearPasswordField(obj){if(obj.value=="Password"){obj.value="";}}
function FillPasswordField(obj){if(obj.value==""){obj.value="Password";}}
function toggle_login_section(){document.getElementById('header_message').style.display='none';document.getElementById('header_message').className='headermessage';document.getElementById('login_section').style.display='block';if(document.getElementById('is_fb_and_moodio_user')){if(document.getElementById('is_fb_and_moodio_user').value==1){document.getElementById('fb_headerlogindiv').style.display='block';}else{document.getElementById('fb_customheaderlogindiv').style.display='block';}}
document.getElementById('header_logged_user').style.display='none';}
function header_check_button(e,nu,lg)
{if(window.event)
key=window.event.keyCode;else
key=e.which;if(key==13)
{if(nu==1)
{header_login_validate();}
else if(nu==0)
{header_forget_pwd(lg);}
else if(nu==2)
{signin_validate();}}
else
return false;}
function header_forget_pwd(u)
{document.getElementById('header_message').innerHTML="";var for_pwd=trim(document.getElementById('forgetpwdname').value);document.getElementById('header_message').style.display='none';document.getElementById('header_message').innerHTML="";if(for_pwd=='')
{document.getElementById('sub_lostpwd_section').style.display='none';document.getElementById('header_message').style.display='block';document.getElementById('header_login').style.display='none';document.getElementById('header_login_div').style.display='none';document.getElementById('header_login_msg').style.display='none';document.getElementById('header_message').className='headermessage error_message';document.getElementById('header_message').innerHTML=document.getElementById('header_login_error_msg').value;setTimeout("toggle_lostpwd_error_section()",2000);}
else if(for_pwd!=''&&for_pwd.search(email_Format)==-1)
{document.getElementById('sub_lostpwd_section').style.display='none';document.getElementById('header_message').style.display='block';document.getElementById('header_login').style.display='none';document.getElementById('header_login_div').style.display='none';document.getElementById('header_login_msg').style.display='none';document.getElementById('header_message').className='headermessage error_message';document.getElementById('header_message').innerHTML=document.getElementById('header_login_error_msg').value;setTimeout("toggle_lostpwd_error_section()",2000);}
if(for_pwd!=''&&for_pwd.search(email_Format)!=-1)
{var url=WEBTV_ROOTPATH+"forgetpassword.php";var lang=u;var parameters="uname="+for_pwd+"&lang="+lang+"&todo="+1;if(window.XMLHttpRequest)
{for_pwd_req=new XMLHttpRequest();}
else if(window.ActiveXObject)
{for_pwd_req=new ActiveXObject("Microsoft.XMLHTTP");}
for_pwd_req.open("POST",url,true);for_pwd_req.setRequestHeader("Content-type","application/x-www-form-urlencoded;");for_pwd_req.setRequestHeader("Content-length",parameters.length);for_pwd_req.setRequestHeader("Connection","close");for_pwd_req.onreadystatechange=callback_header_forgetpwd;for_pwd_req.send(parameters);}}
function callback_header_forgetpwd(){if(for_pwd_req.readyState==4){if(for_pwd_req.status==200){for_pwd_req_response=for_pwd_req.responseText;if(for_pwd_req_response==1)
{document.getElementById('sub_lostpwd_section').style.display='none';document.getElementById('header_message').style.display='block';document.getElementById('header_login').style.display='none';document.getElementById('header_login_div').style.display='none';document.getElementById('header_login_msg').style.display='none';document.getElementById('header_message').className='headermessage sucess_message';document.getElementById('header_message').innerHTML=document.getElementById('header_mail_send_sucess').value;setTimeout("toggle_lostpwd_error_section()",2000);}
else
{document.getElementById('sub_lostpwd_section').style.display='none';document.getElementById('header_message').style.display='block';document.getElementById('header_login').style.display='none';document.getElementById('header_login_div').style.display='none';document.getElementById('header_login_msg').style.display='none';document.getElementById('header_message').className='headermessage error_message';document.getElementById('header_message').innerHTML=document.getElementById('header_mail_send_failure').value;setTimeout("toggle_lostpwd_error_section()",2000);}
document.getElementById('forgetpwdname').value='';return false;}else{}}}
function header_getPage(){header_checklogin('downlogin');}
function header_checklogin(logins)
{if(logins=='popup')
{var username=document.getElementById('re_username').value;var password=document.getElementById('re_password').value;}
else
{var username=document.getElementById('username').value;var password=document.getElementById('password').value;}
password=password.replace(/&/g,'#*amp;*#');var params="username="+username+"&password="+password+"&redirect=1";if(logins=='downlogin')
{if(document.getElementById('rem_me').checked==true){var remember_me=document.getElementById('rem_me').value;}
else{var remember_me="0";}
params=params+"&rem_me="+remember_me+"&downlogin=1";}
var url=WEBTV_ROOTPATH+'includes/login_check.php';if(window.XMLHttpRequest)
{login_req=new XMLHttpRequest();}
else if(window.ActiveXObject)
{login_req=new ActiveXObject("Microsoft.XMLHTTP");}
login_req.open("POST",url,true);login_req.setRequestHeader("Content-type","application/x-www-form-urlencoded;");login_req.setRequestHeader("Content-length",params.length);login_req.setRequestHeader("Connection","close");login_req.onreadystatechange=header_callback;login_req.send(params);}
function header_callback()
{if(login_req.readyState==4)
{if(login_req.status==200)
{login_response=login_req.responseText;if(document.getElementById('headerfb_loader_login'))
{document.getElementById('headerfb_loader_login').style.display='none';}
if(login_response=='failure')
{if(document.getElementById('loginerror')){document.getElementById('loginerror').style.display='block';window.setTimeout('closeloginerror()',1900);}
if(document.getElementById('headerfb_loginerror')){document.getElementById('headerfb_loginerror').style.display='block';window.setTimeout("document.getElementById('headerfb_loginerror').style.display='none'",1900);}}else{header_page_refresh(login_response);if(document.getElementById('fb_headerlogindiv'))
document.getElementById('fb_headerlogindiv').style.display='none';if(document.getElementById('fb_customheaderlogindiv'))
document.getElementById('fb_customheaderlogindiv').style.display='none';}}
else
{alert("There was a problem retrieving the data:\n"+login_req.statusText);}}}
function header_logout_webtv()
{var url=WEBTV_ROOTPATH+"/header/logout.php";var parameters="sesid="+1;if(window.XMLHttpRequest)
{logout_req=new XMLHttpRequest();}
else if(window.ActiveXObject)
{logout_req=new ActiveXObject("Microsoft.XMLHTTP");}
logout_req.open("POST",url,true);logout_req.setRequestHeader("Content-type","application/x-www-form-urlencoded;");logout_req.setRequestHeader("Content-length",parameters.length);logout_req.setRequestHeader("Connection","close");logout_req.onreadystatechange=callback_header_logout_webtv;logout_req.send(parameters);}
function callback_header_logout_webtv(){if(logout_req.readyState==4){if(logout_req.status==200){logout_response=logout_req.responseText;var split_response_star=logout_response.split('**~**');if(split_response_star[0]=='success')
{document.getElementById('username').value=split_response_star[1];document.getElementById('password').value=split_response_star[2];if(split_response_star[3]==1)
{document.getElementById('rem_me').checked=true;}
else
{document.getElementById('rem_me').checked=false;}
toggle_login_section();document.getElementById('header_logout').style.display='none';if(document.getElementById('is_fb_and_moodio_user')){if(document.getElementById('is_fb_and_moodio_user').value==1){document.getElementById('fb_headerlogindiv').style.display='block';}else{document.getElementById('fb_customheaderlogindiv').style.display='block';}}
header_page_logout_refresh(split_response_star);}
return false;}else{document.getElementById('header_message').className='headermessage error_message';document.getElementById('header_message').innerHTML=document.getElementById('header_ajax_response_error').value;setTimeout("toggle_login_section()",2000);}}}
function header_checkloginsuccess(){}
function toggle_login_lostpwd(){if(document.getElementById('sub_login_section').style.display=='block'){document.getElementById('sub_login_section').style.display='none';document.getElementById('fb_headerlogindiv').style.display='none';if(document.getElementById('fb_customheaderlogindiv'))
document.getElementById('fb_customheaderlogindiv').style.display='none';document.getElementById('sub_lostpwd_section').style.display='block';document.getElementById('header_login_msg').style.display='block';document.getElementById('header_login').style.display='block';document.getElementById('header_login_div').style.display='block';document.getElementById('header_lostpwd').style.display='none';document.getElementById('header_remme_label').style.display='none';document.getElementById('header_remme_chk').style.display='none';}else{document.getElementById('sub_login_section').style.display='block';if(document.getElementById('is_fb_and_moodio_user')){if(document.getElementById('is_fb_and_moodio_user').value==1){document.getElementById('fb_headerlogindiv').style.display='block';}else{document.getElementById('fb_customheaderlogindiv').style.display='block';}}
document.getElementById('header_login_msg').style.display='none';document.getElementById('sub_lostpwd_section').style.display='none';document.getElementById('header_login').style.display='none';document.getElementById('header_login_div').style.display='none';document.getElementById('header_lostpwd').style.display='block';if(document.getElementById('rem_me').checked){document.getElementById('header_remme_label').style.display='block';}
document.getElementById('header_remme_chk').style.display='block';}}
function toggle_forgetpwd_section(){document.getElementById('header_message').style.display='none';document.getElementById('header_message').className='headermessage';document.getElementById('sub_lostpwd_section').style.display='block';}
function toggle_lostpwd_error_section(){document.getElementById('header_message').style.display='none';document.getElementById('header_message').className='headermessage';document.getElementById('sub_login_section').style.display='block';document.getElementById('login_section').style.display='block';document.getElementById('header_lostpwd').style.display='block';document.getElementById('header_login').style.display='none';}
function header_refresh(){var url=WEBTV_ROOTPATH+"header/header_login.php?module="+MODULE;var parameters="";if(document.getElementById('owner_page_id')){var owner_page_id=document.getElementById('owner_page_id').value;parameters="pid="+owner_page_id;}
if(window.XMLHttpRequest)
{header_refresh_req=new XMLHttpRequest();}
else if(window.ActiveXObject)
{header_refresh_req=new ActiveXObject("Microsoft.XMLHTTP");}
header_refresh_req.open("POST",url,true);header_refresh_req.setRequestHeader("Content-type","application/x-www-form-urlencoded;");header_refresh_req.setRequestHeader("Content-length",parameters.length);header_refresh_req.setRequestHeader("Connection","close");header_refresh_req.onreadystatechange=callback_header_refresh;header_refresh_req.send(parameters);}
function callback_header_refresh(){if(header_refresh_req.readyState==4){if(header_refresh_req.status==200){var header_refresh_response=header_refresh_req.responseText;header_setAjaxContent("header_user_login_section",header_refresh_response);}else{document.getElementById('header_message').className='headermessage error_message';document.getElementById('header_message').innerHTML=document.getElementById('header_ajax_response_error').value;setTimeout("toggle_login_section()",2000);}}}
function header_setAjaxContent(divId,html){var temp=html;document.getElementById(divId).innerHTML="";document.getElementById(divId).innerHTML=html;while(true){var sindex=temp.indexOf("<script"+">");if(sindex<0)break;var eindex=temp.indexOf("</"+"script>",sindex);var js=temp.substring(sindex+8,eindex);eval(js);temp=temp.substring(eindex+9);}}
function header_check_login_ready(redirect){var params="redirect=1&fb_login=1";if(redirect=="1"||redirect==1){params=params+"&downlogin=1";}
var url=WEBTV_ROOTPATH+'includes/login_check.php';if(window.XMLHttpRequest)
{contactreq=new XMLHttpRequest();}
else if(window.ActiveXObject)
{contactreq=new ActiveXObject("Microsoft.XMLHTTP");}
contactreq.open("POST",url,true);contactreq.setRequestHeader("Content-type","application/x-www-form-urlencoded;");contactreq.setRequestHeader("Content-length",params.length);contactreq.setRequestHeader("Connection","close");contactreq.onreadystatechange=header_checklogin_callback;contactreq.send(params);}
function header_checklogin_callback()
{if(contactreq.readyState==4)
{if(contactreq.status==200)
{response=contactreq.responseText;if(response=='failure')
{document.getElementById('divLogin').style.height='190px';document.getElementById('fb_msg_id').style.display='block';}else if(response=='FIRST FB USER'){open_fb_login_container();}else{header_page_refresh(response);document.getElementById('fb_headerlogindiv').style.display='none';if(document.getElementById('fb_customheaderlogindiv'))
document.getElementById('fb_customheaderlogindiv').style.display='none';}}
else
{document.getElementById('header_message').className='headermessage error_message';document.getElementById('header_message').innerHTML=document.getElementById('header_ajax_response_error').value;setTimeout("toggle_login_section()",2000);}}}
function header_page_refresh(response){if(document.getElementById('headerfb_popup_content'))
{fb_closelogin();}
if(MODULE=="MEMBERPAGE"){memberpageLogin("MEMBERPAGE",response);}else if(MODULE=="WEBTV"){webtvLogin("WEBTV",response);}else if(MODULE=="SIGNIN"||MODULE=="RECOVERYPASSWORD"){webtvLogin("SIGNIN",response);}else if(MODULE=="MEMBERPAGESEARCH"){setTimeout("header_refresh()",1000);memberpageLogin("MEMBERPAGESEARCH",response);}else if(MODULE=="MEMBERPAGEMAILBOX"){setTimeout("header_refresh()",1000);memberpageLogin("MEMBERPAGEMAILBOX",response);}else if(MODULE=="NEWSLETTER"){window.location=WEBTV_ROOTPATH+'webtv';}else if(MODULE=="FAQ"){window.location=WEBTV_ROOTPATH+'webtv';}}
function webtvLogin(module,response,submodule){if((response=='success'&&module=="WEBTV")||submodule=='voting')
{header_refresh();header_checkloginsuccess();window.setTimeout("webtv_admin_nav_refresh()",2000);reload_playlist_popup();}
else if(response=='success'&&module=="SIGNIN")
{window.location=WEBTV_ROOTPATH+'webtv';}
else if(response=='superadmin')
{window.location=WEBTV_ROOTPATH+'superadmin';}
else if(response=='previewadmin')
{window.location=WEBTV_ROOTPATH+'previewadmin';}
else if(response=='useradmin')
{window.location=WEBTV_ROOTPATH+'admin/index.php?fuseaction=dsp_web_statistics&action=webstats&language=en';}
else if(response=='directoryadmin')
{window.location=WEBTV_ROOTPATH+'directoryadmin/index.php?page=view&val=a';}
else if(response=='editor')
{window.location=WEBTV_ROOTPATH+'editor';}}
function memberpageLogin(module,response){if((response=='success'||response=='superadmin'||response=='previewadmin'||response=='useradmin'||response=='directoryadmin'||response=='editor')&&(module=="MEMBERPAGE"||module=="MEMBERPAGESEARCH"||module=="MEMBERPAGEMAILBOX"))
{if(MODULE=="MEMBERPAGE")
{var mp_tab=$('#mp_tab').val();if(mp_tab!='')
{var redirect_url=$('#mp_url').val()+"/"+mp_tab;}
else
{var redirect_url=$('#mp_url').val();}
location.href=redirect_url;}
window.setTimeout("webtv_admin_nav_refresh()",2000);if(document.getElementById('login_div'))
{document.getElementById('loader_login').style.display='none';document.getElementById('login_div').style.display='none';var last_action=document.getElementById('act_fired').value;var pageowner_id=document.getElementById('owner_page_id').value;javascript:xmlhttpvdupdatemp(ajax_url+'member.php',last_action,pageowner_id);}
else if(document.getElementById('login_div1'))
{var direct_msgid=document.getElementById('direct_msgid').value;var direct_msgid_tab=document.getElementById('direct_msgid_tab').value;var direct_requestact=document.getElementById('direct_requestact').value;if(direct_requestact=="i"||direct_requestact=="s")
{call_backmail_function(direct_requestact);}
else if(direct_requestact=="r"||direct_requestact=="a")
{document.getElementById('direct_requestact').value="";check_request(direct_msgid,direct_msgid_tab,direct_requestact);}
else if(direct_requestact=='smsg')
{document.getElementById('direct_requestact').value="";location.reload(true);}
document.getElementById('login_div1').style.display='none';}
else if(document.getElementById('topfilterdiv'))
{create_settingbox_search();document.getElementById('labelLogout').style.display='block';document.getElementById('txt_search_all').focus();}
if(module=="MEMBERPAGEMAILBOX")
{location.reload(true);}}}
function header_page_logout_refresh(split_response_star){if(document.getElementById('headerfb_popup_content'))
{fb_closelogin();}
if(MODULE=="MEMBERPAGE"){memberpageLogout("MEMBERPAGE",split_response_star);}else if(MODULE=="WEBTV"){webtvLogout("WEBTV",split_response_star);}else if(MODULE=="SIGNIN"||MODULE=="RECOVERYPASSWORD"){setTimeout("header_refresh()",500);webtvLogout("SIGNIN",split_response_star);}else if(MODULE=="MEMBERPAGESEARCH"){setTimeout("header_refresh()",500);memberpageLogout("MEMBERPAGESEARCH",split_response_star);}else if(MODULE=="MEMBERPAGEMAILBOX"){setTimeout("header_refresh()",500);memberpageLogout("MEMBERPAGEMAILBOX",split_response_star);}}
function memberpageLogout(module,split_response_star){window.setTimeout("webtv_admin_nav_refresh()",2000);if(module=="MEMBERPAGE"){var redirect_url=document.getElementById('page_link').value;location.href=redirect_url;if(split_response_star[0]=='success')
{var last_action=document.getElementById('act_fired').value;var pageowner_id=document.getElementById('owner_page_id').value;javascript:xmlhttpvdupdatemp(ajax_url+'member.php','',pageowner_id);if(document.getElementById('username')){document.getElementById('username').value=split_response_star[1];}
if(document.getElementById('password')){document.getElementById('password').value=split_response_star[2];}
if(split_response_star[3]==1)
{if(document.getElementById('rem_me')){document.getElementById('rem_me').checked=true;}}
else
{if(document.getElementById('rem_me')){document.getElementById('rem_me').checked=false;}}
if(document.getElementById('fb_webtvloginlabel')){document.getElementById('fb_webtvloginlabel').style.display='block';}
if(document.getElementById('fb_webtvlogindiv')){document.getElementById('fb_webtvlogindiv').style.display='block';}
if(document.getElementById('fb_logindiv')){document.getElementById('fb_logindiv').style.display='block';}
if(document.getElementById('fb_msg_id')){document.getElementById('fb_msg_id').style.display='none';}
if(document.getElementById('divLogin')){document.getElementById('divLogin').style.height='137px';}
if(document.getElementById('loader_login')){document.getElementById('loader_login').style.display='none';}}}else if(module=="MEMBERPAGESEARCH"){if(split_response_star[0]=='success')
{var txt_search=document.getElementById('txt_search_all').value;var refresh_url=ajax_url+"memberpage_search.php?sc="+txt_search;window.location=refresh_url;}}else if(module=="MEMBERPAGEMAILBOX"){if(split_response_star[0]=='success')
{location.reload(true);}}}
function webtvLogout(module,split_response_star){if(module=="WEBTV"){value=document.getElementById('playlistids').value;xmlhttpvdidPlaylist(MP_ROOTPATH+'playlist/playlist.php','showplaylist',value,'','','','',MP_ROOTPATH,'forPlaylist');document.getElementById("partnerZone").innerHTML="";window.setTimeout("refreshVideoComment()",3200);window.setTimeout("webtv_admin_nav_refresh()",2000);}else if(module=="SIGNIN"||module=="RECOVERYPASSWORD"){}}
function getContainerHeight(resizeVal){if(resizeVal==""){resizeVal=245;}
var scnWid,scnHei;if(self.innerHeight)
{scnWid=self.innerWidth;scnHei=self.innerHeight;}
else if(document.documentElement&&document.documentElement.clientHeight)
{scnWid=document.documentElement.clientWidth;scnHei=document.documentElement.clientHeight;}
else if(document.body)
{scnWid=document.body.clientWidth;scnHei=document.body.clientHeight;}
if(document.getElementById("menuAndContentarea"))
{document.getElementById("menuAndContentarea").style.minHeight=(scnHei-resizeVal)+"px";;}
if(document.getElementById('playermode')){if(document.getElementById('playermode').value=='full'){setFullPage('resize');}}}
function changeback()
{var role=document.getElementById('roll').value;if(role==14)
{document.body.style.backgroundColor='#FFFFFF';}
if(role==13)
{document.body.style.backgroundColor='#FFFFFF';}
if(role==11)
{document.body.style.backgroundColor='#FFFFFF';}
if(role==10)
{document.body.style.backgroundColor='#FFFFFF';}
if(role==9)
{document.body.style.backgroundColor='#FFFFFF';}
if(role==8)
{document.body.style.backgroundColor='';}
if(role==7)
{document.body.style.backgroundColor='';}
if(role==6)
{document.body.style.backgroundColor='';}
if(role==5)
{document.body.style.backgroundColor='';}
if(role==4)
{document.body.style.backgroundColor='';}
if(role==3)
{document.body.style.backgroundColor='';}
if(role==2)
{document.body.style.backgroundColor='';}
if(role==1)
{document.body.style.backgroundColor='';}}
function show_rem_me_label()
{document.getElementById('header_remme_label').style.display='block';document.getElementById('rem_me').className='header_remme_hover';document.getElementById('header_remme_chk').className='header_rememberme_chkbox';}
function hide_rem_me_label()
{if(document.getElementById('rem_me').checked==true)return;document.getElementById('header_remme_label').style.display='none';document.getElementById('rem_me').className='header_remme';document.getElementById('header_remme_chk').className='';}
function webtv_admin_nav_refresh(){var url=WEBTV_ROOTPATH+"webtv/admin_left_nav.php?module="+MODULE;var parameters="refresh=1";if(window.XMLHttpRequest)
{admin_nav_req=new XMLHttpRequest();}
else if(window.ActiveXObject)
{admin_nav_req=new ActiveXObject("Microsoft.XMLHTTP");}
admin_nav_req.open("POST",url,true);admin_nav_req.setRequestHeader("Content-type","application/x-www-form-urlencoded;");admin_nav_req.setRequestHeader("Content-length",parameters.length);admin_nav_req.setRequestHeader("Connection","close");admin_nav_req.onreadystatechange=callback_webtv_admin_nav_refresh;admin_nav_req.send(parameters);}
function callback_webtv_admin_nav_refresh(){if(admin_nav_req.readyState==4){if(admin_nav_req.status==200){var admin_nav_response=admin_nav_req.responseText;header_setAjaxContent("admin_left_nav",admin_nav_response);}else{}}}
function add_new_profile()
{location.href=MP_ROOTPATH+'signin/?newProfile=1';}
function close_other_popups(active_div)
{switch(MODULE){case"MEMBERPAGE":var divs=new Array('contactus','popup_container','info_img_container','alert_popup','login_div','playlist_popup','confrm_popup','msg_popup','settings_box_holder','mp_headerpopup','voting_contest_form','voting_contest_result','transaction_popup','ticket_details_popup','multiday_event_details_popup');break;case"WEBTV":var divs=new Array('voting_contest_form','voting_contest_result');break;case"SIGNIN":var divs=new Array();break;case"RECOVERYPASSWORD":var divs=new Array();break;case"MEMBERPAGESEARCH":var divs=new Array();break;case"MEMBERPAGEMAILBOX":var divs=new Array();break;case"NEWSLETTER":var divs=new Array();case"FAQ":var divs=new Array();break;}
for(var i=0;i<divs.length;i++)
{if(divs[i]==active_div)continue;var elem=document.getElementById(divs[i]);if(elem&&elem.style.display!="none")
{elem.style.display="none";}}}
function open_fb_login_container(){if(document.getElementById("headerfb_login_div")){document.getElementById("headerfb_login_div").style.display="block";document.getElementById("headerfb_popup_content").style.display="block";}
if(document.getElementById('fb_headerlogindiv'))
document.getElementById('fb_headerlogindiv').style.display='none';if(document.getElementById('fb_customheaderlogindiv'))
document.getElementById('fb_customheaderlogindiv').style.display='block';}
function fb_first_login()
{var done=1;var reusername=document.getElementById("headerfb_re_username").value;var repassword=document.getElementById("headerfb_re_password").value;var email_Format=/^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-zA-Z]{2,6}(\.[a-zA-Z]{2})?$/i;if((reusername.search(email_Format)==-1||reusername=='')&&repassword=='')
{document.getElementById('headerfb_re_username').style.border='1px solid red';document.getElementById('headerfb_re_password').style.border='1px solid red';done=0;}
if(reusername.search(email_Format)==-1||reusername=='')
{document.getElementById('headerfb_re_username').style.border='1px solid red';done=0;}
else
{document.getElementById('headerfb_re_username').style.border='1px solid #DCD3CE';}
if(repassword=='')
{document.getElementById('headerfb_re_password').style.border='1px solid red';done=0;}
else
{document.getElementById('headerfb_re_password').style.border='1px solid #DCD3CE';}
if(done==1)
{fb_first_checklogin();}}
function fb_first_checklogin()
{if(document.getElementById('headerfb_loader_login'))
{document.getElementById('headerfb_loader_login').style.display='block';}
var username=document.getElementById('headerfb_re_username').value;var password=document.getElementById('headerfb_re_password').value;password=password.replace(/&/g,'#*amp;*#');var params="username="+username+"&password="+password+"&redirect=1&fbuser=1&fb_login=1";var url=WEBTV_ROOTPATH+'includes/login_check.php';if(window.XMLHttpRequest)
{login_req=new XMLHttpRequest();}
else if(window.ActiveXObject)
{login_req=new ActiveXObject("Microsoft.XMLHTTP");}
login_req.open("POST",url,true);login_req.setRequestHeader("Content-type","application/x-www-form-urlencoded;");login_req.setRequestHeader("Content-length",params.length);login_req.setRequestHeader("Connection","close");login_req.onreadystatechange=header_callback;login_req.send(params);}
function fb_closelogin()
{if(document.getElementById('headerfb_popup_content'))
{document.getElementById('headerfb_popup_content').style.display="none";document.getElementById('headerfb_login_div').style.display='none';}
if(document.getElementById('headerfb_re_username')){document.getElementById('headerfb_re_username').value='';document.getElementById('headerfb_re_username').style.border='1px solid #DCD3CE';}
if(document.getElementById('headerfb_re_password')){document.getElementById('headerfb_re_password').value='';document.getElementById('headerfb_re_password').style.border='1px solid #DCD3CE';}
if(document.getElementById('headerfb_loginerror')){if(document.getElementById('headerfb_loginerror').style.display=='block')
{document.getElementById('headerfb_loginerror').style.display='none';}}}
function fb_forgetpassword(u)
{var done=1;var reusername1=document.getElementById("headerfb_re_username1").value;var email_Format=/^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-zA-Z]{2,6}(\.[a-zA-Z]{2})?$/i;if(reusername1.search(email_Format)==-1||reusername1=='')
{document.getElementById('re_username1').style.border='1px solid red';done=0;}
else
{document.getElementById('re_username1').style.border='1px solid #DCD3CE';}
if(done==1)
{var url=WEBTV_ROOTPATH+"forgetpassword.php";var lang=u;var parameters="uname="+reusername1+"&lang="+lang+"&todo="+1;if(window.XMLHttpRequest)
{fb_for_pwd_req=new XMLHttpRequest();}
else if(window.ActiveXObject)
{fb_for_pwd_req=new ActiveXObject("Microsoft.XMLHTTP");}
fb_for_pwd_req.open("POST",url,true);fb_for_pwd_req.setRequestHeader("Content-type","application/x-www-form-urlencoded;");fb_for_pwd_req.setRequestHeader("Content-length",parameters.length);fb_for_pwd_req.setRequestHeader("Connection","close");fb_for_pwd_req.onreadystatechange=callback_fb_forgetpassword;fb_for_pwd_req.send(parameters);}}
function callback_fb_forgetpassword(){if(fb_for_pwd_req.readyState==4){if(fb_for_pwd_req.status==200){for_pwd_req_response=fb_for_pwd_req.responseText;if(for_pwd_req_response==1)
{document.getElementById('headerfb_pwddiv').style.display='none';document.getElementById('headerfb_forgetpawdmsg').style.display='block';}
return false;}else{}}}
function validate_user_email()
{var reusername1=document.getElementById("headerfb_re_username1").value;var email_Format=/^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-zA-Z]{2,6}(\.[a-zA-Z]{2})?$/i;if(reusername1.search(email_Format)==-1||reusername1=='')
{document.getElementById('headerfb_re_username1').style.border='1px solid red';}
else
{document.getElementById('headerfb_re_username1').style.border='1px solid #DCD3CE';}}
function header_check_user_exists(){var url=WEBTV_ROOTPATH+"includes/ajax/ajax_login.php";var parameters="check_fb_user_id=1";if(window.XMLHttpRequest)
{user_fblogin_req=new XMLHttpRequest();}
else if(window.ActiveXObject)
{user_fblogin_req=new ActiveXObject("Microsoft.XMLHTTP");}
user_fblogin_req.open("POST",url,true);user_fblogin_req.setRequestHeader("Content-type","application/x-www-form-urlencoded;");user_fblogin_req.setRequestHeader("Content-length",parameters.length);user_fblogin_req.setRequestHeader("Connection","close");user_fblogin_req.onreadystatechange=callback_header_check_user_exists;user_fblogin_req.send(parameters);}
function callback_header_check_user_exists(){if(user_fblogin_req.readyState==4){if(user_fblogin_req.status==200){user_login_response=user_fblogin_req.responseText;if(user_login_response=="FAILED")
{document.getElementById('fb_headerlogindiv').style.display='none';document.getElementById('fb_customheaderlogindiv').style.display='block';document.getElementById('header_mail_send_failure').value="0";}else{document.getElementById('fb_customheaderlogindiv').style.display='none';document.getElementById('fb_headerlogindiv').style.display='block';document.getElementById('header_mail_send_failure').value="1";}
return false;}}}
function ajaxObject(url,callbackFunction,stdName,std_value,teacher_name)
{var that=this;this.updating=false;this.abort=function(){if(that.updating){that.updating=false;that.AJAX.abort();that.AJAX=null;}}
this.update=function(passData,postMethod){if(that.updating){return false;}
that.AJAX=null;if(window.XMLHttpRequest){that.AJAX=new XMLHttpRequest();}else{that.AJAX=new ActiveXObject("Microsoft.XMLHTTP");}
if(that.AJAX==null){return false;}else{that.AJAX.onreadystatechange=function(){if(that.AJAX.readyState==4){that.updating=false;that.callback(that.AJAX.responseText,that.AJAX.status,that.AJAX.responseXML,fieldCall,levelIndexCall,teacher_name);that.AJAX=null;}}
that.updating=new Date();if(/post/i.test(postMethod)){var uri=urlCall+'?'+that.updating.getTime();that.AJAX.open("POST",uri,true);that.AJAX.setRequestHeader("Content-type","application/x-www-form-urlencoded;charset=iso-8859-1");that.AJAX.setRequestHeader("Content-Length",passData.length);that.AJAX.send(passData);}else{var uri=urlCall+'?'+passData+'&timestamp='+(that.updating.getTime());that.AJAX.open("POST",uri,true);that.AJAX.send(null);}
return true;}}
var urlCall=url;var fieldCall=stdName;var levelIndexCall=std_value;var teacher_name=teacher_name;this.callback=callbackFunction||function(){};}
function show_popup_at_center(ele_id)
{var myWidth=0;var myHeight=0;var element_id="#"+ele_id;var reqheight=$(element_id).height();var reqwidth=$(element_id).width();if(typeof(window.innerWidth)=='number')
{myWidth=window.innerWidth;myHeight=window.innerHeight;yop=(myHeight/2)-(reqheight/2);yop=yop-20;}
else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight))
{myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight;yop=(myHeight/2)-(reqheight/2);}
else if(document.body&&(document.body.clientWidth||document.body.clientHeight))
{myWidth=document.body.clientWidth;myHeight=document.body.clientHeight;yop=(myHeight/2)-(reqheight/2);}
xop=(myWidth/2)-(reqwidth/2);if(document.getElementById(ele_id))
{document.getElementById(ele_id).style.display='block'
document.getElementById(ele_id).style.left=xop+"px";document.getElementById(ele_id).style.top=yop+"px";}}
function go_to_premium_page()
{document.getElementById('header_profile_view').style.display='none';document.getElementById('header_profile_edit').style.display='block';var param="";var postURL=MP_ROOTPATH+'members/premium/premium.php';ajaxSetArray=new ajaxObject(postURL,response_go_to_premium_page);ajaxSetArray.update(param,'Post')}
function response_go_to_premium_page(responseText,responseStatus,responseXML)
{if(responseStatus==200)
{var response=responseText;if(document.getElementById('content1'))
{document.getElementById('content1').innerHTML=response;}}}
function show_overlay()
{$('#grey_overlay').show();}
function hide_overlay()
{$('.lightbox_bg').hide();}
function show_black_box(div){if(jQuery.browser.version!='7.0'&&!$('.lightbox_bg').is(":visible")){$('<div />').addClass('lightbox_bg').appendTo('body').show();}
$(div).show();}<!--
function xmlhttpvdsent_footer(strURL,a){document.getElementById('coming_soon').style.display='none'
reversestatecontactus();var xmlHttpReq8=false;var self=this;if(window.XMLHttpRequest){self.xmlHttpReq8=new XMLHttpRequest();}
else if(window.ActiveXObject){self.xmlHttpReq8=new ActiveXObject("Microsoft.XMLHTTP");}
self.xmlHttpReq8.open('POST',strURL,true);self.xmlHttpReq8.setRequestHeader('Content-Type','application/x-www-form-urlencoded');self.xmlHttpReq8.onreadystatechange=function(){if(self.xmlHttpReq8.readyState==4){updatenextvdsent_footer(self.xmlHttpReq8.responseText);}}
self.xmlHttpReq8.send(getquerynextvdsent_footer(a));}
function getquerynextvdsent_footer(a)
{qstr1='footersection='+escape(a);return qstr1;}
function updatenextvdsent_footer(str7){document.getElementById("termandcondition").innerHTML=str7;window.setTimeout("showfoterajaxdiv()",300);}
function showfoterajaxdiv()
{document.getElementById('termandcondition').style.display='block';}
function opentermandcondition(a)
{if(a=='footertermandcondition')
{popupWidth=780;popupHeight=800;var posleft=(screen.availWidth/2)-(popupWidth/2);var postop=(screen.availHeight/2)-(popupHeight/2);var targetPop=window.open(MP_ROOTPATH+"page/terms_popup.php",'termsandconditions','toolbar=no, location=no, directories=no,status=no, menubar=no, scrollbars=yes, resizable=YES, copyhistory=no, width='+popupWidth+', height='+popupHeight+', top='+postop+', left='+posleft);}
else if(a=='privacy')
{popupWidth=500;popupHeight=505;var posleft=(screen.availWidth/2)-(popupWidth/2);var postop=(screen.availHeight/2)-(popupHeight/2);var targetPop=window.open(MP_ROOTPATH+"page/privacy_popup.php",'privacy','toolbar=no, location=no, directories=no,status=no, menubar=no, scrollbars=no, resizable=YES, copyhistory=no, width='+popupWidth+', height='+popupHeight+', top='+postop+', left='+posleft);}}
function opentermandcondition1()
{document.getElementById('termandcondition').style.display='none';}
var beta_msg_timer;function coming_soon(x,y)
{clearTimeout(beta_msg_timer);document.getElementById('termandcondition').style.display='none';document.getElementById('coming_soon').innerHTML=document.getElementById('notdev').innerHTML;show_or_notshow_signin_link()
document.getElementById('coming_soon').style.width="300px";document.getElementById('coming_soon').style.left=x+"px";document.getElementById('coming_soon').style.top=y+"px";document.getElementById('coming_soon').style.height="auto";document.getElementById('coming_soon').style.display="block";reversestatecontactus();beta_msg_timer=window.setTimeout("document.getElementById('coming_soon').style.display='none';hide_overlay();",4000);}
function show_or_notshow_signin_link()
{if(document.getElementById('ses_userid'))
{var user_id=document.getElementById('ses_userid').value
if(user_id>0&&user_id!='')
{if(document.getElementById('beta_msg_signin_link'))
{document.getElementById('beta_msg_signin_link').style.display="none";}}
else
{if(document.getElementById('beta_msg_signin_link'))
{document.getElementById('beta_msg_signin_link').style.display="block";}}}
else if(document.getElementById('mem_pageid'))
{var user_id=document.getElementById('mem_pageid').value
if(user_id>0&&user_id!='')
{document.getElementById('beta_msg_signin_link').style.display='none';}
else
{document.getElementById('beta_msg_signin_link').style.display='block';}}
else
{document.getElementById('beta_msg_signin_link').style.display='block';}}
function show_not_done_link(tis,betapos)
{show_black_box('#coming_soon');var curobj=tis;var xpos=getposcord(curobj,"left")+((typeof opt_position!="undefined"&&opt_position.indexOf("right")!=-1)?-(subobj.offsetWidth-curobj.offsetWidth):0)
var ypos=getposcord(curobj,"top")+((typeof opt_position!="undefined"&&opt_position.indexOf("bottom")!=-1)?curobj.offsetHeight:0)
if(betapos=='below')
{ypos=parseInt(ypos)+15;xpos=parseInt(xpos)-180;}
else if(betapos=='top')
{ypos=parseInt(ypos)-50;xpos=parseInt(xpos)-150;}
else if(betapos=='left')
{ypos=parseInt(ypos)-50;xpos=parseInt(xpos)-300;}
else
{ypos=parseInt(ypos)-50;xpos=parseInt(xpos)-300;}
coming_soon(xpos,ypos)}
function getposcord(overlay,offsettype){var totaloffset=(offsettype=="left")?overlay.offsetLeft:overlay.offsetTop;var parentEl=overlay.offsetParent;while(parentEl!=null){totaloffset=(offsettype=="left")?totaloffset+parentEl.offsetLeft:totaloffset+parentEl.offsetTop;parentEl=parentEl.offsetParent;}
return totaloffset;}
function closecoming_soon(div,value1)
{if(value1==100)
{document.getElementById(div).style.filter='alpha(opacity=100)';document.getElementById(div).style.mozOpacity='1.0';document.getElementById(div).style.opacity='1.0';}
window.setTimeout("closecoming_soon('"+div+"','"+value1+"')",4000);}
function showcontactus(val,team_email)
{document.getElementById('contactus').innerHTML="";document.getElementById("contactus").style.display='block';if(document.getElementById('termandcondition')){document.getElementById('termandcondition').style.display='none';}
document.getElementById('coming_soon').style.display='none';document.getElementById('notdev').style.display='none';var params="contactto="+val;if(team_email!=undefined)
params+="&teamm_email="+team_email;var url=MP_ROOTPATH+'footer/contactus.php';if(window.XMLHttpRequest)
{contactreq=new XMLHttpRequest();}
else if(window.ActiveXObject)
{contactreq=new ActiveXObject("Microsoft.XMLHTTP");}
contactreq.open("POST",url,true);contactreq.setRequestHeader("Content-type","application/x-www-form-urlencoded;");contactreq.setRequestHeader("Content-length",params.length);contactreq.setRequestHeader("Connection","close");contactreq.onreadystatechange=contactus_callback;contactreq.send(params);}
function contactus_callback()
{if(contactreq.readyState==4)
{if(contactreq.status==200)
{response=contactreq.responseText;document.getElementById('contactus').innerHTML=response;}}}
function reversestatecontactus()
{if(document.getElementById("contactus")){document.getElementById("contactus").style.display='none';}}
function getcaptcha(){document.getElementById('txt_captcha').value='';document.getElementById('id_captcha').src=MP_ROOTPATH+'footer/imagetext2.php?id='+(Math.floor(Math.random()*1111));}
function contactFrmSubmit(msg){var done=1;var txt_emailid=trim(document.getElementById("txt_emailid").value);var email_Format=/^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-zA-Z]{2,6}(\.[a-zA-Z]{2})?$/i;if(txt_emailid.search(email_Format)==-1||txt_emailid=='')
{document.getElementById('txt_emailid').style.border='1px solid red';done=0;}
else
{document.getElementById('txt_emailid').style.border='';}
var txt_subject=trim(document.getElementById("txt_subject").value);txt_subject=txt_subject.replace(/&/g,"#***#");if(txt_subject=='')
{document.getElementById('txt_subject').style.border='1px solid red';document.getElementById('txt_subject').value='';done=0;}
else
{document.getElementById('txt_subject').style.border='';}
var txt_message=trim(document.getElementById("txt_message").value);txt_message=txt_message.replace(/&/g,"#***#");if(txt_message==''||txt_message==msg)
{document.getElementById('txt_message').style.border='1px solid red';document.getElementById('txt_message').value='';done=0;}
else
{document.getElementById('txt_message').style.border='1px solid #594F4D';}
var txt_captcha=document.getElementById("txt_captcha").value;var contactto=document.getElementById("contactto").value;var toemail=document.getElementById("teamm_email").value;var chk_mailcopy=document.getElementById("chk_mailcopy").value;if(done==1)
{var btnsubmit=document.getElementById('btnsubmit');btnsubmit.disabled=true;var params="contactto="+contactto+"&teamm_email="+toemail+"&txt_emailid="+txt_emailid+"&txt_subject="+txt_subject+"&txt_message="+txt_message+"&txt_captcha="+txt_captcha+"&chk_mailcopy="+chk_mailcopy+"&frmsubmit=1";var url=MP_ROOTPATH+'footer/contactus.php';if(window.XMLHttpRequest)
{contactreq=new XMLHttpRequest();}
else if(window.ActiveXObject)
{contactreq=new ActiveXObject("Microsoft.XMLHTTP");}
contactreq.open("POST",url,true);contactreq.setRequestHeader("Content-type","application/x-www-form-urlencoded;");contactreq.setRequestHeader("Content-length",params.length);contactreq.setRequestHeader("Connection","close");contactreq.onreadystatechange=contactusfrm_callback;contactreq.send(params);}}
function contactusfrm_callback()
{if(contactreq.readyState==4)
{if(contactreq.status==200)
{response=contactreq.responseText;document.getElementById('contactus').innerHTML="";document.getElementById('contactus').innerHTML=response;}
else
{alert("There was a problem retrieving the data:\n"+contactreq.statusText);}}}
function contactemailcheck()
{var txt_emailid=trim(document.getElementById("txt_emailid").value);var email_Format=/^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-zA-Z]{2,6}(\.[a-zA-Z]{2})?$/i;if(txt_emailid.search(email_Format)==-1||txt_emailid=='')
{document.getElementById('txt_emailid').style.border='1px solid red';}
else
{document.getElementById('txt_emailid').style.border='';}}
function subjectcheck()
{var txt_subject=trim(document.getElementById("txt_subject").value);if(txt_subject=='')
{document.getElementById('txt_subject').style.border='1px solid red';document.getElementById('txt_subject').value='';}
else
{document.getElementById('txt_subject').style.border='';}}
function messagecheck(msg)
{var txt_message=trim(document.getElementById("txt_message").value);if(txt_message==''||txt_message==msg)
{document.getElementById('txt_message').style.border='1px solid red';document.getElementById('txt_message').value='';}
else
{document.getElementById('txt_message').style.border='1px solid #594F4D';}}
function contactfrm_enter(e,msg)
{if(window.event)
key=window.event.keyCode;else
key=e.which;if(key==13)
{contactFrmSubmit(msg);}}
function closecontactdialog(){window.setTimeout("reversestatecontactus();hide_overlay();",1500);}
function post_to_fb(obj){if(obj.checked){obj.value=1;}else{obj.value=0;}}
function implode(glue,pieces){var i='',retVal='',tGlue='';if(arguments.length===1){pieces=glue;glue='';}
if(typeof(pieces)==='object'){if(pieces instanceof Array){return pieces.join(glue);}
else{for(i in pieces){retVal+=tGlue+pieces[i];tGlue=glue;}
return retVal;}}
else{return pieces;}}
function getProfileToPost(){var pagesArr=new Array();var i=0;$("input[name][name^='chk_fb_page']:checked").each(function(){pagesArr[i]=$(this).val();++i;});var pages=implode(",",pagesArr);$("#hid_fb_profile_pages").val(pages);document.getElementById("fb_pagepopup").style.display="none";}
function save_voting_fbpermission(obj)
{var url=MP_ROOTPATH+'settings/set_user_settings.php';$.post(url,{action:"INSERT",notification_type:"9",site_type:"1"},function(data){if(data=='success')
{post_to_fb(obj);obj.onclick=function anonymous(){post_to_fb(obj);};}});}
function show_no_upload2(tis)
{tish=parent.document.getElementById('id_footer3');var curobj=tish;var xpos=getposcord(curobj,"left")+((typeof opt_position!="undefined"&&opt_position.indexOf("right")!=-1)?-(subobj.offsetWidth-curobj.offsetWidth):0)
var ypos=getposcord(curobj,"top")+((typeof opt_position!="undefined"&&opt_position.indexOf("bottom")!=-1)?curobj.offsetHeight:0)
if(tis=='agenda')
{xpos=parseInt(xpos)+230;ypos=parseInt(ypos)-720;}
if(tis=='store')
{xpos=parseInt(xpos)+230;ypos=parseInt(ypos)-720;}
if(tis=='webtv')
{xpos=parseInt(xpos)+130;ypos=parseInt(ypos)-320;}
no_upload2(xpos,ypos);}
function no_upload2(x,y)
{clearTimeout(beta_msg_timer);parent.document.getElementById('termandcondition').style.display='none';parent.document.getElementById('coming_soon').innerHTML=parent.document.getElementById('noupload').innerHTML;parent.document.getElementById('coming_soon').style.width="300px";parent.document.getElementById('coming_soon').style.left=x+"px";parent.document.getElementById('coming_soon').style.top=y+"px";parent.document.getElementById('coming_soon').style.height="auto";parent.document.getElementById('coming_soon').style.display="block";beta_msg_timer=window.setTimeout("parent.document.getElementById('coming_soon').style.display='none';",4000);}
function show_no_upload(tis)
{tish=document.getElementById('id_footer3');var curobj=tish;var xpos=getposcord(curobj,"left")+((typeof opt_position!="undefined"&&opt_position.indexOf("right")!=-1)?-(subobj.offsetWidth-curobj.offsetWidth):0)
var ypos=getposcord(curobj,"top")+((typeof opt_position!="undefined"&&opt_position.indexOf("bottom")!=-1)?curobj.offsetHeight:0)
var url=location.href;if(tis=='video')
{if((url.search(/all/)>1))
{xpos=parseInt(xpos)+290;ypos=parseInt(ypos)-1046;}
else
{xpos=parseInt(xpos)+290;ypos=parseInt(ypos)-460;}}
else
{if((url.search(/all/)>1))
{xpos=500;ypos=200;}
else
{xpos=parseInt(xpos)+150;ypos=parseInt(ypos)-660;}}
no_upload(xpos,ypos);}
function no_upload(x,y)
{clearTimeout(beta_msg_timer);document.getElementById('termandcondition').style.display='none';document.getElementById('coming_soon').innerHTML=document.getElementById('noupload').innerHTML;document.getElementById('coming_soon').style.width="300px";document.getElementById('coming_soon').style.left=x+"px";document.getElementById('coming_soon').style.top=y+"px";document.getElementById('coming_soon').style.height="auto";document.getElementById('coming_soon').style.display="block";beta_msg_timer=window.setTimeout("parent.document.getElementById('coming_soon').style.display='none';",4000);};(function($){var style=document.createElement('div').style;var moz=style['MozBorderRadius']!==undefined;var webkit=style['WebkitBorderRadius']!==undefined;var radius=style['borderRadius']!==undefined||style['BorderRadius']!==undefined;var mode=document.documentMode||0;var noBottomFold=$.browser.msie&&(($.browser.version<8&&!mode)||mode<8);$.support=$.support||{};$.support.borderRadius=moz||webkit||radius;var expr=$.browser.msie&&(function(){var div=document.createElement('div');try{div.style.setExpression('width','0+0');div.style.removeExpression('width');}
catch(e){return false;}
return true;})();function sz(el,p){return parseInt($.css(el,p))||0;};function hex2(s){var s=parseInt(s).toString(16);return(s.length<2)?'0'+s:s;};function gpc(node){while(node){var v=$.css(node,'backgroundColor');if(v&&v!='transparent'&&v!='rgba(0, 0, 0, 0)'){if(v.indexOf('rgb')>=0){var rgb=v.match(/\d+/g);return'#'+hex2(rgb[0])+hex2(rgb[1])+hex2(rgb[2]);}
return v;}
if(node.nodeName.toLowerCase()=='html')
break;node=node.parentNode;}
return'#ffffff';};function getWidth(fx,i,width){switch(fx){case'round':return Math.round(width*(1-Math.cos(Math.asin(i/width))));case'cool':return Math.round(width*(1+Math.cos(Math.asin(i/width))));case'sharp':return Math.round(width*(1-Math.cos(Math.acos(i/width))));case'bite':return Math.round(width*(Math.cos(Math.asin((width-i-1)/width))));case'slide':return Math.round(width*(Math.atan2(i,width/i)));case'jut':return Math.round(width*(Math.atan2(width,(width-i-1))));case'curl':return Math.round(width*(Math.atan(i)));case'tear':return Math.round(width*(Math.cos(i)));case'wicked':return Math.round(width*(Math.tan(i)));case'long':return Math.round(width*(Math.sqrt(i)));case'sculpt':return Math.round(width*(Math.log((width-i-1),width)));case'dogfold':case'dog':return(i&1)?(i+1):width;case'dog2':return(i&2)?(i+1):width;case'dog3':return(i&3)?(i+1):width;case'fray':return(i%2)*width;case'notch':return width;case'bevelfold':case'bevel':return i+1;}};$.fn.corner=function(options){if(this.length==0){if(!$.isReady&&this.selector){var s=this.selector,c=this.context;$(function(){$(s,c).corner(options);});}
return this;}
return this.each(function(index){var $this=$(this);var o=[$this.attr($.fn.corner.defaults.metaAttr)||'',options||''].join(' ').toLowerCase();var keep=/keep/.test(o);var cc=((o.match(/cc:(#[0-9a-f]+)/)||[])[1]);var sc=((o.match(/sc:(#[0-9a-f]+)/)||[])[1]);var width=parseInt((o.match(/(\d+)px/)||[])[1])||10;var re=/round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog/;var fx=((o.match(re)||['round'])[0]);var fold=/dogfold|bevelfold/.test(o);var edges={T:0,B:1};var opts={TL:/top|tl|left/.test(o),TR:/top|tr|right/.test(o),BL:/bottom|bl|left/.test(o),BR:/bottom|br|right/.test(o)};if(!opts.TL&&!opts.TR&&!opts.BL&&!opts.BR)
opts={TL:1,TR:1,BL:1,BR:1};if($.fn.corner.defaults.useNative&&fx=='round'&&(radius||moz||webkit)&&!cc&&!sc){if(opts.TL)
$this.css(radius?'border-top-left-radius':moz?'-moz-border-radius-topleft':'-webkit-border-top-left-radius',width+'px');if(opts.TR)
$this.css(radius?'border-top-right-radius':moz?'-moz-border-radius-topright':'-webkit-border-top-right-radius',width+'px');if(opts.BL)
$this.css(radius?'border-bottom-left-radius':moz?'-moz-border-radius-bottomleft':'-webkit-border-bottom-left-radius',width+'px');if(opts.BR)
$this.css(radius?'border-bottom-right-radius':moz?'-moz-border-radius-bottomright':'-webkit-border-bottom-right-radius',width+'px');return;}
var strip=document.createElement('div');$(strip).css({overflow:'hidden',height:'1px',minHeight:'1px',fontSize:'1px',backgroundColor:sc||'transparent',borderStyle:'solid'});var pad={T:parseInt($.css(this,'paddingTop'))||0,R:parseInt($.css(this,'paddingRight'))||0,B:parseInt($.css(this,'paddingBottom'))||0,L:parseInt($.css(this,'paddingLeft'))||0};if(typeof this.style.zoom!=undefined)this.style.zoom=1;if(!keep)this.style.border='none';strip.style.borderColor=cc||gpc(this.parentNode);var cssHeight=$(this).outerHeight();for(var j in edges){var bot=edges[j];if((bot&&(opts.BL||opts.BR))||(!bot&&(opts.TL||opts.TR))){strip.style.borderStyle='none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none');var d=document.createElement('div');$(d).addClass('jquery-corner');var ds=d.style;bot?this.appendChild(d):this.insertBefore(d,this.firstChild);if(bot&&cssHeight!='auto'){if($.css(this,'position')=='static')
this.style.position='relative';ds.position='absolute';ds.bottom=ds.left=ds.padding=ds.margin='0';if(expr)
ds.setExpression('width','this.parentNode.offsetWidth');else
ds.width='100%';}
else if(!bot&&$.browser.msie){if($.css(this,'position')=='static')
this.style.position='relative';ds.position='absolute';ds.top=ds.left=ds.right=ds.padding=ds.margin='0';if(expr){var bw=sz(this,'borderLeftWidth')+sz(this,'borderRightWidth');ds.setExpression('width','this.parentNode.offsetWidth - '+bw+'+ "px"');}
else
ds.width='100%';}
else{ds.position='relative';ds.margin=!bot?'-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px':(pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px';}
for(var i=0;i<width;i++){var w=Math.max(0,getWidth(fx,i,width));var e=strip.cloneNode(false);e.style.borderWidth='0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px';bot?d.appendChild(e):d.insertBefore(e,d.firstChild);}
if(fold&&$.support.boxModel){if(bot&&noBottomFold)continue;for(var c in opts){if(!opts[c])continue;if(bot&&(c=='TL'||c=='TR'))continue;if(!bot&&(c=='BL'||c=='BR'))continue;var common={position:'absolute',border:'none',margin:0,padding:0,overflow:'hidden',backgroundColor:strip.style.borderColor};var $horz=$('<div/>').css(common).css({width:width+'px',height:'1px'});switch(c){case'TL':$horz.css({bottom:0,left:0});break;case'TR':$horz.css({bottom:0,right:0});break;case'BL':$horz.css({top:0,left:0});break;case'BR':$horz.css({top:0,right:0});break;}
d.appendChild($horz[0]);var $vert=$('<div/>').css(common).css({top:0,bottom:0,width:'1px',height:width+'px'});switch(c){case'TL':$vert.css({left:width});break;case'TR':$vert.css({right:width});break;case'BL':$vert.css({left:width});break;case'BR':$vert.css({right:width});break;}
d.appendChild($vert[0]);}}}}});};$.fn.uncorner=function(){if(radius||moz||webkit)
this.css(radius?'border-radius':moz?'-moz-border-radius':'-webkit-border-radius',0);$('div.jquery-corner',this).remove();return this;};$.fn.corner.defaults={useNative:true,metaAttr:'data-corner'};})(jQuery);function urlencode(str){var histogram={},unicodeStr='',hexEscStr='';var ret=(str+'').toString();var replacer=function(search,replace,str){var tmp_arr=[];tmp_arr=str.split(search);return tmp_arr.join(replace);};histogram["'"]='%27';histogram['(']='%28';histogram[')']='%29';histogram['*']='%2A';histogram['~']='%7E';histogram['!']='%21';histogram['%20']='+';histogram['\u00DC']='%DC';histogram['\u00FC']='%FC';histogram['\u00C4']='%D4';histogram['\u00E4']='%E4';histogram['\u00D6']='%D6';histogram['\u00F6']='%F6';histogram['\u00DF']='%DF';histogram['\u20AC']='%80';histogram['\u0081']='%81';histogram['\u201A']='%82';histogram['\u0192']='%83';histogram['\u201E']='%84';histogram['\u2026']='%85';histogram['\u2020']='%86';histogram['\u2021']='%87';histogram['\u02C6']='%88';histogram['\u2030']='%89';histogram['\u0160']='%8A';histogram['\u2039']='%8B';histogram['\u0152']='%8C';histogram['\u008D']='%8D';histogram['\u017D']='%8E';histogram['\u008F']='%8F';histogram['\u0090']='%90';histogram['\u2018']='%91';histogram['\u2019']='%92';histogram['\u201C']='%93';histogram['\u201D']='%94';histogram['\u2022']='%95';histogram['\u2013']='%96';histogram['\u2014']='%97';histogram['\u02DC']='%98';histogram['\u2122']='%99';histogram['\u0161']='%9A';histogram['\u203A']='%9B';histogram['\u0153']='%9C';histogram['\u009D']='%9D';histogram['\u017E']='%9E';histogram['\u0178']='%9F';ret=encodeURIComponent(ret);for(unicodeStr in histogram){hexEscStr=histogram[unicodeStr];ret=replacer(unicodeStr,hexEscStr,ret);}
return ret.replace(/(\%([a-z0-9]{2}))/g,function(full,m1,m2){return"%"+m2.toUpperCase();});}
function urldecode(str){var histogram={},ret=str.toString(),unicodeStr='',hexEscStr='';var replacer=function(search,replace,str){var tmp_arr=[];tmp_arr=str.split(search);return tmp_arr.join(replace);};histogram["'"]='%27';histogram['(']='%28';histogram[')']='%29';histogram['*']='%2A';histogram['~']='%7E';histogram['!']='%21';histogram['%20']='+';histogram['\u00DC']='%DC';histogram['\u00FC']='%FC';histogram['\u00C4']='%D4';histogram['\u00E4']='%E4';histogram['\u00D6']='%D6';histogram['\u00F6']='%F6';histogram['\u00DF']='%DF';histogram['\u20AC']='%80';histogram['\u0081']='%81';histogram['\u201A']='%82';histogram['\u0192']='%83';histogram['\u201E']='%84';histogram['\u2026']='%85';histogram['\u2020']='%86';histogram['\u2021']='%87';histogram['\u02C6']='%88';histogram['\u2030']='%89';histogram['\u0160']='%8A';histogram['\u2039']='%8B';histogram['\u0152']='%8C';histogram['\u008D']='%8D';histogram['\u017D']='%8E';histogram['\u008F']='%8F';histogram['\u0090']='%90';histogram['\u2018']='%91';histogram['\u2019']='%92';histogram['\u201C']='%93';histogram['\u201D']='%94';histogram['\u2022']='%95';histogram['\u2013']='%96';histogram['\u2014']='%97';histogram['\u02DC']='%98';histogram['\u2122']='%99';histogram['\u0161']='%9A';histogram['\u203A']='%9B';histogram['\u0153']='%9C';histogram['\u009D']='%9D';histogram['\u017E']='%9E';histogram['\u0178']='%9F';for(unicodeStr in histogram){hexEscStr=histogram[unicodeStr];ret=replacer(hexEscStr,unicodeStr,ret);}
ret=decodeURIComponent(ret);return ret;}
function cleartext()
{document.getElementById('search_text').value='';}
function stripslashes(str){str=str.replace(/\\'/g,'\'');str=str.replace(/\\"/g,'"');str=str.replace(/\\\\/g,'\\');str=str.replace(/\\0/g,'\0');return str;}
function trim(str)
{s=str.replace(/^(\s)*/,'');s=s.replace(/(\s)*$/,'');return s;}
function unselectnav()
{var selected=document.getElementById('selectednav').value;if(selected!='')
{if(document.getElementById(selected))
document.getElementById(selected).className='';}
if(document.getElementById('lan_latestvid_selected'))
document.getElementById('lan_latestvid_selected').value='';}
function get_videos_memberpages(radio_id,module_value,number_videos,number_pages)
{if(document.getElementById(radio_id).value=='webtv')
{if(number_videos>0)
{document.getElementById('webtv_search_div').style.display='block';if(number_pages>0)
{document.getElementById('memberpage_search_div').style.display='none';}}
if(number_videos==0)
{document.getElementById('memberpage_search_div').style.display='block';document.getElementById('search_radio_memberpage').checked=true;document.getElementById('search_radio_webtv').checked=false;}}
if(document.getElementById(radio_id).value=='memberpage')
{if(number_pages>0)
{document.getElementById('memberpage_search_div').style.display='block';if(number_videos>0)
{document.getElementById('webtv_search_div').style.display='none';}}
if(number_pages==0)
{document.getElementById('webtv_search_div').style.display='block';document.getElementById('search_radio_memberpage').checked=false;document.getElementById('search_radio_webtv').checked=true;}}
document.getElementById('search_text').focus();}
function checkcallornot(evt,module,searchpageparam)
{var div_name_terms='termandcondition';var div_name_contact='';var div_name_login='';if(module=='webtv')
{div_name_contact='contactus';div_name_login='login';}
else if(module=='memberpage')
{div_name_contact='contact_us';div_name_login='login_div';}
if(document.getElementById(div_name_terms))
{if(document.getElementById(div_name_terms).style.display=='block')
{document.getElementById(div_name_terms).style.display='none';}}
if(document.getElementById(div_name_contact))
{if(document.getElementById(div_name_contact).style.display=='block')
{document.getElementById(div_name_contact).style.display='none';}}
if(document.getElementById(div_name_login))
{if(document.getElementById(div_name_login).style.display=='block')
{document.getElementById(div_name_login).style.display='none';}}
if(!evt)evt=event;var a=evt.keyCode;var vale=document.getElementById('search_text').value;vale=vale.replace("'",'~~singlecoat~~');if(a!=40&&a!=38&&a!=13&&vale.length>1)
{if(trim(vale)!='')
{document.getElementById('closesearch').style.display='block';document.getElementById('header_searchBoxDrawer').style.backgroundImage='url('+WEBTV_AJAXPATH+'images/search_box_shadow.png)';scrollLocation=0;}
else
{document.getElementById('closesearch').style.display='block';document.getElementById("display_xml").style.display='none';document.getElementById("search_close_link").style.display='none';scrollLocation=0;}
document.getElementById('display_xml').innerHTML='';vale=vale+"***++***"+module+"***++***"+searchpageparam;window.setTimeout("showxml('"+vale+"')",400);}
if(a==13)
{if(document.getElementById('sitemap').value==0)
{var m=document.getElementById('playedvid1').value;document.getElementById('closesearch').style.display='block';playvideo(m);}
else
{document.blanksearchform.submit();}}
if(vale.length<2)
{document.getElementById('display_xml').style.display='none';document.getElementById('closesearch').style.display='block';document.getElementById('search_close_link').style.display='none';}}
function playvideo(m)
{document.getElementById('whichvid').value=1;var ii=document.getElementById('seachfocusi').value;if(ii!=0)
{document.getElementById('playedvid').value=m;var seachfocusii=document.getElementById('seachfocusi').value;var vid_in=document.getElementById('searchtop'+seachfocusii).value;document.getElementById('mainvideo').value=vid_in;document.getElementById('display_xml').style.display='none';document.getElementById('search_close_link').style.display='none';document.getElementById('search_text').value='';document.getElementById('closesearch').style.display='block';document.getElementById('seachfocusi').value=0;}}
function getaccent(data,type)
{var accent="ÀÁÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ";var len=accent.length;for(var i=0;i<len;i++)
{var char="[*A"+i+"*]";data=data.replace(char,accent[i]);}
if(type=='topic')
{topicname=data;if(topicname.length>13)
{topicname=topicname.substring(0,10)+"...";}
data=topicname;}
if(type=='middisp')
{if(data.length>17)
{data=data.substring(0,15)+"...";}}
return data;}
function doitexport(vid_in)
{if(document.getElementById('exportyesorno').value==1)
{document.getElementById('exportimg').style.display='block'
changeexportdiv(vid_in);}}
function changeexportdiv(vid_in)
{window.setTimeout("xmlhttpinfoexp('"+WEBTV_AJAXPATH+"export.php','"+vid_in+"')",1500);}
function showxml(value)
{var get_val=value.replace("~~singlecoat~~","'");value=get_val;if(trim(document.getElementById('search_text').value)!='')
javascript:xmlhttpvdftsearch(MP_ROOTPATH+'search/ajax_search.php',value);}
function actb_checkkey(evt,modul_val,num_search_video,num_search_pages)
{for(var kk=0;kk<=num_search_video;kk++)
{if(document.getElementById('label'+kk))
document.getElementById('label'+kk).style.backgroundColor="";}
for(var rrr=0;rrr<=num_search_pages;rrr++)
{if(document.getElementById('memberpage_label'+rrr))
document.getElementById('memberpage_label'+rrr).style.backgroundColor="";}
if(!evt)evt=event;a=evt.keyCode;switch(a)
{case 38:go_uppword(modul_val);return false;break;case 40:go_down(modul_val);return false;break;case 13:focusedplayeddiv();return false;case 9:return false;break;default:break;}}
function focusedplayeddiv()
{var ii=document.getElementById('seachfocusi').value;if(ii!=0)
{document.getElementById('label'+ii).style.backgroundColor="#0DA1C7";}
if(trim(document.getElementById('search_text').value)!=''&&ii==0)
{document.getElementById('closesearch').style.display='block';document.getElementById("display_xml").style.display='none';document.getElementById('search_close_link').style.display='none';scrollLocation=0;unselectnav();document.getElementById('closeafter').value='0';xmlhttpvdsentsearch(WEBTV_AJAXPATH+'videolist.php','fromsearchresult','icon');}}
scrollLocation=0;scrollLocation_memberpage=0;function go_down(bb)
{document.getElementById('closeafter').value='0';var nunmberofsearch=document.getElementById('numbersearchres').value
if(document.getElementById('numbersearchres_memberpages'))
{var nunmberofsearch_memberpages=document.getElementById('numbersearchres_memberpages').value}
else
{var nunmberofsearch_memberpages=document.getElementById('numbersearchres').value}
var next_scrollLocation=parseInt(scrollLocation)+1;if(next_scrollLocation==parseInt(nunmberofsearch)+1)
{next_scrollLocation=1;}
else
{next_scrollLocation=next_scrollLocation;}
var next_scrollLocation_memberpage=parseInt(scrollLocation_memberpage)+1;if(next_scrollLocation_memberpage==parseInt(nunmberofsearch_memberpages)+1)
{next_scrollLocation_memberpage=1;}
else
{next_scrollLocation_memberpage=next_scrollLocation_memberpage;}
if(document.getElementById('label'+next_scrollLocation)&&document.getElementById('webtv_search_div').style.display=='block')
{document.getElementById('label'+next_scrollLocation).style.backgroundColor="#0DA1C7";;document.getElementById('seachfocusi').value=next_scrollLocation;document.getElementById('playedvid1').value=document.getElementById('videoname'+next_scrollLocation).value;document.getElementById('videoimage').value=document.getElementById('jwimg'+next_scrollLocation).value;if(document.getElementById('sitemap').value==1)
{document.blanksearchform.action=document.getElementById('sitemapurl'+next_scrollLocation).value;}
scrollLocation=next_scrollLocation;}
if(document.getElementById('memberpage_label'+next_scrollLocation_memberpage)&&document.getElementById('memberpage_search_div').style.display=='block')
{document.getElementById('memberpage_label'+next_scrollLocation_memberpage).style.backgroundColor="#0DA1C7";;if(document.getElementById('sitemap').value==1)
{document.blanksearchform.action=document.getElementById('sitemapurl'+next_scrollLocation_memberpage).value;}
scrollLocation_memberpage=next_scrollLocation_memberpage;}
return false;}
function go_uppword(val_modul)
{document.getElementById('closeafter').value='0';var nunmberofsearch=document.getElementById('numbersearchres').value
if(document.getElementById('numbersearchres_memberpages'))
{var nunmberofsearch_memberpages=document.getElementById('numbersearchres_memberpages').value}
else
{var nunmberofsearch_memberpages=document.getElementById('numbersearchres').value}
var next_scrollLocation=parseInt(scrollLocation)-1;if(next_scrollLocation==0)
next_scrollLocation=parseInt(nunmberofsearch);var next_scrollLocation_memberpage=parseInt(scrollLocation_memberpage)-1;if(next_scrollLocation_memberpage==0)
next_scrollLocation_memberpage=parseInt(nunmberofsearch_memberpages);if(document.getElementById('label'+next_scrollLocation))
{document.getElementById('label'+next_scrollLocation).style.backgroundColor="#0DA1C7";;document.getElementById('seachfocusi').value=next_scrollLocation;document.getElementById('playedvid1').value=document.getElementById('videoname'+next_scrollLocation).value;document.getElementById('videoimage').value=document.getElementById('jwimg'+next_scrollLocation).value;if(document.getElementById('sitemap').value==1)
{document.blanksearchform.action=document.getElementById('sitemapurl'+next_scrollLocation).value;}}
if(document.getElementById('memberpage_label'+next_scrollLocation_memberpage))
{document.getElementById('memberpage_label'+next_scrollLocation_memberpage).style.backgroundColor="#0DA1C7";;}
scrollLocation=next_scrollLocation;scrollLocation_memberpage=next_scrollLocation_memberpage;return false;}
function xmlhttpvdftsearch(strURL,a){if(trim(a)!='')
document.getElementById("display_xml").style.display='block';document.getElementById("search_close_link").style.display='block';var xmlHttpReq4=false;var self=this;if(window.XMLHttpRequest){self.xmlHttpReq4=new XMLHttpRequest();}
else if(window.ActiveXObject){self.xmlHttpReq4=new ActiveXObject("Microsoft.XMLHTTP");}
self.xmlHttpReq4.open('POST',strURL,true);self.xmlHttpReq4.setRequestHeader('Content-Type','application/x-www-form-urlencoded');self.xmlHttpReq4.onreadystatechange=function(){if(self.xmlHttpReq4.readyState==4){updatenextvdftsearch(self.xmlHttpReq4.responseText);}}
self.xmlHttpReq4.send(getquerynextvdftsearch(a));}
function getquerynextvdftsearch(a)
{var sitemap="";if(document.getElementById("sitemap"))
sitemap=document.getElementById("sitemap").value;var get_string=a.split('***++***');a=get_string[0];var module_name=get_string[1];var searchparamter=get_string[2];if(document.getElementById("error_page"))
{var err_page_val=document.getElementById("error_page").value;}
else
{var err_page_val=0;}
qstr='webtvsearch='+escape(a)+"****||*****"+escape(sitemap)+"****||*****"+module_name+"****||*****"+parseInt(searchparamter)+"****||*****"+err_page_val;return qstr;}
function updatenextvdftsearch(str5){document.getElementById("display_xml").innerHTML=str5;if(document.getElementById('mp_footerconatner'))
{document.getElementById('mp_footerconatner').style.zIndex="-1000";}}
function closeresultset()
{window.setTimeout("closeresultset1('40')",40);}
function closeresultset1(x)
{if(document.getElementById('closeafter').value=='1'&&parseInt(x)>4550)
{document.getElementById('display_xml').style.display='none';document.getElementById('search_close_link').style.display='none';document.getElementById('search_close_link').style.display='none';document.getElementById('closesearch').style.display='block';document.getElementById('search_text').value=document.getElementById('search_label').value;}
if(document.getElementById('closeafter').value=='1'&&parseInt(x)<4550)
{var newx=parseInt(x)+40;window.setTimeout("closeresultset1('"+newx+"')",40);document.getElementById('closeafter1').value=newx;}
if(document.getElementById('closeafter').value=='0')
{window.setTimeout("closeresultset1('1')",40);document.getElementById('closeafter1').value=newx;}}
function closesearchdiv()
{document.getElementById('display_xml').style.display='none';document.getElementById('closesearch').style.display='block';document.getElementById('search_text').value='';}
function underline(ids,spid)
{if(document.getElementById(ids).checked==true)
{spid.style.textDecoration='underline';}}
function removeunderline(rids,rspid)
{if(document.getElementById(rids).checked==true)
{rspid.style.textDecoration='none';}}
function opennewwindow(rpath,modle,searchStep)
{var geturl=gotomp(rpath,modle,searchStep);window.location=geturl;}
function gotomp(pth,mdl,searchStep)
{var get_value=document.getElementById('search_text').value;get_value=urlencode(get_value);var redirect='';if(mdl=='mp')
{redirect=pth+'memberpage_search.php?sc='+get_value;}
else if(mdl=='w')
{redirect=pth+'?scwebtv='+get_value+"&ss="+searchStep;}
return redirect;}
function increaseindex()
{if(document.getElementById('mp_footerconatner'))
{document.getElementById('mp_footerconatner').style.zIndex="2";}}
function closesearchdivblur()
{if(document.getElementById('hid_btn').value!=1)
{document.getElementById('hid_btn').value=0;closesearchdiv();}}
function return_video_mp()
{var search_text_val=document.getElementById('search_text').value;var params="search_text_videoids="+search_text_val;var url=MP_ROOTPATH+'search/ajax_search.php';if(window.XMLHttpRequest)
{contactreq=new XMLHttpRequest();}
else if(window.ActiveXObject)
{contactreq=new ActiveXObject("Microsoft.XMLHTTP");}
contactreq.open("POST",url,true);contactreq.setRequestHeader("Content-type","application/x-www-form-urlencoded;");contactreq.setRequestHeader("Content-length",params.length);contactreq.setRequestHeader("Connection","close");contactreq.onreadystatechange=callback_return_video_mp;contactreq.send(params);}
function callback_return_video_mp()
{if(contactreq.readyState==4)
{if(contactreq.status==200)
{response=contactreq.responseText;var response1=response+'~~'+document.getElementById('owner_page_id').value;populate_video_mp(response1);}
else
{alert("There was a problem retrieving the data:\n"+contactreq.statusText);}}}
function populate_video_mp(ids)
{var search_text_ids=ids;var split_ids_tilda=search_text_ids.split('~~');var each_split_ids=split_ids_tilda[0];var mp_mainid=split_ids_tilda[2];var params="search_text_videoids="+each_split_ids+"&mpid="+mp_mainid;var url=WEBTV_ROOTPATH+'members/videossection.php';if(window.XMLHttpRequest)
{video_mp_req=new XMLHttpRequest();}
else if(window.ActiveXObject)
{video_mp_req=new ActiveXObject("Microsoft.XMLHTTP");}
video_mp_req.open("POST",url,true);video_mp_req.setRequestHeader("Content-type","application/x-www-form-urlencoded;");video_mp_req.setRequestHeader("Content-length",params.length);video_mp_req.setRequestHeader("Connection","close");video_mp_req.onreadystatechange=callback_populate_video_mp;video_mp_req.send(params);}
function callback_populate_video_mp()
{if(video_mp_req.readyState==4)
{if(video_mp_req.status==200)
{video_mp_response=video_mp_req.responseText;document.getElementById('videosection').innerHTML=video_mp_response;document.getElementById('closesearch').style.display='block';document.getElementById("display_xml").style.display='none';document.getElementById('search_close_link').style.display='none';document.getElementById("searchtext_innertd").innerHTML=document.getElementById("search_text").value;document.getElementById("search_text").value='';document.getElementById("showplaylist_table").style.display='none';document.getElementById("showsearch_table").style.display='block';}
else
{alert("There was a problem retrieving the data:\n"+contactreq.statusText);}}}
function clearSearchField(obj,lan){if(obj.value==lan){obj.value="";}}
function FillSearchField(obj,lan){if(obj.value==""){obj.value=lan;}}
function xmlhttpvdidPlaylist(strURL,a,b,c,d,e,f,MP_ROOTPATH,divid){var xmlHttpReqPlaylist=false;var self=this;if(window.XMLHttpRequest){self.xmlHttpReqPlaylist=new XMLHttpRequest();}
else if(window.ActiveXObject){self.xmlHttpReqPlaylist=new ActiveXObject("Microsoft.XMLHTTP");}
self.xmlHttpReqPlaylist.open('POST',strURL,true);self.xmlHttpReqPlaylist.setRequestHeader('Content-Type','application/x-www-form-urlencoded');self.xmlHttpReqPlaylist.onreadystatechange=function(){if(self.xmlHttpReqPlaylist.readyState==4){generateplaylist(self.xmlHttpReqPlaylist.responseText,divid);}}
self.xmlHttpReqPlaylist.send(getquerynextvdidPlaylist(a,b,c,d,e,MP_ROOTPATH));}
function getquerynextvdidPlaylist(a,b,c,d,e,MP_ROOTPATH)
{if(document.getElementById('thumbPL'))
var thumbBlock=document.getElementById('thumbPL').style.display;else
var thumbBlock='block';if(document.getElementById('listPL'))
var listBlock=document.getElementById('listPL').style.display;else
var listBlock='none';if(a=='showplaylist')
{qstr='embedplaylist='+escape(MP_ROOTPATH)+"||"+escape(b)+"||"+escape(thumbBlock)+"||"+escape(listBlock);}
else if(a=='addtoplaylist')
{var playlist=document.getElementById('playlistids').value;if(playlist!='')
b=playlist+"*"+b;qstr='embedplaylist='+escape(MP_ROOTPATH)+"||"+escape(b)+"||"+escape(thumbBlock)+"||"+escape(listBlock);}
else
{qstr='Playlsit='+escape(b)+"||||*****||||"+escape(c)+"||||*****||||"+escape(d)+"||||*****||||"+escape(e)+"||||*****||||"+escape(MP_ROOTPATH);}
return qstr;}
function generateplaylist(str,divid)
{document.getElementById(divid).innerHTML=str;if(document.getElementById('searchboxLoader')){document.getElementById('searchboxLoader').style.display='none';}}
function minimizePlaylist(MP_ROOTPATH)
{if(document.getElementById('playlistData').style.display=='none')
{document.getElementById('playlistData').style.display='block';if(document.getElementById('playlist_sendsaveSection')){document.getElementById('playlist_sendsaveSection').style.display='block';}
document.getElementById('PlaylistFooter').style.display='block';document.getElementById('plMaxMin').src=MP_ROOTPATH+"playlist/images/minus.gif";}
else
{document.getElementById('playlistData').style.display='none';if(document.getElementById('playlist_sendsaveSection')){document.getElementById('playlist_sendsaveSection').style.display='none';}
document.getElementById('PlaylistFooter').style.display='none';document.getElementById('plMaxMin').src=MP_ROOTPATH+'playlist/images/plus.gif';}}
function reactPlaylist(MP_ROOTPATH)
{if(document.getElementById('thumbPL').style.display=='block')
{if(document.getElementById('react').value==1)
{if(document.getElementById('react_Thumb_view_1').style.backgroundImage=="url("+MP_ROOTPATH+"playlist/images/empty_thumbnail_background.gif)")
{document.getElementById('react_Thumb_view_1').style.backgroundImage="url("+MP_ROOTPATH+"playlist/images/thumbnail_moodio_background_active.gif)";}
else
{document.getElementById('react_Thumb_view_1').style.backgroundImage="url("+MP_ROOTPATH+"playlist/images/empty_thumbnail_background.gif)";}
window.setTimeout("reactPlaylist('"+MP_ROOTPATH+"')",105);}
else
{document.getElementById('react_Thumb_view_1').style.backgroundImage="url("+MP_ROOTPATH+"playlist/images/empty_thumbnail_background.gif)";}}
else
{if(document.getElementById('react').value==1)
{if(document.getElementById('react_List_view_1').style.backgroundImage=="url("+MP_ROOTPATH+"playlist/images/mini_thumbnail_moodio_background.gif)")
{document.getElementById('react_List_view_1').style.backgroundImage="url("+MP_ROOTPATH+"playlist/images/mini_thumbnail_moodio_background_active.gif)";}
else
{document.getElementById('react_List_view_1').style.backgroundImage="url("+MP_ROOTPATH+"playlist/images/mini_thumbnail_moodio_background.gif)";}
window.setTimeout("reactPlaylist('"+MP_ROOTPATH+"')",105);}
else
{document.getElementById('react_List_view_1').style.backgroundImage="url("+MP_ROOTPATH+"playlist/images/mini_thumbnail_moodio_background.gif)";}}}
function removePlaylist(id)
{var playlistItems='';var ExistPlaylist=document.getElementById('playlistids').value;var ExistPlaylist1=ExistPlaylist.split('*');for(var i=0;i<ExistPlaylist1.length;i++)
{if(playlistItems!=''&&ExistPlaylist1[i]!=id)
{playlistItems=playlistItems+"*"+ExistPlaylist1[i];}
if(playlistItems==''&&ExistPlaylist1[i]!=id)
{playlistItems=ExistPlaylist1[i];}}
playlist=playlistItems;xmlhttpvdidPlaylist(MP_ROOTPATH+'playlist/playlist.php','showplaylist',playlistItems,'','','','',MP_ROOTPATH,'forPlaylist');}
function clearPlaylist()
{playlist='';xmlhttpvdidPlaylist(MP_ROOTPATH+'playlist/playlist.php','showplaylist',playlist,'','','','',MP_ROOTPATH,'forPlaylist');}
function checkPlaylistEmailBox(defaultValue){var email_Format=/^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-zA-Z]{2,6}(\.[a-zA-Z]{2})?$/i;var emailAdd=RTrim(LTrim(document.getElementById('playlist_email').value));if(emailAdd==''||emailAdd.search(email_Format)==-1){document.getElementById('playlist_email').style.border='1px solid red';}else{send_playlist_email();}}
function checkShareVideoEmailBox(defaultValue){var email_Format=/^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-zA-Z]{2,6}(\.[a-zA-Z]{2})?$/i;var emailAdd=RTrim(LTrim(document.getElementById('share_video_email').value));if(emailAdd==''||emailAdd.search(email_Format)==-1){document.getElementById('share_video_email').style.border='1px solid red';}else{send_playlist_email();}}
function send_playlist_email()
{var postUrl=MP_ROOTPATH+'playlist/sendplaylist.php';var param=$('#frm_send_playlist').serialize();var param=param+'&action=share_video';$.post(postUrl,param,function(response){if(trim(response)=='error')
{var err_msg=$('#hid_pl_send_err_msg').val();$('#pl_send_msg').html(err_msg);}
else
{var succ_msg='<font color="green">'+$('#hid_pl_send_succ_msg').val()+'</font>';var pl_default_text=$('#pl_default_text').val();$('#pl_send_msg').html(succ_msg);$('#share_video_email').val(pl_default_text);$('#share_video_email').css({'border':''});}
resize_fancybox();document.getElementById('share_video_email').onclick=function()
{if($('#share_video_email').val()==pl_default_text){$('#share_video_email').val('');}};document.getElementById('share_video_email').onblur=function()
{if($('#share_video_email').val()==''){$('#share_video_email').val(pl_default_text);}};});}
function showplaylistSendBox()
{xmlhttpvdidPlaylistBOX(MP_ROOTPATH+'playlist/sendplaylist.php','showbox','','','','','',MP_ROOTPATH)}
function xmlhttpvdidPlaylistBOX(strURL,a,b,c,d,e,f,MP_ROOTPATH){var xmlHttpReqPlaylistBOX=false;var self=this;if(window.XMLHttpRequest){self.xmlHttpReqPlaylistBOX=new XMLHttpRequest();}
else if(window.ActiveXObject){self.xmlHttpReqPlaylistBOX=new ActiveXObject("Microsoft.XMLHTTP");}
self.xmlHttpReqPlaylistBOX.open('POST',strURL,true);self.xmlHttpReqPlaylistBOX.setRequestHeader('Content-Type','application/x-www-form-urlencoded');self.xmlHttpReqPlaylistBOX.onreadystatechange=function(){if(self.xmlHttpReqPlaylistBOX.readyState==4){generateplaylistBOX(self.xmlHttpReqPlaylistBOX.responseText);}}
self.xmlHttpReqPlaylistBOX.send(getquerynextvdidPlaylistBOX(a,b,c,d,e,f,MP_ROOTPATH));}
function getquerynextvdidPlaylistBOX(a,b,c,d,e,f,MP_ROOTPATH)
{var sendPlaylistEmail;if(a=='showbox'){sendPlaylistEmail=document.getElementById('playlist_email').value;qstr='showbox='+escape(MP_ROOTPATH)+"**##**"+escape(sendPlaylistEmail);}
return qstr;}
function generateplaylistBOX(str,divid)
{document.getElementById('sendplaylistBoxHolder').innerHTML=str;}
function add_moreemails()
{var oRows=document.getElementById('addtable').getElementsByTagName('tr');var iRowCount=oRows.length;var row=parseInt(iRowCount);var fid=parseInt(row)-6;var newrow=document.getElementById('addtable').insertRow(row);var b=newrow.insertCell(0);var numurls=document.getElementById('numberofemails').value;document.getElementById('numberofemails').value=parseInt(numurls)+1;document.getElementById('send_emailfiled').value=parseInt(document.getElementById('send_emailfiled').value)+1;var newurlrow=parseInt(numurls)+1;var emailvalue=document.getElementById('emailvalue').value;var acontent='';var bcontent='';bcontent+='<input type="text" name="pll_emails'+newurlrow+'" id="pll_emails'+newurlrow+'" style="border:1px solid #E2DCD7;margin-top:2px;background-color:#DCD3CE;width:224px; padding:1px; " size="30" value="" onFocus=select()>';bcontent+='<a style="cursor:pointer;font-size:10px;font-weight:normal; color:#15A1C6;" title="Delete Email" onclick="remove_moreemails(this);">(remove)</a>';b.innerHTML=bcontent;}
function remove_moreemails(tis)
{var table=document.getElementById('addtable');var i=tis.parentNode.parentNode.rowIndex;table.deleteRow(i);}
function showhidestringcode()
{if(document.getElementById('captchacode').style.display=='block')
{document.getElementById('captchacode').style.display='none';}
else
{document.getElementById('captchacode').style.display='block';}}
function xmlhttpvdpartner12cap(strURL){var xmlHttpReq2=false;var self=this;if(window.XMLHttpRequest){self.xmlHttpReq2=new XMLHttpRequest();}
else if(window.ActiveXObject){self.xmlHttpReq2=new ActiveXObject("Microsoft.XMLHTTP");}
self.xmlHttpReq2.open('POST',strURL,true);self.xmlHttpReq2.setRequestHeader('Content-Type','application/x-www-form-urlencoded');self.xmlHttpReq2.onreadystatechange=function(){if(self.xmlHttpReq2.readyState==4){updatenextvdpartner12cap(self.xmlHttpReq2.responseText);}}
self.xmlHttpReq2.send(getquerynextvdpartner12cap());}
function getquerynextvdpartner12cap()
{qstr='refresh='+escape('x');return qstr;}
function updatenextvdpartner12cap(str4){document.getElementById("ref").innerHTML=str4;}
function checkstringvalidate(ses_string)
{var entered_string=document.getElementById('sessioncheck').value;var ses_string=document.getElementById('ses_string').value;if(entered_string!=ses_string)
{document.getElementById('sessioncheck').style.border='1px solid red';}
else
{document.getElementById('sessioncheck').style.border='1px solid #E2DCD7';}}
function reversestate()
{}
function RTrim(value)
{var re=/((\s*\S+)*)\s*/;return value.replace(re,"$1");}
function LTrim(value)
{var re=/\s*((\S+\s*)*)/;return value.replace(re,"$1");}
function checkform()
{var numofemails=document.getElementById('numberofemails').value;var email_Format=/^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-zA-Z]{2,6}(\.[a-zA-Z]{2})?$/i;var done=1;var email_Value1=RTrim(LTrim(document.getElementById('myemail').value));if(email_Value1=='')
{done=0;document.getElementById('myemail').value='';document.getElementById('myemail').style.border='1px solid red';}
else if(email_Value1.search(email_Format)==-1)
{done=0;document.getElementById('myemail').style.border='1px solid red';}
else
{done=1;document.getElementById('myemail').style.border='0px solid red';}
if(done==1){for(var i=1;i<=numofemails;i++)
{if(document.getElementById('pll_emails'+i))
{var email_Value=document.getElementById('pll_emails'+i).value;if(email_Value.search(email_Format)==-1)
{done=0;document.getElementById('pll_emails'+i).style.border='1px solid red';}
else
{done=1;document.getElementById('pll_emails'+i).style.border='0px solid red';}}}}
if(done==1)
{xmlhttpvdcaptcha(MP_ROOTPATH+'playlist/sendplaylist.php','validate_captcha')}}
function xmlhttpvdcaptcha(strURL,a){var xmlHttpReqEmail=false;var self=this;if(window.XMLHttpRequest){self.xmlHttpReqEmail=new XMLHttpRequest();}
else if(window.ActiveXObject){self.xmlHttpReqEmail=new ActiveXObject("Microsoft.XMLHTTP");}
self.xmlHttpReqEmail.open('POST',strURL,true);self.xmlHttpReqEmail.setRequestHeader('Content-Type','application/x-www-form-urlencoded');self.xmlHttpReqEmail.onreadystatechange=function(){if(self.xmlHttpReqEmail.readyState==4){response_xmlhttpvdcaptcha(self.xmlHttpReqEmail.responseText);$('#loader_comment').hide();}}
self.xmlHttpReqEmail.send(getqueryvdcaptcha(a));}
function getqueryvdcaptcha(a)
{if(a=='validate_captcha')
{var numofemails=document.getElementById('numberofemails').value;var emails='';for(var i=1;i<=numofemails;i++)
{if(document.getElementById('pll_emails'+i))
{if(emails=='')
{emails=document.getElementById('pll_emails'+i).value;}
else
{emails=emails+"*"+document.getElementById('pll_emails'+i).value;}}}
var names='';var playlistitems=document.getElementById('playlistids').value;var subject=document.getElementById('playlistmsg').value;var myname=document.getElementById('myemail').value;var titleplaylist='';var entered_string=document.getElementById('sessioncheck').value;var titleplaylist='0';qstr='validate='+escape(subject)+"##-##"+escape(myname)+"##-##"+escape(titleplaylist)+"##-##"+escape(numofemails)+"##-##"+escape(emails)+"##-##"+escape(names)+"##-##"+escape(playlistitems)+"##-##"+escape(entered_string);}
return qstr;}
function response_xmlhttpvdcaptcha(str6)
{if(str6=='CAPCHA_ERROR')
{document.getElementById('sessioncheck').style.border='1px solid red';done=0;}
else
{xmlhttpvdidemail(MP_ROOTPATH+'playlist/sendplaylist.php','sendemails')}}
function xmlhttpvdidemail(strURL,a){document.getElementById('loader_email').style.display='block';var xmlHttpReqEmail=false;var self=this;if(window.XMLHttpRequest){self.xmlHttpReqEmail=new XMLHttpRequest();}
else if(window.ActiveXObject){self.xmlHttpReqEmail=new ActiveXObject("Microsoft.XMLHTTP");}
self.xmlHttpReqEmail.open('POST',strURL,true);self.xmlHttpReqEmail.setRequestHeader('Content-Type','application/x-www-form-urlencoded');self.xmlHttpReqEmail.onreadystatechange=function(){if(self.xmlHttpReqEmail.readyState==4){updatenextvdidemail(self.xmlHttpReqEmail.responseText);$('#loader_comment').hide();}}
self.xmlHttpReqEmail.send(getquerynextvdidemail(a));}
function getquerynextvdidemail(a)
{if(a=='sendemails')
{var numofemails=document.getElementById('numberofemails').value;var emails='';for(var i=1;i<=numofemails;i++)
{if(document.getElementById('pll_emails'+i))
{if(emails=='')
{emails=document.getElementById('pll_emails'+i).value;}
else
{emails=emails+"*"+document.getElementById('pll_emails'+i).value;}}}
var names='';var playlistitems=document.getElementById('playlistids').value;var subject=document.getElementById('playlistmsg').value;var myname=document.getElementById('myemail').value;var titleplaylist='';var entered_string=document.getElementById('sessioncheck').value;var titleplaylist='0';qstr='sendmails='+escape(subject)+"##-##"+escape(myname)+"##-##"+escape(titleplaylist)+"##-##"+escape(numofemails)+"##-##"+escape(emails)+"##-##"+escape(names)+"##-##"+escape(playlistitems)+"##-##"+escape(entered_string);}
return qstr;}
function updatenextvdidemail(str6)
{if(str6=='CAPCHA_ERROR')
{document.getElementById('sessioncheck').style.border='1px solid red';done=0;document.getElementById('loader_email').style.display='none';}
else
{document.getElementById("sendplaylistBoxHolder").innerHTML=str6;window.setTimeout('closemsgplaylistsent()',4500);}}
function closemsgplaylistsent()
{document.getElementById("SPdiv2").style.display='none';document.getElementById("SPdiv1").style.display='block';}
function setplaylistMP(value)
{var add=1;var playlist1=playlist.split('*');for(var i=0;i<playlist1.length;i++)
{if(playlist1[i]==value)
add=0;}
if(add==1)
{xmlhttpvdidPlaylist(MP_ROOTPATH+'playlist/playlist.php','addtoplaylist',value,'','','','',MP_ROOTPATH,'forPlaylist');if(playlist=='')
playlist=value;else
playlist=playlist+"*"+value;}}
function show_widget_info(widget_id)
{if($('#widget_info_'+widget_id).is(":visible"))
{if($('#channel_icon'+widget_id).is(":hidden"))
{$('#widget_name_'+widget_id).attr("class",'blue_link');}
$('#widget_info_'+widget_id).hide();}
else
{$('#widget_name_'+widget_id).attr("class",'white_link');$('#widget_info_'+widget_id).show();}
$('div[wtyp]').each(function(){var pattern="widget_name_"+widget_id;if($(this).attr('id')==pattern){}
else
{if($('#channel_icon'+widget_id).is(":hidden"))
{$(this).attr('class','blue_link');}}});$('div[ltyp]').each(function(){var pattern="widget_info_"+widget_id;if($(this).attr('id')==pattern){}
else
{$(this).hide();}});resize_fancybox();}
function show_related_widgets(sel_chk,channel_id)
{var widgets_list=$('#channel_widgets_'+channel_id).val();var channels_widgets_arr=widgets_list.split('*');var all_widgets=$('#all_widgets').val();var all_widgets_arr=all_widgets.split('*');var chk_num=$('#chk_num').val();var pl_num=$('#pl_num').val();var sel_val=$('#chk_'+sel_chk).val();var checked=$('#chk_'+sel_chk).is(':checked');for(counter=0;counter<=all_widgets_arr.length;counter++)
{var wid=all_widgets_arr[counter];if(checked)
{if(jQuery.inArray(wid,channels_widgets_arr)>=0)
{$('#widget_name_'+wid).attr("class",'white_link');$('#channel_icon_'+wid).show();for(ctr=0;ctr<=chk_num;ctr++)
{if($('#chk_'+ctr).val()==sel_val)
{$('#chk_'+ctr).attr("checked",true);}}}}
else
{if($('#widget_info_'+wid).is(':hidden'))
{$('#widget_name_'+wid).attr("class",'blue_link');}
$('#channel_icon_'+wid).hide();for(ctr=0;ctr<=chk_num;ctr++)
{if($('#chk_'+ctr).val()==sel_val)
{$('#chk_'+ctr).attr("checked",false);}}}}
for(counter=1;counter<=pl_num;counter++)
{if($('#playlist_select_'+counter).val()==channel_id)
{if(checked)
{$('#playlist_select_'+counter).attr('checked',true);}
else
{$('#playlist_select_'+counter).attr('checked',false);}}}}
function addVideoToChannel(video_id,page_id)
{var chk_num=$('#chk_num').val();var check_count=0;var channels='';for(counter=0;counter<=chk_num;counter++)
{if($('#chk_'+counter).is(':checked'))
{channels=channels+$('#chk_'+counter).val()+'*';}}
if(channels=='')
{var err_msg=$('#no_channel_selected_msg').val();$('#add_to_channel_msg').html(err_msg);resize_fancybox();return false;}
$('#add_video_wloader').show();var postUrl=MP_ROOTPATH+'members/viewmyplaylist.php';var param='&action=add_video_to_channels&pid='+page_id+'&vid='+video_id+'&channels='+channels;$.post(postUrl,param,function(response){if(trim(response)=='error')
{var err_msg=$('#add_video_err_msg').val();$('#add_to_channel_msg').html(err_msg);}
else
{if($('#videobox_action_type').val()==1){var playlistselected=$('#playlistselected').val();xmlhttpvdsent_videocreate(MP_ROOTPATH+'members/videobox/videossection.php','otherplaylist',page_id,'c',playlistselected);Reverse_showToAddLinkedVideoSection(ajax_url+'images/ag_mi_btn.jpg',ajax_url+'images/edit_plus.jpg')
close_playlist();}else{$('#pageplaylist').replaceWith(response);switch_tab('widgets');}}
$('#add_video_wloader').hide();resize_fancybox();});}
function switch_tab(tab)
{if(tab=='widgets')
{$('#playlistChannel').hide();$('#multipleWidgetChannel').show();$('#widgets_tab').attr("class",'white_link');$('#channels_tab').attr("class",'blue_link');$('#sharevideo_container').hide();$('#sharevideo_link').show();populate_selected_channels();}
if(tab=='channels')
{$('#playlistChannel').show();$('#multipleWidgetChannel').hide();$('#channels_tab').attr("class",'white_link');$('#widgets_tab').attr("class",'blue_link');$('#sharevideo_container').hide();$('#sharevideo_link').show();}
resize_fancybox();}
function populate_selected_channels()
{var pl_num=$('#pl_num').val();var sel_channels=new Array();var ch_widgets=new Array();var ctr=0;for(i=1;i<=pl_num;i++)
{if($('#playlist_select_'+i).is(':checked'))
{sel_channels[i]=$('#playlist_select_'+i).val();ch_widgets[ctr]=$('#ch_widget_'+i).val();ctr++;}}
var chk_num=$('#chk_num').val();for(counter=0;counter<=chk_num;counter++)
{var ch_val=$('#chk_'+counter).val();if(jQuery.inArray(ch_val,sel_channels)>=0)
{$('#chk_'+counter).attr('checked',true);}
else
{$('#chk_'+counter).attr('checked',false);}}
var sel_widgets=new Array();var k=0;for(ctr=0;ctr<ch_widgets.length;ctr++)
{var widgets=ch_widgets[ctr];var widgets_arr=widgets.split('*');for(j=0;j<=widgets_arr.length;j++)
{wid=widgets_arr[j];if(wid!='')
{$('#widget_name_'+wid).attr('class','white_link');$('#channel_icon_'+wid).show();sel_widgets[k]=wid;k++;}}}
$('div[wtyp]').each(function(){var wid=$(this).attr("wtyp");if(jQuery.inArray(wid,sel_widgets)>=0)
{}
else
{if($('#widget_info_'+wid).is(':hidden'))
{$('#widget_name_'+wid).attr('class','blue_link');}
$('#channel_icon_'+wid).hide();}});resize_fancybox();}
function resize_fancybox()
{var h=parseInt($('#fancybox-inner').outerHeight())+25;$('#fancybox-wrap').height(h);}
function resize_edit_fancybox()
{var h=parseInt($('#pageplaylist_edit').height())+25;$('#fancybox-wrap').height(h);}
function show_share_video()
{$('#playlistChannel').hide();$('#multipleWidgetChannel').hide();$('#channels_tab').attr("class",'blue_link');$('#widgets_tab').attr("class",'blue_link');$('#sharevideo_container').show();$('#sharevideo_link').hide();resize_fancybox();}
function switch_edit_tab(tab)
{if(tab=='widgets')
{$('#playlistChannel').hide();$('#multipleWidgetChannel').show();$('#widgets_tab').attr("class",'gray_link');$('#channels_tab').attr("class",'blue_link');$('#sharevideo_container').hide();$('#sharevideo_link').show();}
if(tab=='channels')
{$('#playlistChannel').show();$('#multipleWidgetChannel').hide();$('#channels_tab').attr("class",'gray_link');$('#widgets_tab').attr("class",'blue_link');$('#sharevideo_container').hide();$('#sharevideo_link').show();}
resize_edit_fancybox();}
function show_widget_edit_info(widget_id)
{if($('#widget_info_'+widget_id).is(":visible"))
{$('#widget_name_'+widget_id).attr("class",'blue_link');$('#widget_info_'+widget_id).hide();}
else
{$('#widget_name_'+widget_id).attr("class",'gray_normal_link');$('#widget_info_'+widget_id).show();}
resize_edit_fancybox();}
function close_playlist()
{$.fancybox.close();}
function addToExistingOrNewChannel(strUrl,video_id)
{page_id=$('#pl_mp_profile').val();var default_channel_text=document.getElementById("default_channel_text").value;var new_channel=trim($('#newplaylistname').val());if($('#chk_new_channel').is(':checked')&&(trim(new_channel)==''||new_channel==default_channel_text))
{$('#newplaylistname').css({'border':'1px solid #ff0000'});return false;}
else
{$('#newplaylistname').css({'border':''});}
if(new_channel==default_channel_text||!$('#chk_new_channel').is(':checked')){new_channel='';}
var chk_num=$('#pl_num').val();var channels='';for(counter=1;counter<=chk_num;counter++)
{if($('#playlist_select_'+counter).is(':checked'))
{channels=channels+$('#playlist_select_'+counter).val()+'*';}}
if(channels==''&&!$('#chk_new_channel').is(':checked'))
{var err_msg=$('#no_channel_selected_msg').val();$('#add_to_pl_msg').html(err_msg);resize_fancybox();return false;}
$('#add_video_loader').show();var postUrl=MP_ROOTPATH+'members/viewmyplaylist.php';var param=$('#frm_channels').serialize();var param=param+'&addtoplaylist=Save as channel|||'+page_id+'|||'+video_id+'&action=add_video_to_channels&pid='+page_id+'&vid='+video_id+'&channels='+channels;$.post(postUrl,param,function(response){if(trim(response)=='error')
{var err_msg=$('#add_video_err_msg').val();$('#add_to_pl_msg').html(err_msg);}
else
{if($('#videobox_action_type').val()==1){var playlistselected=$('#playlistselected').val();xmlhttpvdsent_videocreate(MP_ROOTPATH+'members/videobox/videossection.php','otherplaylist',page_id,'c',playlistselected);Reverse_showToAddLinkedVideoSection(ajax_url+'images/ag_mi_btn.jpg',ajax_url+'images/edit_plus.jpg')
close_playlist();}else{$('#pageplaylist').replaceWith(response);switch_tab('channels');}}
$('#add_video_loader').hide();resize_fancybox();});}
function show_login_div()
{$('#channel_login_div').slideDown();$('#create_account_div').show();resize_fancybox();}
function isloggedIn(username_id,password_id,error_id)
{var valid=true;var username=$('#'+username_id).val();var password=$('#'+password_id).val();password=password.replace(/&/g,'#*amp;*#');var email_Format=/^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-zA-Z]{2,6}(\.[a-zA-Z]{2})?$/i;if(username.search(email_Format)==-1||username=='')
{$('#'+username_id).css('border','1px solid red');valid=false;}else{$('#'+username_id).css('border','1px solid #DCD3CE');}
if(password=='')
{$('#'+password_id).css('border','1px solid red');valid=false;}else{$('#'+password_id).css('border','1px solid #DCD3CE');}
if(valid)
{var url=WEBTV_ROOTPATH+'includes/login_check.php';$.post(url,{username:username,password:password,redirect:1},function(response){if(response=='success'||response=='superadmin'||response=='previewadmin'||response=='useradmin'||response=='directoryadmin'||response=='editor')
{if(document.getElementById('login_div'))
{document.getElementById('loader_login').style.display='none';document.getElementById('login_div').style.display='none';var last_action=document.getElementById('act_fired').value;var pageowner_id=document.getElementById('owner_page_id').value;javascript:xmlhttpvdupdatemp(ajax_url+'member.php',last_action,pageowner_id);reload_playlist_popup();}else{header_page_refresh(response);if(document.getElementById('fb_headerlogindiv'))
document.getElementById('fb_headerlogindiv').style.display='none';if(document.getElementById('fb_customheaderlogindiv'))
document.getElementById('fb_customheaderlogindiv').style.display='none';}}
if(response=='failure')
{$('#'+error_id).show();resize_fancybox();}});}}
function reload_playlist_popup()
{if($('#pageplaylist').is(':visible'))
{var param="addtoplaylist="+$('#hid_addtoplaylist').val();var postUrl=MP_ROOTPATH+'members/viewmyplaylist.php';$.post(postUrl,param,function(response){$('#pageplaylist').replaceWith(response);switch_tab('channels');resize_fancybox();});}}
function reRequestFancyBox()
{$('.fancyAjax').fancybox({'hideOnContentClick':false,'hideOnOverlayClick':false,'overlayOpacity':0.6,'onStart':function(){$('#fancybox-outer').css({'background-color':'#000000','width':'310px'});$('#fancybox-close').css({'background-image':'url("../../fancybox/fancybox.png")','background-position':'-40px 0'});$('#fancybox-outer').corner("br 16px");},'onComplete':function(){var h=parseInt($('#pageplaylist').height())+25;$('#fancybox-wrap').height(h);}});$('.fancyAjaxEdit').fancybox({'hideOnContentClick':false,'hideOnOverlayClick':false,'overlayOpacity':0.6,'onStart':function(){$('#fancybox-outer').css({'background-color':'#ffffff','width':'432px'});$('#fancybox-close').css({'background-image':'url("../../fancybox/fancybox_edit.png")','background-position':'-40px 0'});$('#fancybox-outer').corner("br 16px");},'onComplete':function(){var h=parseInt($('#pageplaylist_edit').height())+25;$('#fancybox-wrap').height(h);}});}
function undo_channel_delete(pl_id)
{var postUrl=MP_ROOTPATH+'members/viewmyplaylistedit.php';var wid_list=document.getElementById('wid_list').value;var pl_pos=document.getElementById('pl_pos').value;var param='&undo_delete=1&refresh=My playlists|||2|||-1&pl_id='+pl_id;param=param+'&wid_list='+wid_list+'&pl_pos='+pl_pos;$.post(postUrl,param,function(response){$('#pageplaylist_edit').replaceWith(response);resize_edit_fancybox();});}
function postToMySpace(vid,lan,svl,mID)
{if(document.getElementById('widget_id'))
{var wID=document.getElementById('widget_id').value;var url="http://www.moodio.tv/widget/videowidget_myspace.php?vID="+vid+"&lang="+lan+"&showVideoLink="+svl+"&mID="+mID+"&wID="+wID+"&siteName=http://www.myspace.com";}
else
{var url="http://www.moodio.tv/widget/videowidget_myspace.php?vID="+vid+"&lang="+lan+"&showVideoLink="+svl+"&mID="+mID+"&siteName=http://www.myspace.com";}
var targetUrl='http://www.myspace.com/Modules/PostTo/Pages/?u='+encodeURIComponent(url);window.open(targetUrl,"PostingtoMySpace");}
function postToBlogger(fromModule)
{if(fromModule=='webtools')
{var embedText=document.getElementById('embed_code_area').value;var postTitle=document.getElementById('pagename_embedcode').innerHTML+" - Moodio.TV";}
else
{var embedText=document.getElementById('emb_code').value;var postTitle=document.getElementById('videoname_click').innerHTML+" - Moodio.TV";}
embedTextPos=embedText.indexOf('<embed');embedText=embedText.substr(embedTextPos);embedText=embedText.replace('</object>','');var targetUrl='http://www.blogger.com/add-widget'+'?widget.title='+encodeURIComponent(postTitle)+'&widget.content='+encodeURIComponent(embedText);window.open(targetUrl,"PostingtoBlogger");}
function postToBlogger_from_playlist()
{var embedText=document.getElementById('hid_blogger_code').value;var postTitle=document.getElementById('hid_videoname').value+" - Moodio.TV";embedTextPos=embedText.indexOf('<embed');embedText=embedText.substr(embedTextPos);embedText=embedText.replace('</object>','');var targetUrl='http://www.blogger.com/add-widget'+'?widget.title='+encodeURIComponent(postTitle)+'&widget.content='+encodeURIComponent(embedText);window.open(targetUrl,"PostingtoBlogger");}
function postToAddThis(fromModule)
{if(fromModule=='webtools')
{var directLink=document.getElementById('embed_code_area').value;var postTitle=document.getElementById('pagename_embedcode').innerHTML+" - Moodio.TV";}
else
{var directLink=document.getElementById('emb_code').value;var postTitle=document.getElementById('videoname_click').innerHTML+" - Moodio.TV";}
var targetUrl='http://www.addthis.com/bookmark.php'+'?url='+encodeURIComponent(directLink)+'&title='+encodeURIComponent(postTitle);window.open(targetUrl,"PostingtoAddThis");}
function postToAddThis_from_playlist()
{var directLink=document.getElementById('hid_directlink_code').value;var postTitle=document.getElementById('hid_videoname').value+" - Moodio.TV";var targetUrl='http://www.addthis.com/bookmark.php'+'?url='+encodeURIComponent(directLink)+'&title='+encodeURIComponent(postTitle);window.open(targetUrl,"PostingtoAddThis");}
function postToFacebook(vID,lang,mID)
{if(vID=='')
{vID=document.getElementById('mainvideo').value;}
if(lang=='')
{lang=document.getElementById('sel_lan').value;}
if(document.getElementById('videoname_click')&&(document.getElementById('videoname_click').innerHTML!=''))
{var postTitle=document.getElementById('videoname_click').innerHTML+" - Moodio.TV";}
else
{var postTitle=document.getElementById('pagename_embedcode').innerHTML+" - Moodio.TV";}
if(document.getElementById('widget_id'))
{var wID=document.getElementById('widget_id').value;var videowidgetfacebookUrl="http://www.moodio.tv/widget/videowidget_facebook.php?vID="+vID+"&lang="+lang+"&mID="+mID+"&wID="+wID;}
else
{var videowidgetfacebookUrl="http://www.moodio.tv/widget/videowidget_facebook.php?vID="+vID+"&lang="+lang;if(mID!='')
{videowidgetfacebookUrl=videowidgetfacebookUrl+"&mID="+mID;}}
var targetUrl='http://www.facebook.com/sharer.php'+'?u='+encodeURIComponent(videowidgetfacebookUrl)+'&t='+encodeURIComponent(postTitle);window.open(targetUrl,"PostingtoFacebook");}
function postToIGoogle(vID,lang,showVideo,base_url,mID)
{if(vID=='')
{vID=document.getElementById('mainvideo').value;}
if(lang=='')
{lang=document.getElementById('sel_lan').value;}
if(document.getElementById('widget_id'))
{var wID=document.getElementById('widget_id').value;}
if(document.getElementById('videoname_click')&&(document.getElementById('videoname_click').innerHTML!=''))
{var postTitle=document.getElementById('videoname_click').innerHTML+" - Moodio.TV";}
else
{var postTitle=document.getElementById('pagename_embedcode').innerHTML+" - Moodio.TV";}
if(document.getElementById('widget_id'))
{var iGoogleParams=vID+'|'+lang+'|'+showVideo+'|'+postTitle+'|'+mID+'|'+wID;}
else
{var iGoogleParams=vID+'|'+lang+'|'+showVideo+'|'+postTitle+'|'+mID;}
var postUrl=MP_ROOTPATH+'webtv/base64_encode.php';$.post(postUrl,{params:iGoogleParams},function(response){var targetUrl='http://fusion.google.com/add?source=atgs&moduleurl=http%3A//'+base_url+'?params='+response.toString();window.open(targetUrl,"PostingtoIGoogle");});}
function postToBebo(vID,lang)
{if(vID=='')
{vID=document.getElementById('mainvideo').value;}
if(lang=='')
{lang=document.getElementById('sel_lan').value;}
if(document.getElementById('widget_id'))
{var wID=document.getElementById('widget_id').value;var targetUrl="http://www.moodio.tv/widget/videowidget_bebo.php?vID="+vID+"&wID="+wID+"&lang="+lang;}
else
{var targetUrl="http://www.moodio.tv/widget/videowidget_bebo.php?vID="+vID+"&lang="+lang;}
window.open(targetUrl,"PostingtoBebo");}
function pl_login_enter(e)
{if(window.event)
key=window.event.keyCode;else
key=e.which;if(key==13)
{$('#pl_login_btn').click();}}
function check_pl_email_enter(e)
{if(window.event)
key=window.event.keyCode;else
key=e.which;if(key==13)
{$('#send_pl_email_btn').click();}}
function update_channels_by_page(pid,vid)
{$('#update_chhanel_loader').show();addtoplaylist='Save as channel|||'+pid+'|||'+vid;var param="update_chlist=1&pid="+pid+'&addtoplaylist='+addtoplaylist;var postUrl=MP_ROOTPATH+'members/ajax_update_chlist.php';$.post(postUrl,param,function(response){$('#pl_section').replaceWith(response);switch_tab('channels');resize_fancybox();$('#update_chhanel_loader').hide();});}
function getposOffset(overlay,offsettype){var totaloffset=(offsettype=="left")?overlay.offsetLeft:overlay.offsetTop;var parentEl=overlay.offsetParent;while(parentEl!=null){totaloffset=(offsettype=="left")?totaloffset+parentEl.offsetLeft:totaloffset+parentEl.offsetTop;parentEl=parentEl.offsetParent;}
return totaloffset;}
function showsettings(val)
{close_other_popups('settings_box_holder');document.getElementById('settings_box_holder').innerHTML="";document.getElementById("settings_box_holder").style.display='block';show_black_box('#settings_box_holder');if(document.getElementById('termandcondition')){document.getElementById('termandcondition').style.display='none';}
if(document.getElementById('coming_soon')){document.getElementById('coming_soon').style.display='none';}
if(document.getElementById('notdev')){document.getElementById('notdev').style.display='none';}
if(val=='userdata')
{var url=MP_ROOTPATH+'settings/profiles.php';params='';}
if(val=='account')
{var url=MP_ROOTPATH+'settings/account.php';params='';}
if(val=='notification')
{var url=MP_ROOTPATH+'settings/notification.php';params='';}
if(val=='facebook_settings')
{var url=MP_ROOTPATH+'settings/facebook_settings.php';params='';}
if(window.XMLHttpRequest)
{contactreq=new XMLHttpRequest();}
else if(window.ActiveXObject)
{contactreq=new ActiveXObject("Microsoft.XMLHTTP");}
contactreq.open("POST",url,true);contactreq.setRequestHeader("Content-type","application/x-www-form-urlencoded;");contactreq.setRequestHeader("Content-length",params.length);contactreq.setRequestHeader("Connection","close");contactreq.onreadystatechange=settings_callback;contactreq.send(params);}
function settings_callback()
{if(contactreq.readyState==4)
{if(contactreq.status==200)
{response=contactreq.responseText;document.getElementById('settings_box_holder').innerHTML=response;$('.edit_alert_btn').corner('4px');}}}
function closesettings()
{document.getElementById("settings_box_holder").style.display='none';hide_overlay();}
function makeDefaultPage(pageid)
{var xmlHttpReq6=false;var self=this;if(window.XMLHttpRequest){self.xmlHttpReq6=new XMLHttpRequest();}
else if(window.ActiveXObject){self.xmlHttpReq6=new ActiveXObject("Microsoft.XMLHTTP");}
var strURL=MP_ROOTPATH+'settings/profiles.php';var param='act=makedefault&pageid='+pageid;self.xmlHttpReq6.open('POST',strURL,true);self.xmlHttpReq6.setRequestHeader('Content-Type','application/x-www-form-urlencoded');self.xmlHttpReq6.onreadystatechange=function(){if(self.xmlHttpReq6.readyState==4){handleMakeDefaultPage(self.xmlHttpReq6.responseText,pageid);}}
self.xmlHttpReq6.send(param);}
function handleMakeDefaultPage(str,pageid)
{document.getElementById('settings_box_holder').innerHTML=str;show_detail(pageid);}
function show_detail(sno)
{document.getElementById('sprofile_info_'+sno).style.display='block';document.getElementById('sprofile_action2_'+sno).style.display='block';document.getElementById('sprofile_action1_'+sno).style.display='none';}
function hide_detail(sno)
{document.getElementById('sprofile_info_'+sno).style.display='none';document.getElementById('sprofile_action2_'+sno).style.display='none';document.getElementById('sprofile_action1_'+sno).style.display='block';}
function settings_confirm_message(tis,txt,mode)
{if(mode=="show")
{var curobj=tis;var xpos=getposOffset(curobj,"left")+((typeof opt_position!="undefined"&&opt_position.indexOf("right")!=-1)?-(subobj.offsetWidth-curobj.offsetWidth):0)
var ypos=getposOffset(curobj,"top")+((typeof opt_position!="undefined"&&opt_position.indexOf("bottom")!=-1)?curobj.offsetHeight:0)
ypos=ypos;if(ypos>800)
{ypos=ypos-750;}
else if(ypos>400&&ypos<800)
{ypos=ypos-200;}
else if(ypos==0){ypos=200;}
if(xpos>1000)
xpos=xpos-300;if(xpos>500)
{xpos=xpos-380;}
else if(xpos==0){xpos=300;}
else
{xpos=xpos-10;}
document.getElementById('settings_confrm_popup_content').innerHTML="";document.getElementById("settings_confrm_popup").style.display="block";document.getElementById('settings_confrm_popup_btn_div').style.display="block";document.getElementById('settings_confrm_popup_content').innerHTML=txt;document.getElementById("settings_confrm_popup").style.top="100px";document.getElementById("settings_confrm_popup").style.left="34%";}
else if(mode=="hide")
{document.getElementById("settings_confrm_popup").style.display="none";}}
function confirm_page_delete(tis,confirm_str,page_id)
{var strURL=MP_ROOTPATH+'settings/account.php';param='act=check_agenda&page_id='+page_id;$.post(strURL,param,function(result){if(trim(result)!='')
{show_cant_delete_profile(result);}
else
{document.getElementById('settings_confrm_btn1').onclick=function()
{settings_confirm_message("0","","hide");if(document.getElementById('store_load_img'))
{document.getElementById('store_load_img').style.display='block'}
var param="act=del&page_id="+page_id;var postURL=MP_ROOTPATH+'settings/profiles.php';ajaxSetArray=new ajaxObject(postURL,update_profile_box,'');ajaxSetArray.update(param,'Post')};document.getElementById('settings_confrm_btn2').onclick=function()
{settings_confirm_message("0","","hide");return false;};settings_confirm_message(tis,confirm_str,"show");}});}
function update_profile_box(str)
{if(str.substr(0,8)=='REDIRECT')
{var path=str.substr(9);location.href=path;}
else if(str=='DELETE_ACCOUNT')
{settings_confirm_message("0","","hide");show_cancel_account();}
else
{document.getElementById('settings_box_holder').innerHTML=str;var param="act=update_header";var postURL=MP_ROOTPATH+'settings/profiles.php';ajaxSetArray=new ajaxObject(postURL,update_header_profilelist,'');ajaxSetArray.update(param,'Post')}}
function update_header_profilelist(str)
{document.getElementById('header_member_pages').innerHTML=str;}
function show_cant_delete_profile(str)
{document.getElementById('roles_notify_btn1').onclick=function(){notify_message("0","","hide");};notify_message("0",str,"show");document.getElementById("roles_notify_popup").style.zIndex=50000;}
function save_notification()
{var chck_values=getFormHeader('notification_frm');var param="act=notification&"+chck_values;document.getElementById('loader_notificationBox').style.display='block';var postURL=MP_ROOTPATH+'settings/notification.php';ajaxSetArray=new ajaxObject(postURL,response_save_notification);ajaxSetArray.update(param,'Post')}
function response_save_notification(responseText,responseStatus,responseXML)
{if(responseStatus==200)
{var response=responseText;document.getElementById('loader_notificationBox').style.display='none';document.getElementById('settings_box_holder').innerHTML="";document.getElementById('settings_box_holder').innerHTML=response;$('.edit_alert_btn').corner('4px');hide_error_msg('success_msg_notification',100);return false;}}
function hide_error_msg(div,value1)
{if(value1!=0)
{val=parseInt(value1)-1;document.getElementById(div).style.filter='alpha(opacity='+val+')';document.getElementById(div).style.mozOpacity='0.'+val;document.getElementById(div).style.opacity='.'+val;window.setTimeout("hide_error_msg('"+div+"','"+val+"')",30);}
else
{document.getElementById(div).style.display='none';}}
function show_change_email()
{document.getElementById('change_email').style.display='none';document.getElementById('save_email').style.display='block';}
function save_account_email()
{var email_Format=/^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-zA-Z]{2,6}(\.[a-zA-Z]{2})?$/i;if(trim(document.getElementById("account_email").value).search(email_Format)==-1)
{document.getElementById("account_email").style.border="1px solid #ff0000";document.getElementById("account_email").focus();}
else
{var xmlHttpReq6=false;var self=this;if(window.XMLHttpRequest){self.xmlHttpReq6=new XMLHttpRequest();}
else if(window.ActiveXObject){self.xmlHttpReq6=new ActiveXObject("Microsoft.XMLHTTP");}
var strURL=MP_ROOTPATH+'settings/validateaccount.php';var param="act=check_email&email="+document.getElementById("account_email").value;self.xmlHttpReq6.open('POST',strURL,true);self.xmlHttpReq6.setRequestHeader('Content-Type','application/x-www-form-urlencoded');self.xmlHttpReq6.onreadystatechange=function(){if(self.xmlHttpReq6.readyState==4){update_account_email(self.xmlHttpReq6.responseText);}}
self.xmlHttpReq6.send(param);}}
function update_account_email(str)
{var status=str.substring(0,6);var err_msg=str.substring(6);if(status=='ERROR:')
{document.getElementById("account_email").style.border="1px solid #ff0000";document.getElementById("account_email").focus();if(err_msg!='')
{document.getElementById('account_email_err').innerHTML=err_msg;fadein('account_email_err',100);}}
else
{document.getElementById('save_email').style.display='none';document.getElementById('change_email').style.display='block';document.getElementById('change_email').innerHTML=str;}}
function change_password()
{document.getElementById('loader_accountBox').style.display='block';if(trim(document.getElementById("old_pwd").value)=="")
{document.getElementById("old_pwd").style.border="1px solid #ff0000";document.getElementById("old_pwd").focus();}
else if(trim(document.getElementById("new_pwd").value)=="")
{document.getElementById("new_pwd").style.border="1px solid #ff0000";document.getElementById("new_pwd").focus();}
else if(trim(document.getElementById("retype_pwd").value)=="")
{document.getElementById("retype_pwd").style.border="1px solid #ff0000";document.getElementById("retype_pwd").focus();}
else
{var strURL=MP_ROOTPATH+'settings/validateaccount.php';var param=$("#frm_account_info").serialize();param+='&act=check_pwd';$.post(strURL,param,function(data){check_account_pwd(data);document.getElementById('loader_accountBox').style.display='none';});}}
function check_account_pwd(str)
{var status=str.split(':');if(status[0]=='ERROR')
{if(status[1]=='1')
{document.getElementById("old_pwd").style.border="1px solid #ff0000";document.getElementById("old_pwd").focus();document.getElementById("new_pwd").style.border="none";document.getElementById("retype_pwd").style.border="none";}
else if(status[1]=='2')
{document.getElementById("old_pwd").style.border="none";document.getElementById("new_pwd").style.border="1px solid #ff0000";document.getElementById("retype_pwd").style.border="1px solid #ff0000";document.getElementById("new_pwd").focus();}
else if(status[1]=='12')
{document.getElementById("old_pwd").style.border="1px solid #ff0000";document.getElementById("old_pwd").focus();document.getElementById("new_pwd").style.border="1px solid #ff0000";document.getElementById("retype_pwd").style.border="1px solid #ff0000";}}
else
{document.getElementById('account_cpwd_msg').innerHTML=status[2];fadein('account_cpwd_msg',100);document.getElementById("old_pwd").style.border="none";document.getElementById("new_pwd").style.border="none";document.getElementById("retype_pwd").style.border="none";document.getElementById("old_pwd").value="";document.getElementById("new_pwd").value="";document.getElementById("retype_pwd").value="";}}
function confirm_cancel_account(tis,confirm_str)
{var strURL=MP_ROOTPATH+'settings/account.php';param='act=check_profile_agenda';$.post(strURL,param,function(result){if(trim(result)!='')
{show_cant_delete_profile(result);}
else
{document.getElementById('settings_confrm_btn1').onclick=function()
{settings_confirm_message("0","","hide");if(document.getElementById('store_load_img'))
{document.getElementById('store_load_img').style.display='block'}
show_cancel_account();};document.getElementById('settings_confrm_btn2').onclick=function()
{settings_confirm_message("0","","hide");return false;};settings_confirm_message(tis,confirm_str,"show");}});}
function show_cancel_account()
{var strURL=MP_ROOTPATH+'settings/cancel_account.php';var param='';$.post(strURL,param,function(response){document.getElementById('cancel_acct_box_content').innerHTML=response;$('.edit_alert_btn').corner('4px');});closesettings();document.getElementById("cancel_acct_box_holder").style.display="block";if(document.getElementById("frm_cancel_acct"))
document.getElementById("frm_cancel_acct").reset();}
function close_cancel_account()
{document.getElementById("cancel_acct_box_holder").style.display="none";}
function fadein(div,duration)
{var val=parseInt(duration)-1;if(val>10)
{document.getElementById(div).style.filter='alpha(opacity='+val+')';document.getElementById(div).style.mozOpacity='0.'+val;document.getElementById(div).style.opacity='.'+val;window.setTimeout("fadein('"+div+"','"+val+"')",30);}
else
{document.getElementById(div).innerHTML='';window.clearTimeout("fadein");}}
function cancel_my_account(err_msg)
{var sel=0;for(var i=0;i<document.frm_cancel_acct.cancel_reason.length;i++)
{if(document.frm_cancel_acct.cancel_reason[i].checked)
{var sel=1;var strURL=MP_ROOTPATH+'settings/account.php';var param=$("#frm_cancel_acct").serialize();param+='&act=cancel_account';$.post(strURL,param,function(data){response_cancel_account(data);});}}
if(sel=='0')
{document.getElementById('cancel_status').innerHTML=err_msg;fadein('cancel_status',100);}}
function response_cancel_account(str)
{document.getElementById('cancel_status').innerHTML=str;fadein('cancel_status',100);location.href=WEBTV_AJAXPATH;}
function show_notification_box()
{close_cancel_account();showsettings('notification');}
function show_help_box(tis)
{show_not_done_link(tis,'top');}
function confirm_fb_cancel_account(tis,confirm_str)
{document.getElementById('settings_confrm_btn1').onclick=function()
{settings_confirm_message("0","","hide");if(document.getElementById('store_load_img'))
{document.getElementById('store_load_img').style.display='block';}
fb_cancel_account();};document.getElementById('settings_confrm_btn2').onclick=function()
{settings_confirm_message("0","","hide");return false;};settings_confirm_message(tis,confirm_str,"show");}
function fb_cancel_account()
{var url=MP_ROOTPATH+'settings/revoke_fb_authorization.php';$.post(url,{act:"disconnect_fb_account"},function(data){if(data=='SUCESS')
{header_refresh();$("#id_fb_cancel_account").css("color","#124F0F");$("#id_fb_cancel_account").html($("#fb_msg_cancel_account").val());$("#id_fb_cancel_account").fadeIn("slow");$("#id_fb_cancel_account").css("display","none");}});}
function save_fb_settings()
{document.getElementById('loader_fbSettingsBox').style.display='block';var fb_frm_values=getFormHeader('fbSettings_frm');var param="act=fbsettings&"+fb_frm_values;var postURL=MP_ROOTPATH+'settings/facebook_settings.php';ajaxSetArray=new ajaxObject(postURL,response_save_fb_settings);ajaxSetArray.update(param,'Post')}
function response_save_fb_settings(responseText,responseStatus,responseXML)
{if(responseStatus==200)
{var fbresponse=responseText;document.getElementById('settings_box_holder').innerHTML="";document.getElementById('settings_box_holder').innerHTML=fbresponse;$('.edit_alert_btn').corner('4px');document.getElementById('loader_fbSettingsBox').style.display='none';hide_error_msg('success_msg_fbSettings',100);return false;}}
function notify_message(tis,txt,mode)
{if(mode=="show")
{var curobj=tis;var xpos=getposOffset(curobj,"left")+((typeof opt_position!="undefined"&&opt_position.indexOf("right")!=-1)?-(subobj.offsetWidth-curobj.offsetWidth):0)
var ypos=getposOffset(curobj,"top")+((typeof opt_position!="undefined"&&opt_position.indexOf("bottom")!=-1)?curobj.offsetHeight:0)
ypos=ypos;if(ypos>800)
{ypos=ypos-750;}
else if(ypos>400&&ypos<800)
{ypos=ypos-200;}
else if(ypos==0){ypos=200;}
if(xpos>1000)
xpos=xpos-300;if(xpos>500)
{xpos=xpos-380;}
else if(xpos==0){xpos=300;}
else
{xpos=xpos-10;}
document.getElementById('roles_notify_popup_content').innerHTML="";document.getElementById("roles_notify_popup").style.display="block";document.getElementById('roles_notify_popup_btn_div').style.display="block";document.getElementById('roles_notify_popup_content').innerHTML=txt;document.getElementById("roles_notify_popup").style.top="100px";document.getElementById("roles_notify_popup").style.left="32%";}
else if(mode=="hide")
{document.getElementById("roles_notify_popup").style.display="none";}}
function makeDefaultNetwork(netid,pageid,rownum)
{var xmlHttpReq6=false;var self=this;if(window.XMLHttpRequest){self.xmlHttpReq6=new XMLHttpRequest();}
else if(window.ActiveXObject){self.xmlHttpReq6=new ActiveXObject("Microsoft.XMLHTTP");}
var strURL=MP_ROOTPATH+'settings/profiles.php';var param='act=makeDefaultNetwork&netid='+netid+'&pageid='+pageid;self.xmlHttpReq6.open('POST',strURL,true);self.xmlHttpReq6.setRequestHeader('Content-Type','application/x-www-form-urlencoded');self.xmlHttpReq6.onreadystatechange=function(){if(self.xmlHttpReq6.readyState==4){handleMakeDefaultNetwork(self.xmlHttpReq6.responseText,pageid);}}
self.xmlHttpReq6.send(param);}
function handleMakeDefaultNetwork(str,pageid)
{document.getElementById('networks_'+pageid).innerHTML=str;}
var show_help_system=0;var hide_tool_time='';function show_help_msg(tis,box_name,lebel_name,lan)
{clearTimeout(hide_tool_time);show_help_system=1;var loaderimage=box_name+"_"+lebel_name+"_loader"
var param="box_name="+box_name+"&lebel_name="+lebel_name+"&lan="+lan
var postURL=WEBTV_ROOTPATH+'help_system/ajax_get_help.php';ajaxSetArray=new ajaxObject(postURL,response_show_help_msg,tis,box_name);ajaxSetArray.update(param,'Post')}
function response_show_help_msg(responseText,responseStatus,responseXML,tis,box_name)
{if(responseStatus==200)
{var response=responseText;var curobj=tis;var xpos=getposcord(curobj,"left")+((typeof opt_position!="undefined"&&opt_position.indexOf("right")!=-1)?-(subobj.offsetWidth-curobj.offsetWidth):0)
var ypos=getposcord(curobj,"top")+((typeof opt_position!="undefined"&&opt_position.indexOf("bottom")!=-1)?curobj.offsetHeight:0)
xpos=parseInt(xpos);if(box_name=='faq')
{xpos=parseInt(xpos)+80;ypos=parseInt(ypos)-4;}
if(window.ActiveXObject)
{if(box_name=='store')
{xpos=parseInt(xpos)-560;ypos=parseInt(ypos)-4;}}
if(show_help_system==1)
{xpos=parseInt(xpos)+20;ypos=parseInt(ypos)-18;if(show_help_system==1)
{$('#text_help_box').fadeIn(1000)
document.getElementById('text_help_box').style.left=xpos+"px"
document.getElementById('text_help_box').style.top=ypos+"px"
document.getElementById('text_help_box_message').innerHTML=response;}}}}
function hide_tool_tip()
{document.getElementById('text_help_box').style.display='none';}
function paly_help_video(v_path,v_id)
{if(v_id>0)
{change_video_lebel(v_id)}
var videoType="moodio";if(document.getElementById('help_video_msg')&&document.getElementById('help_video_msg').style.display!='block')
{popupWidth=740;var popup_left=(screen.width/2)-(popupWidth/2);document.getElementById('help_video_msg').style.left=popup_left+"px"
document.getElementById('help_video_msg').style.top="50px"
document.getElementById('help_video_msg').style.display='block';}
try
{stream_load_help('helpplayer',v_path)}
catch(e)
{help_player_reload(v_path,videoType);}}
function change_video_lebel(v_id)
{if(document.getElementById('last_help_video_playing'))
{var last_help_video_id=document.getElementById('last_help_video_playing').value;document.getElementById('last_help_video_playing').value=v_id
var last_video_div="help_related_video_"+last_help_video_id
var cur_video_div="help_related_video_"+v_id
var cur_videoname_div="help_related_video_name_"+v_id
if(document.getElementById(last_video_div))
{document.getElementById(last_video_div).style.border='0px solid black';document.getElementById(last_video_div).style.marginTop='12px';document.getElementById(last_video_div).style.marginLeft='5px';document.getElementById(last_video_div).style.marginRight='5px';}
if(document.getElementById(cur_video_div))
{document.getElementById(cur_video_div).style.border='5px solid #15a1c6';document.getElementById(cur_video_div).style.marginTop='7px';document.getElementById(cur_video_div).style.marginLeft='0px';document.getElementById(cur_video_div).style.marginRight='0px';}
if(document.getElementById(cur_videoname_div)&&document.getElementById('help_video_lebelname'))
{document.getElementById('help_video_lebelname').innerHTML=document.getElementById(cur_videoname_div).innerHTML}}}
function change_box_lebel(boxname)
{var box_name_container_id="navigationlink_"+boxname
if(document.getElementById(box_name_container_id)&&document.getElementById('help_video_boxname'))
{document.getElementById('help_video_boxname').innerHTML=document.getElementById(box_name_container_id).innerHTML}}
function show_help_video(box_name,lebel_name,lan,v_id)
{document.getElementById('help_video_related_video').innerHTML='';document.getElementById('help_video_loader_image').style.display='block';document.getElementById('help_video_related_video').style.display='none';var param="box_name="+box_name+"&lebel_name="+lebel_name+"&lan="+lan
var postURL=WEBTV_ROOTPATH+'help_system/ajax_get_help_video.php';ajaxSetArray=new ajaxObject(postURL,response_show_help_video,v_id);ajaxSetArray.update(param,'Post')}
function response_show_help_video(responseText,responseStatus,responseXML,v_id)
{if(responseStatus==200)
{var response=responseText;document.getElementById('help_video_loader_image').style.display='none';document.getElementById('help_video_related_video').innerHTML=response;if(document.getElementById('total_help_videos')&&document.getElementById('total_help_videos').value>8)
{if(document.getElementById('total_help_videos'))
{document.getElementById('help_video_msg').style.height="650px"}}
else
{if(document.getElementById('total_help_videos'))
{document.getElementById('help_video_msg').style.height="570px"}}
document.getElementById('help_video_related_video').style.display='block';change_video_lebel(v_id)}}
function show_help_link(box_name,link_list,help_icon,act)
{if(act=='show')
{var param="box_name="+box_name
var postURL=WEBTV_ROOTPATH+'help_system/ajax_get_help_icos.php';ajaxSetArray=new ajaxObject(postURL,response_show_help_link,box_name,link_list,help_icon);ajaxSetArray.update(param,'Post')}
else
{close_help_link(box_name,link_list,help_icon,act);}}
function response_show_help_link(responseText,responseStatus,responseXML,box_name,link_list,help_icon)
{if(responseStatus==200)
{var response=responseText;if(response=='no help icon')
{if(document.getElementById(help_icon))
{show_not_done_link(document.getElementById(help_icon),'top')}}
else
{var lists=response.split("*")
for(var i=0;i<lists.length;i++)
{if(document.getElementById(lists[i]))
{document.getElementById(lists[i]).style.display='inline'}}
if(document.getElementById(help_icon))
{if(document.getElementById(help_icon+"_text"))
{document.getElementById(help_icon+"_text").innerHTML=document.getElementById('hide_help_text_contain').value}
document.getElementById(help_icon).onclick=function anonymous(){show_help_link(box_name,link_list,help_icon,'hide');};}}}}
function close_help_link(box_name,link_list,help_icon,act)
{var lists=link_list.split("*")
for(var i=0;i<lists.length;i++)
{if(document.getElementById(lists[i]))
{document.getElementById(lists[i]).style.display='none'}}
if(document.getElementById(help_icon))
{if(document.getElementById(help_icon+"_text"))
{document.getElementById(help_icon+"_text").innerHTML=document.getElementById('show_help_text_contain').value}
document.getElementById(help_icon).onclick=function anonymous(){show_help_link(box_name,link_list,help_icon,'show');};}}
function startdrag(t,e)
{if(e.preventDefault)e.preventDefault();e.cancelBubble=true;window.document.onmousemoveOld=window.document.onmousemove;window.document.onmouseupOld=window.document.onmouseup;window.document.onmousemove=dodrag;window.document.onmouseup=stopdrag;window.document.draged=t;t.dragX=e.clientX;t.dragY=e.clientY;return false;}
function dodrag(e)
{if(!e)e=event;t=window.document.draged;t.style.left=(t.offsetLeft+e.clientX-t.dragX)+"px";t.style.top=(t.offsetTop+e.clientY-t.dragY)+"px";t.dragX=e.clientX;t.dragY=e.clientY;return false;}
function stopdrag()
{window.document.onmousemove=window.document.onmousemoveOld;window.document.onmouseup=window.document.onmouseupOld;}
function help_player_reload(videoSrc,videoType)
{var flashvars={videoSrc:videoSrc,videoType:videoType};var attributes={};var params={menu:"false",allowScriptAccess:"always",allowFullScreen:"true",wmode:"transparent"};var hasFlashPlayerVersion=swfobject.hasFlashPlayerVersion("9.0.18");if(hasFlashPlayerVersion)
{swfobject.embedSWF(MP_ROOTPATH+'members/mediaplayer.swf?id='+VERSION,"helpplayer","740","447","9.0.0",MP_ROOTPATH+"webtv/webtvswf/expressInstall.swf",flashvars,params,attributes);SWFID="player";}
else
{document.getElementById('no_flash_help').style.display="block";}}
function remove_help_player()
{document.getElementById('helpplayer').innerHTML="";}
function select_help_movie(movieName)
{if(navigator.appName.indexOf("Microsoft")!=-1){return window[movieName];}else{return document[movieName];}}
function stream_load_help(divid,vid){select_help_movie(divid).loadVideo(vid,"moodio");}
function show_help_text_box()
{document.getElementById('text_help_box').style.display='block';}
function hide_help_text_box()
{show_help_system=0;document.getElementById('text_help_box').style.display='none';}
function show_or_hide_help_icons(act)
{if(document.getElementById('help_span_videobox'))
{document.getElementById('help_span_videobox').style.display='none'}
if(document.getElementById('help_span_contact'))
{document.getElementById('help_span_contact').style.display=act}
if(document.getElementById('help_span_network'))
{document.getElementById('help_span_network').style.display=act}
if(document.getElementById('help_span_network1'))
{document.getElementById('help_span_network1').style.display=act}
if(document.getElementById('help_span_fan'))
{document.getElementById('help_span_fan').style.display=act}
if(document.getElementById('help_span_fan1'))
{document.getElementById('help_span_fan1').style.display=act}
if(document.getElementById('store_help_span'))
{document.getElementById('store_help_span').style.display='none'}
if(document.getElementById('agenda_help'))
{document.getElementById('agenda_help').style.display='none'}
if(document.getElementById('help_span_contact1'))
{document.getElementById('help_span_contact1').style.display=act}}
function hide_help_box()
{show_help_system=0;hide_tool_time=setTimeout("$('#text_help_box').fadeOut(1000)",500);}