var tab;
var isIE = false;
var req;
var n;
var videoID;
var videoIMG;
var videoTitle;
var videoViews;
var z;
var videoTitle;
var videoViews;

function loadXMLDoc(url) {
    
  
  
    
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = processReqChange;
        req.open("GET", url, true);
        req.send(null);
  
    } else if (window.ActiveXObject) {
        isIE = true;
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = processReqChange;
            req.open("GET", url, true);
            req.send();
        }
    }
}




function processReqChange() 
{
     
    if (req.readyState == 4) 
    {
         //alert(req.responseText);
        //exit();
        if (req.status == 200) 
        {
            
          
                    
          var response      =req.responseText.split("||"); 
          var field         =response[1]; 
         // alert(field);         
          var fieldList     =response[2];
          var fieldContacts =response[3];
          
          
          if((field !="")||(typeof field != "undefined")){          
              var fieldList     =response[2];
              var fieldContacts =response[3];
              
                                        
              
                   if(field =="Error"){alert(fieldList);}
          
                   if(field =="loadComments"){
                       YAHOO.example.container.panel2.show();
                       document.getElementById("floatTabContent").innerHTML=fieldList;
          
                      }
          
          
                    if(field =="getNewContacts"){
                       
                       document.getElementById('myContacts').value=fieldList;
                       document.getElementById("contactsArea").innerHTML=fieldList;
                      }
                      
                   if(field == "loadPlaylist"){ 
                      
                      var tabName = document.getElementById('tabInFocus').value;                         
                       document.getElementById(tabName).innerHTML=fieldList; 
                             
                      }
           
           
                   if(field == "downloadMovie"){
                 
                   var dwnFrame="<iframe src='"+fieldList+"' width=10 height=5 frameborder=0></iframe>";
                       document.getElementById("dwnIframe").innerHTML=dwnFrame;                   
                   }
                   
                   if((fieldContacts !="")&&(fieldContacts !="#")){
                       if(document.getElementById('myContacts').value ==""){
                        document.getElementById('myContacts').value=fieldContacts;
                        }
                      }
         
                    if(field =="playSharedVideo"){  
                      // alert(fieldContacts);                      
                       var tabName = document.getElementById('tabInFocus').value;                          
                        document.getElementById(tabName).innerHTML=fieldList;  
                        document.getElementById('myContacts').value="";
                      // document.getElementById('sharedVideo').value="";
                         playVideo(fieldContacts);               
                      }
              
                    if(field =="checkVideoStreamType"){ 
                       var videoId     =response[4];
                       var videoIMG    =response[5]; 
                       var relVideo    =response[6];
                       playVideoNow(fieldList,videoId,videoIMG);
                       
                     
                       
                       
                       if( relVideo !="null"){
                           //var relatedVids = document.getElementById('relatedVids').value;
                           //if(relatedVids !=""){
                           //document.getElementById(relatedVids).innerHTML="";                         
                           //}
                         
                     
                       var currentActiVideoDiv = document.getElementById('currentActiVideoDiv').value;
                       
                       
                     
                         if(videoIMG =="undefined"){}else{
                        
                       
                       //document.getElementById('relatedVids').value = videoId;
                       
                      //var loadingVideoDivId=videoId+'_loading';
                       //document.getElementById(loadingVideoDivId).innerHTML="";
                       //document.getElementById(currentActiVideoDiv).innerHTML="<br><br><font size=3>Related Videos:</font><br><br><div id='relatedVideos'>"+relVideo+"</div>";                  
                           if(relVideo !=""){
	                       
                              document.getElementById('related_video_div').innerHTML=relVideo; 
                             }
                        }
                       }
                                                                
                      }
                          
          }

          
          if(typeof field =="undefined"){
              var responses   = eval('(' + req.responseText + ')'); 
              var importForm  =responses.sms_contact_list;
              var error       =responses.error_msg2;
                  if((error !="")&&(error !="show_import_form")){
                    if(error =="Your mail contacts have been imported..."){
                       
                       getNewContacts();
                       alert(error);
                       document.getElementById('i_password').value="";
                       document.getElementById('i_email').value="";
                       
                      }else{
                                                         
                              getNewContacts();
                              alert(error);
                           }
                    }else{
                    document.getElementById("video").innerHTML="<center><br><font size=3 color=blue>Import Contacts:</font><br>"+importForm+"<br><br><table><td width=50></td><td><font color=red>Note:</font> Click <a href='javascript:void(0);' onclick='manualAddContact()'>here</a> to add more of your contacts manually.</td></table><br><br></center>";
                         }
          }
           
          
                     
                                         
        } else {
                  alert("There was a problem retrieving the XML data:\n" + req.statusText);
                }
    }
    
}





function submitWebSearch(){
  if(document.getElementById("belticWebSearch_").value !=""){
     document.searchForm.submit();
  }else{
        alert("No search string detected. !!");
  }
}



function clearSearchTextBox(){
  if(document.getElementById("belticWebSearch").value =="Web Search"){
     document.getElementById("belticWebSearch").value="";
  }
}



function populateSearchTextBox(){
  if(document.getElementById("belticWebSearch").value ==""){
     document.getElementById("belticWebSearch").value="Web Search";
  }
}



function getInput(){

 document.getElementById("belticWebSearch_").value =document.getElementById("belticWebSearch").value;

}


function manualAddContact(){

var add_sms_content  = "<br><table><tr><td>";
add_sms_content += "<table><tr><td align=left><b>Name: </b></td><td>";
add_sms_content += "<input type=text name='contact_name' value='' id='add_name'></td></tr>";
add_sms_content += "<tr><td align=left><b>Phone: </b></td><td>";
add_sms_content += "<input type=text name='phone' value='' id='add_phone'></td></tr>";
add_sms_content += "<tr><td align=left><b>Email: </b></td><td>";
add_sms_content += "<input type=text name='email' value='' id='add_email'></td></tr>";
add_sms_content += "<tr><td> </td><td align=right>";
add_sms_content += "<br><input type=submit name='submit' value='Add Contact' onclick=submit_new_contact()></td></tr></table>";
add_sms_content += "</td><td width=100 align=right><img src='http://beltic.com/go/_themes/main/space/img/img2/MSN.png'>";
add_sms_content += "</td></tr></table>";

document.getElementById("video").innerHTML="<center><br><font size=3 color=blue>Add Your Friends Contact details:</font><br><br>"+add_sms_content+"<br><br><br><table><td></td><td><font color=red>Note:</font> Click <a href='javascript:void(0);' onclick='getVideoContent(1)'>here</a> to resume video playback..</td></table><br><br><br></center>";

}



function submit_new_contact(){
var name=document.getElementById('add_name').value;
var phone=document.getElementById('add_phone').value;
var email=document.getElementById('add_email').value;

var check_email=validate_email(email);

if((name.length > 1)&&(phone.length <1)&&(email.length <1)){
alert("Error: Please fill in all the required fields..");
exit();
}

if(name.length < 1){
alert("Error: Please fill in all the required fields..");
exit();
}

if((name.length > 1)&&(phone.length >1)){
var t=get_time();
var url='ajax_new_phonebook.php?c=1&n='+name+'&p='+phone+'&e='+email+'&function=add&t='+t;
loadXMLDoc(url);
document.getElementById('add_name').value="";
document.getElementById('add_phone').value="";
document.getElementById('add_email').value="";
exit();
}

if((name.length > 1)&&(email.length >1)&&(check_email==true)){
var t=get_time();
var url='ajax_new_phonebook.php?c=1&n='+name+'&p='+phone+'&e='+email+'&function=add&t='+t;
loadXMLDoc(url);
document.getElementById('add_name').value="";
document.getElementById('add_phone').value="";
document.getElementById('add_email').value="";
exit();
}else{alert("Invalid E-mail ID");exit();}


if((name.length > 1)&&(phone.length >1)&&(email.length >1)&&(check_email==true)){
var t=get_time();
var url='ajax_new_phonebook.php?c=1&n='+name+'&p='+phone+'&e='+email+'&function=add&t='+t;
loadXMLDoc(url);
document.getElementById('add_name').value="";
document.getElementById('add_phone').value="";
document.getElementById('add_email').value="";
exit();
}else{alert("Invalid E-mail ID");exit();}

}






function validate_email(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		 
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		 
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		  
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		 
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		 
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		  
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		 
		    return false
		 }

 		 return true					
	}
	
	
	

function clearTextArea(){
 if(document.getElementById('myComment').value=="Submit New Comment:"){
    document.getElementById('myComment').value="";
 }
}


function checkTextArea(){
 if(document.getElementById('myComment').value==""){
    document.getElementById('myComment').value="Submit New Comment:";
 }
}







function checkFlashPlayerVersion(){
  var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
  if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	if(MM_PluginVersion >=6){ return 1;}else{return 0;}
   }
}



function shareVideo(){

var shareIds=document.getElementById('checkedIds').value;
var videoId=document.getElementById("currentVideo").value;
var t=get_time();
var url='getMediaAjax.php?function=shareVideo&videoId='+videoId+'&shareIds='+shareIds+'&t='+t;
loadXMLDoc(url);

document.getElementById("Area").innerHTML=document.getElementById('myContacts').value;
document.getElementById('checkedIds').value="";
}




function record_checked_ids(n){
if(document.getElementById(n).checked==true){
document.getElementById('checkedIds').value=document.getElementById('checkedIds').value +'-'+n;
}else{
var str= document.getElementById('checkedIds').value;
str=str.replace('-'+n,"");
document.getElementById('checkedIds').value=str;
}
}



function get_time()
{
var date = new Date();
var time = date.getTime();
return time;
}


function getNewContacts(){

var t=get_time();
var url='getMediaAjax.php?function=getNewContacts&t='+t;
loadXMLDoc(url);

}



function deleteFromFav(n){

var t=get_time();
var url='getMediaAjax.php?function=deleteFromFav&videoId='+n+'&t='+t;
loadXMLDoc(url);


}


function getVideoContent(n){
  var videoId = document.getElementById("currentVideo").value;
  var videoIMG = document.getElementById("currentVideoIMG").value;
  var videoTitle = document.getElementById("videoTitle").value;
  var videoViews = document.getElementById("videoViews").value;
  var tabInFocus = document.getElementById("tabInFocus").value;
  
  
  if(n =='1'){
      playVideo(videoId,videoIMG,videoTitle,videoViews,'lockDiv');     
  }
  if(n =='2'){
  
     viewComments(videoId,videoIMG);
  }
   
  if(n =='3'){
    if(tabInFocus =="movies"){
        addToFav(videoId,'','','');
     }else{
         addToFav(videoId,videoIMG,videoTitle,videoViews);
     }
  }
  if(n =='4'){
     if(tabInFocus =="movies"){
     downloadMovie(videoId);
     }else{
     downloadVideo(videoId);
     }
  }

}



function addComment(n){


  if(document.getElementById('myComment').value == "Submit New Comment:"){
    alert("Error: No comment has been submitted. Please try again..");
  }else{
        var comment=document.getElementById("myComment").value;
        var t=get_time();
        var url='getMediaAjax.php?function=addComment&videoId='+n+'&comment='+comment+'&t='+t;
   loadXMLDoc(url);
  }
  
}



function viewComments(n,videoIMG,videoTitle,videoViews){

document.getElementById("currentVideo").value=n;
document.getElementById("currentVideoIMG").value=videoIMG;
document.getElementById('videoTitle').value=videoTitle;
document.getElementById('videoViews').value=videoViews;

var t=get_time();
var url='getMediaAjax.php?function=viewComments&videoId='+n+'&t='+t;
loadXMLDoc(url);

}




function downloadVideo(n){

if(document.getElementById("user").value == ""){
  alert("This a members only service. Please login or signup..");
  exit();
 }

var file="http://www.youtubemp4.com/video/"+n+".mp4";
var dwnFrame="<iframe src='"+file+"' width=10 height=5 frameborder=0></iframe>";
document.getElementById("dwnIframe").innerHTML=dwnFrame;

}


function downloadMovie(n){

var t=get_time();
var url='getMediaAjax.php?function=downloadMovie&videoId='+n+'&t='+t;
loadXMLDoc(url);

}


function addToFav(videoID,videoIMG,videoTitle,videoViews){

var t=get_time();
var url='getMediaAjax.php?function=add2Fav&videoId='+videoID+'&videoIMG='+videoIMG+'&videoTitle='+videoTitle+'&videoViews='+videoViews+'&t='+t;
loadXMLDoc(url);

}



function closeVideo(){

document.getElementById("floatTabContent").innerHTML="";
YAHOO.example.container.panel2.hide();
}



function playRelatedVideo(n,videoIMG,videoTitle,videoViews){

document.getElementById('videoTitle').value=videoTitle;
document.getElementById('videoViews').value=videoViews;

var t=get_time();
var url='getMediaAjax.php?function=checkRelatedVideoStreamType&videoId='+n+'&videoIMG='+videoIMG+'&t='+t;
loadXMLDoc(url);

}


function loadMovielist(n){

var t=get_time();
var url='getMediaAjax.php?function=loadMovielist&videoId='+n+'&t='+t;
loadXMLDoc(url);

}



function playVideo(n,videoIMG,videoTitle,videoViews,z){

if(z !="lockDiv"){
document.getElementById('currentActiVideoDiv').value=n;
document.getElementById('videoTitle').value=videoTitle;
document.getElementById('videoViews').value=videoViews;
}

if(typeof videoIMG != "undefined"){
var loadingVideoDivId=n+'_loading';
//document.getElementById(loadingVideoDivId).innerHTML="<img src='ajax-loader.gif' >";
}

var t=get_time();
var url='getMediaAjax.php?function=checkVideoStreamType&videoId='+n+'&videoIMG='+videoIMG+'&t='+t;
loadXMLDoc(url);

}

var s;

function playVideoNow(s,n,videoIMG){

document.getElementById("currentVideo").value=n;
document.getElementById("currentVideoIMG").value=videoIMG;
YAHOO.example.container.panel2.hide();
YAHOO.example.container.panel2.show();


   var t=document.getElementById("floatTabContent").innerHTML;
  if(t.length < 1){
   var VContent="<table border=0><td width=420><div id='video'></div></td><td align=center> <br><font size=3>Realated Videos:</font><br>  <div id='related_video_div'> </div>  <div id='contactsArea'></div>  </td></table>";
   document.getElementById("floatTabContent").innerHTML=VContent;
  }


//var linkURL="http://beltic.com/v/media.php?getVideo="+n;
var linkURL="http://videos.beltic.com/index.php?getVideo="+n;
      
var so  ='<object type="application/x-shockwave-flash" allowScriptAccess="always" allowfullscreen="true" height="341" width="410" data="player.swf">';
    so +='<param name="allowScriptAccess" value="always" />';
    so +='<param name="allowfullscreen" value="true" />';
    so +='<param name="wmode" value="opaque" />';
    so +='<param name="movie" value="player.swf" />';
    
    //so +='<param name="flashvars" value="&file='+zq+'&image='+videoIMG+'&backcolor=999999&lightcolor=000000&screencolor=EEEEEE&bufferlength=4&autostart=true&stretching=exactfit&plugins=drelated-1&drelated.dxmlpath=relatedclips.php?videoId='+n+'&drelated.dposition=bottom&drelated.dskin=grayskin.swf&drelated.dtarget=_self" />';
   
    if(s == "mp4"){
           var zq = "http://www.youtubemp4.com/video/"+n+".mp4";  
           alert(zq);         
              so +='<param name="flashvars" value="&file='+zq+'&image='+videoIMG+'&backcolor=999999&lightcolor=000000&screencolor=EEEEEE&bufferlength=4&autostart=true&stretching=exactfit&plugins=viral-1&viral.callout=none&viral.onpause=false&viral.link='+linkURL+'&logo=http://beltic.com/v/logo.png"/>';     
      }else{
            var zq ="http://www.youtube.com/watch?v="+n; 
            alert(zq);             
              so +='<param name="flashvars" value="&file='+zq+'&image='+videoIMG+'&backcolor=999999&lightcolor=000000&screencolor=EEEEEE&bufferlength=4&autostart=true&stretching=exactfit&plugins=viral-1&viral.callout=none&viral.onpause=false&viral.link='+linkURL+'/>';    
      }
        
    so +='</object>';


if(checkFlashPlayerVersion()>0){
document.getElementById("video").innerHTML=so;

   if(document.getElementById('myContacts').value !=""){
      document.getElementById("contactsArea").innerHTML=document.getElementById('myContacts').value;
   }else{

        var Ad="<br><font color=red size=3><b>Note:</b></font><br>To download, Comment or Share a video with your friends, you will need to <a href='http://beltic.com'>Login</a> to your Beltic account.<br><br> Not yet a member? <a href='http://beltic.com/go/join.php?cmd=login'>SignUp</a>";
        document.getElementById("contactsArea").innerHTML="<div id='contacts_'><table><td width=140>"+Ad+"</td></table></div><br>";
   }
}else{
var error="<table><td width=380 align=left><br><br><font size=3 color=red>Note:</font><br>You currently have an old Adobe FlashPlayer version installed on your computer.<br>Please click <a href='http://get.adobe.com/flashplayer/thankyou/'>here</a> or on the link below to upgrade to the latest Adobe FlashPlayer So as to view this and more videos..<br><br><a href='http://get.adobe.com/flashplayer/thankyou/'><img src='get_adobe_flash_player.png'></a></td></table>";
document.getElementById("video").innerHTML=error;
}

}


var zq;

function playMovie(videoID,zq,videoIMG){


document.getElementById("currentVideo").value=videoID;
document.getElementById("currentVideoIMG").value=videoIMG;
YAHOO.example.container.panel2.hide();
YAHOO.example.container.panel2.show();

var VContent="<table border=0><td width=420><div id='video'></div></td><td><div id='contactsArea'></div></td></table>";

document.getElementById("floatTabContent").innerHTML=VContent;


//var linkURL="http://beltic.com/v/media.php?getVideo="+videoID;

      //zq=escape(zq);
     // alert(zq);
var so  ='<object type="application/x-shockwave-flash" allowScriptAccess="always" allowfullscreen="true" height="341" width="410" data="player.swf">';
    so +='<param name="allowScriptAccess" value="always" />';
    so +='<param name="allowfullscreen" value="true" />';
    so +='<param name="wmode" value="opaque" />';
    so +='<param name="movie" value="player.swf" />';
    
    so +='<param name="flashvars" value="&file='+zq+'&image='+videoIMG+'&backcolor=999999&lightcolor=000000&screencolor=EEEEEE&bufferlength=4&autostart=true&stretching=exactfit&logo=http://beltic.com/v/logo.png" />';
            
    //so +='<param name="flashvars" value="&file='+zq+'&image='+videoIMG+'&backcolor=999999&lightcolor=000000&screencolor=EEEEEE&bufferlength=4&autostart=true&stretching=exactfit&plugins=viral-1&viral.callout=none&viral.onpause=false&viral.link='+linkURL+'&logo=http://beltic.com/v/logo.png"/>';     
            
    so +='</object>';


if(checkFlashPlayerVersion()==1){
document.getElementById("video").innerHTML=so;

   if(document.getElementById('myContacts').value !=""){
      document.getElementById("contactsArea").innerHTML=document.getElementById('myContacts').value;
   }else{

        var Ad="<br><font color=red size=3><b>Note:</b></font><br>To download, Comment or Share a video with your friends, you will need to <a href='http://beltic.com'>Login</a> to your Beltic account.<br><br> Not yet a member? <a href='http://beltic.com/go/join.php?cmd=login'>SignUp Today</a>";
        document.getElementById("contactsArea").innerHTML="<div id='contacts_'><table><td width=140>"+Ad+"</td></table></div><br><br><br><br><br><br><br><br><br><br><br>";
   }
}else{
var error="<table><td width=380 align=left><br><br><font size=3 color=red>Note:</font><br>You currently have an old Adobe FlashPlayer version installed on your computer.<br>Please click <a href='http://get.adobe.com/flashplayer/thankyou/'>here</a> or on the link below to upgrade to the latest Adobe FlashPlayer So as to view this and more videos..<br><br><a href='http://get.adobe.com/flashplayer/thankyou/'><img src='get_adobe_flash_player.png'></a></td></table>";
document.getElementById("video").innerHTML=error;
}



}


function loadPlaylist(tab)
{


var x=document.getElementById('myContacts').value;
var y=document.getElementById('sharedVideo').value;
var z=document.getElementById('videoElements').value;

if(z == ""){
loadVideoElements();
}
var prevTabInFocus=document.getElementById('tabInFocus').value;
                   document.getElementById(prevTabInFocus).innerHTML="";
                   document.getElementById('tabInFocus').value=tab;
var t=get_time();
if((x == "")&&(y == "")){
var url='getMediaAjax.php?function=loadPlaylist&tab='+tab+'&getEmailContacts=true&t='+t;
}else{
var url='getMediaAjax.php?function=loadPlaylist&tab='+tab+'&sharedVideo='+y+'&t='+t;
}
loadXMLDoc(url);

}






function loadMenuPlaylist(tab)
{

 var prevTabInFocus=document.getElementById('tabInFocus').value; 
                   document.getElementById(prevTabInFocus).innerHTML="";
                   document.getElementById('tabInFocus').value=tab;
                   document.getElementById('relatedVids').value="";                   
                   document.getElementById('currentActiVideoDiv').value="";
 var t=get_time();
 if(tab =="viewMyFavouriteVideos"){
  var url='getMediaAjax.php?function=viewMyFavouriteVideos&t='+t;
   }else{
         var url='getMediaAjax.php?function=loadPlaylist&tab='+tab+'&t='+t;
        }
 loadXMLDoc(url);

}




function loadMyFavlist(n){

 var t=get_time();
 var url='getMediaAjax.php?function=viewMyFavouriteVideos&videoId='+n+'&t='+t;
 loadXMLDoc(url);

}




function loadPlaylist_(tab,n)
{

var t=get_time();
var url='getMediaAjax.php?function=loadPlaylist&tab='+tab+'&n='+n+'&t='+t;
loadXMLDoc(url);
}





function clearSearchField(){
  if(document.getElementById('searchTabString').value == "Video Search"){
     document.getElementById('searchTabString').value="";
  }

}


function clearSearchField_(){
  if(document.getElementById('searchTabString').value == ""){
     document.getElementById('searchTabString').value="Video Search";
  }

}


function submitSearchTabString(){

if((document.getElementById('searchTabString').value !="")||(document.getElementById('searchTabString').value =="Video Search")){
var s=escape(document.getElementById('searchTabString').value);
var t=get_time();
var url='getMediaAjax.php?function=searchVideo&tab='+s+'&t='+t;
loadXMLDoc(url);
document.getElementById('searchTabString').value="Video Search";
document.getElementById('relatedVids').value="";                    
document.getElementById('currentActiVideoDiv').value="";
}else{
alert("No search Video string detected..");
}
}



function searchVideo()
{

document.getElementById('relatedVids').value="";                    
document.getElementById('currentActiVideoDiv').value=""; 
var s=escape(document.getElementById('searchVideoString').value);
var t=get_time();
var url='getMediaAjax.php?function=searchVideo&tab='+s+'&t='+t;
loadXMLDoc(url);
document.getElementById('searchVideoString').value="";
}


function searchVideo_(tab,n)
{

document.getElementById('relatedVids').value="";                    
document.getElementById('currentActiVideoDiv').value="";
var tab=escape(tab);
var t=get_time();
var url='getMediaAjax.php?function=searchVideo&tab='+tab+'&n='+n+'&t='+t;
loadXMLDoc(url);
}



function getTabInFocus(tab)
{
  document.getElementById(tab).innerHTML="<center><br><br>Loading "+tab+" video List. Please Hold:<br><br><img src='ajax-loader.gif' ><br><br></center>";

  loadMenuPlaylist(tab);
}




function getImportForm(){

var t=get_time();
var url='ajax_new_phonebook.php?c=1&import_contacts_form=1&t='+t;
loadXMLDoc(url);
}




function get_new_import_form(n){

var t=get_time();
var url='ajax_new_phonebook.php?c=1&import_contacts_form=1&lib='+n+'&t='+t;
loadXMLDoc(url);

}




function import_contacts_now(){

var lib=document.getElementById('lib').value;
var pass=document.getElementById('i_password').value;
var email=document.getElementById('i_email').value;

var t=get_time();
var url='ajax_new_phonebook.php?c=1&import_contacts_form=1&lib='+lib+'&pass='+pass+'&email='+email+'&t='+t;
loadXMLDoc(url);
}