function fb_show(path)
{
	//document.getElementById('invitation').value='1';
	//var $noCon = jQuery.noConflict(true);
	jQuery.facebox({ ajax: path });
}
function mouseon(imgnm)

{

  document.images[imgnm].src="images/over/"+ imgnm;

}

	

function mouseOff(imgnm)

{

  

	document.images[imgnm].src="images/out/"+ imgnm ;

}

function select_deselectAll(chkVal, idVal)
{
	var doc = document.frm;
	for (i=0; i<doc.length; i++)
	{
		if (idVal.indexOf ('selectall') != -1) 
		{
			if(chkVal == true) 
			{
				doc.elements[i].checked = true;
			} 
			else 
			{
				doc.elements[i].checked = false;
			}		
		} 
		else if (idVal.indexOf ('checkAll') != -1)
		{
			if(doc.elements[i].checked == false) 
			{
				doc.elements[0].checked = false;
			} 			
		}
	}	
}

function checkAll(status)
{
	for(i=0; i<document.frm.elements.length; i++)
	{
		if(document.frm.elements[i].type=='checkbox')
		document.frm.elements[i].checked = status;
	}
		
}

function uncheck_check_box()
{
	var value = document.getElementById('selectall').checked;
	
	if(value==true)
	{
		document.getElementById('selectall').checked=false;
	}
}

function chk_delete(status)
{//alert(status);
	var i=0;
	elem=document.getElementsByName('chk[]').length;//alert(elem);
	for(i=0;i<elem;i++)
	{
		document.getElementById('chk'+i).checked=status;
	}
}

function chk_unread(status)
{//alert(status);
	var i=0;
	elem=document.getElementsByName('chk_unread[]').length;//alert(elem);
	for(i=0;i<elem;i++)
	{
		document.getElementById('chk_unread'+i).checked=status;
	}
}

function chk_confirm(status)
{//alert(status);
	var i=0;
	elem=document.getElementsByName('chk_unread[]').length;//alert(elem);
	for(i=0;i<elem;i++)
	{
		if(document.getElementById('chk_unread'+i).disabled!=true)
		document.getElementById('chk_unread'+i).checked=status;
	}
}

function uncheck_delete_box()
{
	var value = document.getElementById('selectall').checked;
	
	if(value==true)
	{
		document.getElementById('selectall').checked=false;
	}
}

function uncheck_unread_box()
{
	var value = document.getElementById('selectunread').checked;
	
	if(value==true)
	{
		document.getElementById('selectunread').checked=false;
	}
}

function del_validation()
{

 i=0;j=0;y=0;
 	var frm=document.frm;
	for(i=0;i<frm.elements.length;i++)
	{//alert("g");
		if(frm.elements[i].type=='checkbox' && frm.elements[i].checked==true)
		y++;
	}
	if(y>0)
	{
		ans=confirm("Are you sure you want to delete?");
			if (ans) 
			frm.submit();
			else 
				return false;
	}
	else 
	{
		alert("Select at least one record to delete!"); return false;
	}	
}

function validateDelete()
{
	var len=document.frm.elements.length;
	var i=0, j=0;
	for(i=0;i<len;i++)
	if(document.frm.elements[i].type=='checkbox' && document.frm.elements[i].checked==true)
		j++;
	if(j==0 && document.frm.checkAll.checked==true)
	{
		
		alert(atleastOneToDelete);
		return false;	
	}
	else if(j>0)
	{
			
		return confirm(makeSureToDelete);

	}
	else 
	{
		alert(atleastOneToDelete);
		return false;
	}	
}




function add_need(id1,id2)
{
	if(document.getElementById(id1).value!=0)
	{
		if(document.getElementById(id2).value!='')
		{
			document.getElementById(id2).value+=","+document.getElementById(id1).value;
		}
		else
		{
			document.getElementById(id2).value=document.getElementById(id1).value;
		}
	}
	else
	{
		document.getElementById(id2).value='';
	}
}

// function open_network_sublink()
// {
// 	if(document.getElementById('netwok_sublink').style.display=='none')
// 	{
// 		document.getElementById('netwok_sublink').style.display='block';
// 	}
// 	else if(document.getElementById('netwok_sublink').style.display=='block')
// 	{
// 		document.getElementById('netwok_sublink').style.display='none';
// 	}
// 	
// }

function open_sublink(id)
{
	if(document.getElementById(id).style.display=='none')
	{
		document.getElementById(id).style.display='';
	}
	else if(document.getElementById(id).style.display=='')
	{
		document.getElementById(id).style.display='none';
	}
	
}

/*------------------ POPUP WINDOW  -----------------------------*/

function popup(url)
{
	//alert(url);
	var width = 500;
	var height = 380;
	var left = (screen.width - width)/2;
	var top = (screen.height - height)/2;
	
	window.open(url,'_blank','toolbar=no,scrollbars=no,width='+width+',height='+height+',top='+top+',left='+left+',resizable=no,location=no');
}

function pptPopup(url,w,h)
{
	//alert(w);
	//var y= 20;
	if(w<300)
		w=300;
	if(h<300)
		h=250;
	var width = w;//alert(width);
	var height = h;
	var left = (screen.width - width)/2;
	var top = (screen.height - height)/2;
	
	self.open(url,'PptSlideShow','toolbar=no,scrollbars=yes,width='+width+',height='+height+',top='+top+',left='+left+',resizable=no,location=no');
}
//====------------Function to join two IDs--------------==========/
function multi_id2(id1,id2)

{

	  var id_val= id1+'|'+id2;

	  return id_val;

}
//====------------Function to join two Values--------------==========/
function multi_val2(val1,val2)

{

	  var vals= val1+'|'+val2;

	  return vals;

}
function multi_val3(val1,val2,val3)

{

	  var vals= val1+'|'+val2+'|'+val3;

	  return vals;

}
//====---------Calling ajax for sending invitttion,accept rejection-------===/ 
function send_invitation(user_id,member_id,divId)
{
	var id_vals	= 'sent_invitation_msg'+'|'+divId;
	var vals=user_id+'|'+member_id;
	showContent('adm-network.php',vals,1,id_vals,'loading_img');
}
function delete_Invitation(user_id,member_id,divId)
{//alert(divId);
	var conf_msg	= window.confirm('Are you sure you want to delete?');
	if(conf_msg==true)
	{
		var id_vals	= 'sent_invitation_msg'+'|'+divId;
		var vals=user_id+'|'+member_id+'|'+divId;
		showContent('adm-network.php',vals,12,id_vals,'loading_img');
	}
}

function accept_invitation(invite_id,inviter_id,user_id,divId)
{//alert(inviter_id);return false;
	//var id_vals	= 'invitation_msg'+'|'+'show_invitation'+'|'+'no_of_invitation';
	var conf_msg	= window.confirm('Are you sure you want to accept?');
	if(conf_msg==true)
	{
		var id_vals	= 'sent_invitation_msg'+'|'+divId;
		var vals = invite_id+'|'+inviter_id+'|'+user_id;
		showContent('adm-network.php',vals,2,id_vals,'loading_img');
	}
	//window.location.reload();
}

function reject_invitation(invite_id,inviter_id,divId)
{
	//var id_vals	= 'invitation_msg'+'|'+'show_invitation'+'|'+'no_of_invitation';
	var conf_msg	= window.confirm('Are you sure you want to reject?');
	if(conf_msg==true)
	{
		var id_vals	= 'sent_invitation_msg'+'|'+divId;
		var vals = invite_id+'|'+inviter_id;
		showContent('adm-network.php',vals,3,id_vals,'loading_img');
	}
	//window.location.reload();
}

function sendEboothInvitation(user_id,member_id,req_msg)
{
	var id_vals	= 'sent_invitation_msg'+'|'+req_msg;
	var vals	= user_id+'|'+member_id+'|'+req_msg;
	showContent('ajax-invitation.php',vals,8,id_vals,'loading_img');
}

function sendContactInvitation(user_id,member_id,req_msg)
{//alert(req_msg);return false;
	var id_vals	= 'sent_invitation_msg'+'|'+req_msg;
	var vals	= user_id+'|'+member_id+'|'+req_msg;
	showContent('ajax-invitation.php',vals,13,id_vals,'loading_img');
}

function deleteEboothInvitation(user_id,member_id,req_msg)
{
	var id_vals	= 'sent_invitation_msg'+'|'+req_msg;
	var vals	= user_id+'|'+member_id+'|'+req_msg;
	showContent('ajax-invitation.php',vals,9,id_vals,'loading_img');
}

function deleteContactInvitation(user_id,member_id,req_msg)
{//alert(user_id);
	var id_vals	= 'sent_invitation_msg'+'|'+req_msg;
	var vals	= user_id+'|'+member_id;
	showContent('ajax-invitation.php',vals,14,id_vals,'loading_img');
}

function product_made(product,prod_id)
{
	var prod=document.getElementById('made_sub_sub_id').value;
	var vals=prod+'|'+prod_id;
	showContent('adm-product-info.php',vals,2,'need_arr','');
}

function msg_history_pagination(to,page)

{
	var vals=to+'|'+page;
	showContent('adm-email.php', vals,11, 'msg_history', '')
}

function test(t,n,section_id)
{
//alert(t);
	var vals='';
	if(n==1)
	{
		var need=document.getElementById('user_needs').value;
		var sub_cat=document.getElementById('made_sub_id').value;
		for(j=0;j<t;j++)
		{
			var no_items=document.getElementById('made_sub_sub_id'+j);//alert(no_items.value);
			if(no_items.checked==true)
			{
				if(vals=="")
				vals+=no_items.value;
				else
				vals+=","+no_items.value;
			}
		}
		
			showContent('adm-personal-info.php',multi_val3(vals,need,sub_cat),'2','need_arr','');
		
		
	}
	if(n==2)
	{
		var need=document.getElementById('user_interests').value;
		var sub_cat=document.getElementById('interest_sub_id').value;
		for(j=0;j<t;j++)
		{
			var no_items=document.getElementById('interest_sub_sub_id'+j);//alert(no_items.value);
			if(no_items.checked==true)
			{
				if(vals=="")
				vals+=no_items.value;
				else
				vals+=","+no_items.value;
			}
		}
		
		showContent('adm-personal-info.php',multi_val3(vals,need,sub_cat),'3','interest_arr','');
		
		
	}
	if(n==3)
	{
		var need=document.getElementById('user_specialities').value;
		var sub_cat=document.getElementById('specialities_sub_id').value;
		for(j=0;j<t;j++)
		{
			var no_items=document.getElementById('specialities_sub_sub_id'+j);//alert(no_items.value);
			if(no_items.checked==true)
			{
				if(vals=="")
				vals+=no_items.value;
				else
				vals+=","+no_items.value;
			}
		}
		
		showContent('adm-personal-info.php',multi_val3(vals,need,sub_cat),'4','specialities_arr','');
		
		
	}
	if(n==4)
	{
		var comp_id=section_id;
		var sub_cat=document.getElementById('made_sub_id').value;
		for(j=0;j<t;j++)
		{
			var no_items=document.getElementById('made_sub_sub_id'+j);//alert(no_items.value);
			if(no_items.checked==true)
			{
				if(vals=="")
				vals+=no_items.value;
				else
				vals+=","+no_items.value;
			}
			
		}
		showContent('adm-company-info.php',multi_val3(vals,comp_id,sub_cat),'2','need_arr','');
		
	}
	if(n==5)
	{
		var product_id=section_id;
		var sub_cat=document.getElementById('made_sub_id').value;
		for(j=0;j<t;j++)
		{
			var no_items=document.getElementById('made_sub_sub_id'+j);//alert(no_items.value);
			if(no_items.checked==true)
			{
				if(vals=="")
				vals+=no_items.value;
				else
				vals+=","+no_items.value;
			}
		}
		showContent('adm-product-info.php',multi_val3(vals,product_id,sub_cat),'2','need_arr','');
		
	}
}

function validaterenewpkg()
{
	var len=document.frm_memb.elements.length;
	var i=0, j=0;
	for(i=0;i<len;i++)
	if(document.frm_memb.elements[i].type=='checkbox' && document.frm_memb.elements[i].checked==true)
		j++;
	if(j==0 && document.frm_memb.checkAll.checked==true)
	{
		
		alert(atleastOneToRENEW);
		return false;	
	}
	else if(j>0)
	{
			
		return confirm(makeSureToRENEW);

	}
	else 
	{
		alert(atleastOneToRENEW);
		return false;
	}	
}

//---------------------------Product Contact-----------------------------------//
function get_radio_value(cnt,user_id,prod_id)
{

//alert(cnt);
	if(cnt==1)
	{
		var rad_val=document.getElementById('contact_val').value;//alert(rad_val);
		var vals    = rad_val+'|'+user_id+'|'+prod_id;//alert(vals);
		showContent('adm_contactus.php',vals,5,'prod_cont_div','');
	}
	else
	{
		for (var i=0; i < document.form1.contact.length; i++)
		{
			if (document.form1.contact[i].checked)
			{
				var rad_val = document.form1.contact[i].value;
				var vals    = rad_val+'|'+user_id+'|'+prod_id;//alert(vals);
				showContent('adm_contactus.php',vals,5,'prod_cont_div','');
			}
		}
	}
}

//---------------------------Producty Property functions-----------------------//
function checkPropertyList(family_id)
{
//alert(family_id);
	
	var to=document.getElementById('list2');
	var prods=document.getElementById('validate_prod_id');
	if((to.options.length!='' || to.options.length!=0) && (prods.value==''))
	{
		alert("Firstly save the list you have made!");
		return false;
	}
	else
	{
		document.getElementById('family_id').value=family_id;
		showContent('adm-product-info.php',family_id,'8','list1','');
	}
}

//-----------------------------jquery rounded corner-----------------------
function Corner()
{
$(function(){
	// shorthand for $(document).ready() BTW
        $('div.demo').each(function() {
			// The text of the paragraphs in the rounded divs is also the
			// jQuery code needed to create that effect. Cosmic.
             eval($('p', this).text());
        });
	
	$('div.rounded').each(function() {
			// The text of the paragraphs in the rounded divs is also the
			// jQuery code needed to create that effect. Cosmic.
             eval($('p', this).text());
        });
	$('div#conf_div').each(function() {
			// The text of the paragraphs in the rounded divs is also the
			// jQuery code needed to create that effect. Cosmic.
             eval($('p', this).text());
        });
	$('div.head_main_row_over').each(function() {

			// The text of the paragraphs in the rounded divs is also the

			// jQuery code needed to create that effect. Cosmic.

             eval($('p', this).text());

        });
	$('div.side_menu_bg').each(function() {

			// The text of the paragraphs in the rounded divs is also the

			// jQuery code needed to create that effect. Cosmic.

             eval($('p', this).text());

        });
        $('#main p').wrap("<code></code>");
});
}

function fb_hide()
{
	window.onmousewheel = document.onmousewheel = wheelOn;
	jQuery.facebox.close();
}

function wheelOn(event)
{
    var delta = 0;
    if (!event) /* For IE. */
      event = window.event;
    if (event.wheelDelta) { /* IE/Opera. */
      delta = event.wheelDelta/120;
      /* In Opera 9, delta differs in sign as compared to IE. */
      if (window.opera)
        delta = -delta;
    } else if (event.detail) { /** Mozilla case. */
      // delta = -event.detail/3;
    }
    if (event.preventDefault)
    {
      //event.preventDefault();
      event.returnValue = true;
    }
    return true;
}
function SetUser(USER_ID,USER_NAME,flg,j,chkVal,idVal)
{
	var contact=document.getElementById('contact_id'+j);
	var br=document.getElementById('br_id'+j);
	var user=document.getElementById('u_id'+j);
	
	if(flg==1)
	{
		var vals='';
		document.getElementById('to_name').value=USER_NAME;
		document.getElementById('to_id').value=USER_ID;
		vals=USER_ID+'|'+0;
		showContent('adm-email.php',vals,11,'msg_history','');
		
	//tb_remove();
	fb_hide();
	}
	else if(flg==3)
	{
			if(document.getElementById('bcc_name').value=='')
				document.getElementById('bcc_name').value=USER_NAME;
			else
				document.getElementById('bcc_name').value+=","+USER_NAME;
			
			if(document.getElementById('bcc_id').value=='')
				document.getElementById('bcc_id').value=USER_ID;
			else
				document.getElementById('bcc_id').value+=","+USER_ID;
		
		//document.getElementById('bcc_id').value=USER_ID;
	}
	else if(flg==2)
	{
			var frm = document.frm_cl;
			if(chkVal == true)
			{
				if(document.getElementById('cc_name').value=='')
					document.getElementById('cc_name').value=USER_NAME+"";
				else
				{
					document.getElementById('cc_name').value+=","+USER_NAME;
				}
				
				if(document.getElementById('cc_id').value=='')
					document.getElementById('cc_id').value=USER_ID+"";
				else
				{
					document.getElementById('cc_id').value+=","+USER_ID;
				}
 			}
			else
			{
				document.getElementById('cc_name').value='';
				document.getElementById('cc_id').value	='';
			}
	}
	
}
function closeThickBox()
{
	tb_remove();
}
/*------------------Function for BC Preview----------------------------*/
function bc_preview(username)
{
	fb_show('business-card-step2.php');
}
function test_preview()
{
	//Boxy.load('test1.php',{closeable:true});
// 	Boxy.load('test1.php',{closeable:true});
	fb_show('test1.php');
}
function eb_preview(username)
{
	fb_show('ebooth-prev.php');
}
function bc_template_preview(template)
{
	tb_show('BC Preview','bc-template-prev.php?tmp_val='+template+'&amp;height=435&amp;width=875',false);
}
function br_contact(username)
{
	tb_show('','my-contact-list.php?height=298;width=971',false);
}
function others_bc_preview(username,uid)
{
	fb_show('business-card-step3.php?u_id='+uid);
}
function others_bc_BR(username,uid,page,section)
{
	fb_show('business-card-step2.php?uid='+uid+'&page='+page+'&section='+section);
}
function bookmarkPreview(bcard,bflag)
{
	tb_show('Bookmarked Page','bookmarked-page.php?bflagset='+bflag+'&bcardId='+bcard+'&amp;height=443&amp;width=875',false);
}
function ShowBRSortsearch(sortVal)
{
//alert(sortVal);
	var valIds	= 'user_list'+'|'+'main_content_div';
	showContent('pending-br-list.php',sortVal,1,valIds,'');
}
function ShowBRSortReceived(sortVal)
{
//alert(sortVal);
	var valIds	= 'user_list'+'|'+'main_content_div';
	showContent('received-br-list.php',sortVal,1,valIds,'');
}
function Showsearch()
{
	showContent('br-list-ajax.php','',1,'main_content_div','');
	//showContent('pending-br-list.php','',1,'main_content_div','');
}
function ShowBRSentsearch()
{
// 	showContent('br-list-ajax.php','',1,'main_content_div','');
	var valIds	= 'user_list'+'|'+'main_content_div';
	showContent('pending-br-list.php','',1,valIds,'');
}

function selectBRUser(flag)
{
	showContent('select-br-user.php',flag,1,'main_content_div','');
}
function selectLoungeUser(flag)
{
	showContent('select-lounge-user.php',flag,1,'main_content_div','');
}
function selectContactUser(flag)
{
	showContent('select-user-ajax-reset.php',flag,1,'main_content_div');
}
function eBoothUserSearch(userId,userType)
{
	var vals=userId+'|'+userType;
	showContent('ajax-invitation.php',vals,7,'main_content_div','');
}
function contactUserSearch()
{
	//var vals=userId+'|'+userType;
	//showContent('ajax-invitation.php',vals,12,'main_content_div','');
	showContent('contact-list-ajax.php','',1,'main_content_div','');
}
function contactSelectSearch(flag)
{
	//var vals=userId+'|'+userType;
	//showContent('ajax-invitation.php',vals,12,'main_content_div','');
	showContent('select-user-ajax-reset.php',flag,1,'main_content_div','');
}
function loungeSelectSearch(flag)
{
	//var vals=userId+'|'+userType;
	//showContent('ajax-invitation.php',vals,12,'main_content_div','');
	showContent('select-lounge-user.php',flag,1,'main_content_div','');
}
function ShowBrInvitation()
{
	//showContent('ajax-invitation.php','',2,'main_content_div','');
	var valIds	= 'user_list'+'|'+'main_content_div';
	showContent('received-br-list.php','',1,valIds,'');
}
function ShowBrXML()
{
	showContent('ajax-invitation.php','',18,'main_content_div','');
}
function ShowContactXML()
{
	showContent('ajax-invitation.php','',19,'main_content_div','');
}
function ShoweBoothInvitation(userId,userType)
{
	var vals=userId+'|'+userType;
	showContent('ajax-invitation.php',vals,6,'main_content_div','');
}
function ShowContactInvitation(userId,userType)
{
	var vals=userId+'|'+userType;
	showContent('ajax-invitation.php',vals,15,'main_content_div','');
}
function accept_ebooth_invitation(invite_id,inviter_id,status_div)
{
	var id_vals	= 'invitation_msg'+'|'+status_div;
	var vals = invite_id+'|'+inviter_id+status_div;
	showContent('ajax-invitation.php',vals,10,id_vals,'loading_img');
}

function accept_contact_invitation(invite_id,inviter_id,status_div)
{
	var id_vals	= 'invitation_msg'+'|'+status_div;
	var vals = invite_id+'|'+inviter_id+status_div;
	showContent('ajax-invitation.php',vals,16,id_vals,'loading_img');
}

function reject_ebooth_invitation(invite_id,inviter_id,status_div)
{
	var id_vals	= 'invitation_msg'+'|'+status_div;
	var vals = invite_id+'|'+inviter_id+status_div;
	showContent('ajax-invitation.php',vals,11,id_vals,'loading_img');
}

function reject_contact_invitation(invite_id,inviter_id,status_div)
{
	var id_vals	= 'invitation_msg'+'|'+status_div;
	var vals = invite_id+'|'+inviter_id+status_div;
	showContent('ajax-invitation.php',vals,17,id_vals,'loading_img');
}

function SearchContent(userId)
{
// 	var val1= document.getElementById('search_by').value;
	var val1= document.getElementById('search_txt').value;//alert(val1);
	var vals=val1+'|'+userId;
 	showContent('br-list-ajax-search.php',vals,1,'search_content','');
	//showContent('pending-br-list-search.php',vals,1,'search_content','');
}
function SearchBRSentContent(userId)
{
// 	var val1= document.getElementById('search_by').value;
	var val1= document.getElementById('search_txt').value;//alert(val1);
	var vals=val1+'|'+userId;
// 	showContent('br-list-ajax-search.php',vals,1,'search_content','');
	showContent('pending-br-list-search.php',vals,1,'search_content','');
}
function SearchContactContent(userId)
{
	var val1= document.getElementById('search_txt').value;
	var vals=val1+'|'+userId;
	showContent('contact-list-ajax-search.php',vals,1,'search_content','');
}
function SearchBRContent(userId,flag)
{
	var val1= document.getElementById('search_txt').value;
	var vals=val1+'|'+userId+'|'+flag;
	showContent('select-br-search.php',vals,1,'search_content','');
}
function SearchLoungeContent(userId,flag)
{
	var val1= document.getElementById('search_txt').value;
	var vals=val1+'|'+userId+'|'+flag;
	showContent('select-lounge-search.php',vals,1,'search_content','');
}
function SearchInboxContact(userId,flag)
{
// 	var val1= document.getElementById('search_by').value;
	var val1= document.getElementById('search_txt').value;
	var vals=val1+'|'+userId+'|'+flag;
// 	showContent('ajax-invitation.php',vals,4,'search_content','');
	showContent('select-contact-search.php',vals,1,'search_content','');
}
function SearchProductContact(userId,prodId,flag)
{
	//var val1= document.getElementById('search_by').value;
	var val2= document.getElementById('search_txt').value;
	var vals=val2+'|'+userId+'|'+prodId+'|'+flag;
	showContent('ajax-invitation.php',vals,5,'search_content','');
}
/*-----------------Function for eBooth/Product Link -------------*/
function eBooth_Pro_preview(compname)
{
	tb_show(compname,'ebooth-prev.php?height=443&amp;width=875',false);
}
/*-----------------Function For Adding More Images,Videos & Documents----------------*/
function addAtt()
{
	var root=document.getElementById('ADD_MORE_DIV');
	if(document.getElementById('remove').style.display='none')
	{
		document.getElementById('remove').style.display='';
	}
	var numi = document.getElementById('tot_elem');
	var num = (parseInt(document.getElementById('tot_elem').value) -1)+ 2;
	numi.value = parseInt(num);
	var fileID = 'file'+num;
	var textID = 'img_name'+num;
	var descID = 'img_desc'+num;
	var divID  = 'container'+num;
	var main=cE('div');
	cA(main,'id',divID);//alert(divID);
	var Names= new Array('Image Title','Image Desc','Upload Image');//alert(Names.length);
	for(var i=0;i<Names.length;i++)
	{//alert(fileID);
		var oR = cE('div');
		var oC = cE('div');
		var oD = cE('div');
		var oE = cE('div');
		oC.align='right';
		oC.style.color='#000000';
		oD.align='center';
		oD.style.color='#000000';
		if(Names[i]=='Upload Image' || Names[i]=='Image Title')
		var oI = cE('input');
		else
		var oI = cE('textarea');
		cA(oR,'class','ad_art_info_div pdd_top10');
		cA(oC,'class','ad_doc_info_divC1');
		cA(oD,'class','ad_doc_info_divC2');
		cA(oE,'class','ad_doc_info_divC3');
		if(Names[i]=='Upload Image')
		{
			cA(oI,'type','file');
			cA(oI,'name','file[]');
			cA(oI,'id',fileID);
			oC.appendChild(document.createTextNode(Names[i]));	
			oD.appendChild(document.createTextNode(' :'));
			oR.appendChild(oC);
			oR.appendChild(oD);oR.appendChild(oI);
			main.appendChild(oR);
		}
		else if(Names[i]=='Image Title')
		{
			cA(oI,'type','text');
			cA(oI,'name','img_name[]');
			cA(oI,'id',textID);
			cA(oI,'class','txt_box');
			oC.appendChild(document.createTextNode(Names[i]));	
		oD.appendChild(document.createTextNode(' :'));
		oE.appendChild(oI);oR.appendChild(oC);
		oR.appendChild(oD);oR.appendChild(oE);
		main.appendChild(oR);
		}
		else if(Names[i]=='Image Desc')
		{
			//cA(oI,'type','text');
			cA(oI,'name','img_desc[]');
			cA(oI,'id',descID);
			cA(oI,'class','descarea');
			oC.appendChild(document.createTextNode(Names[i]));	
		oD.appendChild(document.createTextNode(' :'));
		oE.appendChild(oI);oR.appendChild(oC);
		oR.appendChild(oD);oR.appendChild(oE);
		main.appendChild(oR);
		}
		
		
	}
	root.appendChild(main);
	
}
function removeAtt()
{

	var d = document.getElementById('ADD_MORE_DIV');
	var numi = document.getElementById('tot_elem');
	if(numi.value==0)
	{
		document.getElementById('file0').value='';
		document.getElementById('img_name0').value='';
		document.getElementById('img_desc0').value='';
	}
	else
	{
		d.removeChild(d.lastChild);
		var num = parseInt(numi.value) -1;//alert(numi);
		numi.value=parseInt(num);//alert(numi.value);
	}
	
}

function addVideo()
{
	var root=document.getElementById('ADD_VIDEO_MORE_DIV');
	/*if(document.getElementById('remove_video').style.display='none')
	{
		document.getElementById('remove_video').style.display='';
	}*/
	var numi = document.getElementById('tot_video');
	var num = (parseInt(document.getElementById('tot_video').value) -1)+ 2;
	numi.value = parseInt(num);
	var fileID = 'video'+num;
	var textID = 'video_name'+num;
	var descID = 'video_desc'+num;
	var divID  = 'video_container'+num;
	var main=cE('div');
	cA(main,'id',divID);//alert(divID);
	var Names= new Array('Video Title','Video Desc','Upload Video');//alert(Names.length);
	for(var i=0;i<Names.length;i++)
	{//alert(fileID);
		var oR = cE('div');
		var oC = cE('div');
		var oD = cE('div');
		var oE = cE('div');
		oC.align='right';
		oC.style.color='#000000';
		oD.align='center';
		oD.style.color='#000000';
		if(Names[i]=='Upload Video' || Names[i]=='Video Title')
		var oI = cE('input');
		else
		var oI = cE('textarea');
		cA(oR,'class','ad_art_info_div pdd_top10');
		cA(oC,'class','ad_doc_info_divC1');
		cA(oD,'class','ad_doc_info_divC2');
		cA(oE,'class','ad_doc_info_divC3');
		if(Names[i]=='Upload Video')
		{
			cA(oI,'type','file');
			cA(oI,'name','video[]');
			cA(oI,'id',fileID);
			oC.appendChild(document.createTextNode(Names[i]));	
			oD.appendChild(document.createTextNode(' :'));
			oR.appendChild(oC);
			oR.appendChild(oD);oR.appendChild(oI);
			main.appendChild(oR);
		}
		else if(Names[i]=='Video Title')
		{
			cA(oI,'type','text');
			cA(oI,'name','video_name[]');
			cA(oI,'id',textID);
			cA(oI,'class','txt_box');
			oC.appendChild(document.createTextNode(Names[i]));	
		oD.appendChild(document.createTextNode(' :'));
		oE.appendChild(oI);oR.appendChild(oC);
		oR.appendChild(oD);oR.appendChild(oE);
		main.appendChild(oR);
		}
		else if(Names[i]=='Video Desc')
		{
			//cA(oI,'type','text');
			cA(oI,'name','video_desc[]');
			cA(oI,'id',descID);
			cA(oI,'class','descarea');
			oC.appendChild(document.createTextNode(Names[i]));	
		oD.appendChild(document.createTextNode(' :'));
		oE.appendChild(oI);oR.appendChild(oC);
		oR.appendChild(oD);oR.appendChild(oE);
		main.appendChild(oR);
		}
		
		
	}
	root.appendChild(main);
	
}
function removeVideo()
{

var d = document.getElementById('ADD_VIDEO_MORE_DIV');
var numi = document.getElementById('tot_video');

if(numi.value==0)
{
	document.getElementById('video0').value='';
	document.getElementById('video_name0').value='';
	document.getElementById('video_desc0').value='';
}
else
{
  
  	d.removeChild(d.lastChild);
	var num = parseInt(numi.value) -1;//alert(numi);
	numi.value=parseInt(num);//alert(numi.value);
}
}

function addDoc()
{
	var root=document.getElementById('ADD_DOC_MORE_DIV');
	if(document.getElementById('remove_doc').style.display='none')
	{
		document.getElementById('remove_doc').style.display='';
	}
	var numi = document.getElementById('tot_doc');
	var num = (parseInt(document.getElementById('tot_doc').value) -1)+ 2;
	numi.value = parseInt(num);
	var fileID = 'doc'+num;
	var textID = 'doc_name'+num;
	var descID = 'doc_desc'+num;
	var divID  = 'doc_container'+num;
	var main=cE('div');
	cA(main,'id',divID);//alert(divID);
	var Names= new Array('Document Title','Document Desc','Upload Document');//alert(Names.length);
	for(var i=0;i<Names.length;i++)
	{//alert(fileID);
		var oR = cE('div');
		var oC = cE('div');
		var oD = cE('div');
		var oE = cE('div');
		oC.align='right';
		oC.style.color='#000000';
		oD.align='center';
		oD.style.color='#000000';
		if(Names[i]=='Upload Document' || Names[i]=='Document Title')
		var oI = cE('input');
		else
		var oI = cE('textarea');
		cA(oR,'class','ad_art_info_div pdd_top10');
		cA(oC,'class','ad_doc_info_divC1');
		cA(oD,'class','ad_doc_info_divC2');
		cA(oE,'class','ad_doc_info_divC3');
		if(Names[i]=='Upload Document')
		{
			cA(oI,'type','file');
			cA(oI,'name','doc[]');
			cA(oI,'id',fileID);
			oC.appendChild(document.createTextNode(Names[i]));	
			oD.appendChild(document.createTextNode(' :'));
			oR.appendChild(oC);
			oR.appendChild(oD);oR.appendChild(oI);
			main.appendChild(oR);
		}
		else if(Names[i]=='Document Title')
		{
			cA(oI,'type','text');
			cA(oI,'name','doc_name[]');
			cA(oI,'id',textID);
			cA(oI,'class','txt_box');
			oC.appendChild(document.createTextNode(Names[i]));	
		oD.appendChild(document.createTextNode(' :'));
		oE.appendChild(oI);oR.appendChild(oC);
		oR.appendChild(oD);oR.appendChild(oE);
		main.appendChild(oR);
		}
		else if(Names[i]=='Document Desc')
		{
			//cA(oI,'type','text');
			cA(oI,'name','doc_desc[]');
			cA(oI,'id',descID);
			cA(oI,'class','descarea');
			oC.appendChild(document.createTextNode(Names[i]));	
		oD.appendChild(document.createTextNode(' :'));
		oE.appendChild(oI);oR.appendChild(oC);
		oR.appendChild(oD);oR.appendChild(oE);
		main.appendChild(oR);
		}
		
		
	}
	root.appendChild(main);
	
}
function removeDoc()
{

	var d = document.getElementById('ADD_DOC_MORE_DIV');
	var numi = document.getElementById('tot_doc');
	if(numi.value==0)
	{
		document.getElementById('doc0').value='';
		document.getElementById('doc_name0').value='';
		document.getElementById('doc_desc0').value='';
	}
	else
	{
		d.removeChild(d.lastChild);
		var num = parseInt(numi.value) -1;//alert(numi);
		numi.value=parseInt(num);//alert(numi.value);
	}
}
function cE(el)
{
	this.obj =document.createElement(el);
	return this.obj
}
function cA(obj,att,val)
{
	obj.setAttribute(att,val);
	return
}
/*------------Add More Mail-Attachment------------------*/
function addEmailAttachment()
{
	var root=document.getElementById('ADD_MORE_DIV');
	if(document.getElementById('remove').style.display='none')
	{
		document.getElementById('remove').style.display='';
	}
	var numi = document.getElementById('tot_elem');
	var num = (parseInt(document.getElementById('tot_elem').value) -1)+ 2;
	numi.value = parseInt(num);//alert(num);
	var fileID = 'file'+num;	
	var divID  = 'container'+num;
	var main=cE('div');
	cA(main,'id',divID);//alert(divID);
	var Names= new Array('Upload Image');//alert(Names.length);
	for(var i=0;i<Names.length;i++)
	{//alert(fileID);
		var oR = cE('div');
		var oC = cE('div');
		var oD = cE('div');
		var oE = cE('div');
		oC.align='right';
		oC.style.color='#000000';
		oD.align='center';
		oD.style.color='#000000';
		if(Names[i]=='Upload Image')
		var oI = cE('input');
		else
		var oI = cE('textarea');
		cA(oR,'class','ad_art_info_div_atch pdd_top10');
// 		cA(oC,'class','ad_art_info_divC1 fnt');
// 		cA(oD,'class','ad_art_info_divC2');
 		cA(oE,'class','ad_art_info_div_atchC3');
		if(Names[i]=='Upload Image')
		{
			cA(oI,'type','file');
			cA(oI,'name','file[]');
			cA(oI,'id',fileID);
			//oC.appendChild(document.createTextNode(Names[i]));	
			//oD.appendChild(document.createTextNode(' :'));
			oR.appendChild(oC);
			oR.appendChild(oD);oR.appendChild(oI);
			main.appendChild(oR);
		}								
	}
	root.appendChild(main);
	
}
function removeEmailAttachment()
{

	var d = document.getElementById('ADD_MORE_DIV');
	var numi = document.getElementById('tot_elem');
	if(numi.value==0)
	{
		document.getElementById('file0').value='';
	}
	else
	{
		d.removeChild(d.lastChild);
		var num = parseInt(numi.value) -1;//alert(numi);
		numi.value=parseInt(num);//alert(numi.value);
	}
}

/*------------------------Ajax for deleteing mails----------------------*/
function del_msg(email_id,email_receiver_id,page)
{
	var vals=email_id+'|'+email_receiver_id+'|'+page;
	 showContent('adm-email.php',vals,2,'','');
	window.location.reload();
}

function ShowDisplay(n)
{//alert(n);
	if(n==1)
	{
		//var disp=document.getElementById('upd_needs_div').style.display;
		if(document.getElementById('upd_needs_div').style.display='none')
			document.getElementById('upd_needs_div').style.display='';
	}
	else if(n==2)
	{
		
		//var disp=document.getElementById('upd_needs_div').style.display;
		if(document.getElementById('upd_interests_div').style.display='none')
			document.getElementById('upd_interests_div').style.display='';
	}
	else if(n==3)
	{
		//var disp=document.getElementById('upd_needs_div').style.display;
		if(document.getElementById('upd_spec_div').style.display='none')
			document.getElementById('upd_spec_div').style.display='';
	}
}

function togglePersonal()
{
var $j=jQuery.noConflict();
$j(document).ready(function(){
	$j("#displayProductMade").click(function()
	{
		var $elem = $j(document);
    		$j("#product_made").slideToggle("slow");
    		var img = $j(this).find("img");
		if( img.attr("alt") == "down"){
				img.attr("alt","up");
				img.attr("src", "images/arrow_up_red.png");
				$j('html, body').animate({scrollTop: $elem.height()}, 800);
		}else{
			img.attr("alt","down");
			img.attr("src", "images/arrow_big_red.png");
		}
		return false;
  	});
	$j("#displayUserInterest").click(function()
	{
		var $elem = $j(document);
    		$j("#user_interest_div").slideToggle("slow");
    		var img = $j(this).find("img");
		if( img.attr("alt") == "down"){
				img.attr("alt","up");
				img.attr("src", "images/arrow_up_red.png");
				$j('html, body').animate({scrollTop: $elem.height()}, 800);
		}else{
			img.attr("alt","down");
			img.attr("src", "images/arrow_big_red.png");
		}
		return false;
  	});
	$j("#displayUserSpecialities").click(function()
	{
		var $elem = $j(document);
    		$j("#user_specialities_div").slideToggle("slow");
    		var img = $j(this).find("img");
		if( img.attr("alt") == "down"){
				img.attr("alt","up");
				img.attr("src", "images/arrow_up_red.png");
				$j('html, body').animate({scrollTop: $elem.height()}, 800);
		}else{
			img.attr("alt","down");
			img.attr("src", "images/arrow_big_red.png");
		}
		return false;
  	});
	$j("#displayAddNeed").click(function()
	{
		var $elem = $j(document);
    		$j("#product_need_add").slideToggle("slow");
		$j('html, body').animate({scrollTop: $elem.height()}, 800);
  	});
	$j("#displayAddInterest").click(function()
	{
		var $elem = $j(document);
    		$j("#product_interest_add").slideToggle("slow");
		$j('html, body').animate({scrollTop: $elem.height()}, 800);
  	});
	$j("#displayAddSpecialities").click(function()
	{
		var $elem = $j(document);
    		$j("#product_specialities_add").slideToggle("slow");
		$j('html, body').animate({scrollTop: $elem.height()}, 800);
  	});
});
}
function toogleCompany()
{
var $j=jQuery.noConflict();
$j(document).ready(function(){
	$j("#displayCompAct").click(function()
	{
		var $elem = $j(document);
    		$j("#activities_div").slideToggle("slow");
    		var img = $j(this).find("img");
		if( img.attr("alt") == "down"){
				img.attr("alt","up");
				img.attr("src", "images/arrow_up_red.png");
				$j('html, body').animate({scrollTop: $elem.height()}, 800);
		}else{
			img.attr("alt","down");
			img.attr("src", "images/arrow_big_red.png");
		}
		return false;				
  	});
	$j("#displayProductMade").click(function()
	{
		var $elem = $j(document);
    		$j("#product_made").slideToggle("slow");
    		var img = $j(this).find("img");
		if( img.attr("alt") == "down"){
				img.attr("alt","up");
				img.attr("src", "images/arrow_up_red.png");
				$j('html, body').animate({scrollTop: $elem.height()}, 800);
		}else{
			img.attr("alt","down");
			img.attr("src", "images/arrow_big_red.png");
		}
		return false;
  	});
	$j("#displayUserInterest").click(function()
	{
		var $elem = $j(document);
    		$j("#user_interest_div").slideToggle("slow");
    		var img = $j(this).find("img");
		if( img.attr("alt") == "down"){
				img.attr("alt","up");
				img.attr("src", "images/arrow_up_red.png");
				$j('html, body').animate({scrollTop: $elem.height()}, 800);
		}else{
			img.attr("alt","down");
			img.attr("src", "images/arrow_big_red.png");
		}
		return false;
        });
	$j("#displayAddUsed").click(function()
	{
		var $elem = $j(document);
    		$j("#product_used_add").slideToggle("slow");
		$j('html, body').animate({scrollTop: $elem.height()}, 800);
  	});
});
}
function toggleAddDocument()
{
var $j=jQuery.noConflict();
	$j(document).ready(function(){
	$j("#displayText").click(function()
	{
		var $elem = $j(document);
    		$j("#toggleImage").slideToggle("slow");
    		var img = $j(this).find("img");
		if( img.attr("alt") == "down"){
				img.attr("alt","up");
				img.attr("src", "images/arrow_up_red.png");
				$j('html, body').animate({scrollTop: $elem.height()}, 800);
		}else{
			img.attr("alt","down");
			img.attr("src", "images/arrow_big_red.png");
		}
		return false;
  	});
	$j("#abstract_div").click(function()
	{
		var $elem = $j(document);
    		$j("#abs_opener").slideToggle("slow");
    		var img = $j(this).find("img");
		if( img.attr("alt") == "down"){
				img.attr("alt","up");
				img.attr("src", "images/arrow_up_red.png");
				$j('html, body').animate({scrollTop: $elem.height()}, 800);
		}else{
			img.attr("alt","down");
			img.attr("src", "images/arrow_big_red.png");
		}
		return false;
  	});
	$j("#displayVideo").click(function()
	{
		var $elem = $j(document);
    		$j("#toggleVideo").slideToggle("slow");
    		var img = $j(this).find("img");
		if( img.attr("alt") == "down"){
				img.attr("alt","up");
				img.attr("src", "images/arrow_up_red.png");
				$j('html, body').animate({scrollTop: $elem.height()}, 800);
		}else{
			img.attr("alt","down");
			img.attr("src", "images/arrow_big_red.png");
		}
		return false;
  	});
	$j("#displayDoc").click(function()
	{
		var $elem = $j(document);
    		$j("#toggleDoc").slideToggle("slow");
    		var img = $j(this).find("img");
		if( img.attr("alt") == "down"){
				img.attr("alt","up");
				img.attr("src", "images/arrow_up_red.png");
				$j('html, body').animate({scrollTop: $elem.height()}, 800);
		}else{
			img.attr("alt","down");
			img.attr("src", "images/arrow_big_red.png");
		}
		return false;
  	});
	$j("#displayInfo").click(function()
	{
		var $elem = $j(document);
    		$j("#further_info").slideToggle("slow");
    		var img = $j(this).find("img");
		if( img.attr("alt") == "down"){
				img.attr("alt","up");
				img.attr("src", "images/arrow_up_red.png");
				$j('html, body').animate({scrollTop: $elem.height()}, 800);
		}else{
			img.attr("alt","down");
			img.attr("src", "images/arrow_big_red.png");
		}
		return false;
  	});
});
}

function toggleModDocument()
{
var $j=jQuery.noConflict();
	$j(document).ready(function(){
	$j("#abstract_div").click(function()
	{
		var $elem = $j(document);
    		$j("#abs_opener").slideToggle("slow");
    		var img = $j(this).find("img");
		if( img.attr("alt") == "down"){
				img.attr("alt","up");
				img.attr("src", "images/arrow_up_red.png");
				$j('html, body').animate({scrollTop: $elem.height()}, 800);
		}else{
			img.attr("alt","down");
			img.attr("src", "images/arrow_big_red.png");
		}
		return false;
  	});
	$j("#displayText").click(function()
	{
		var $elem = $j(document);
    		$j("#toggleImage").slideToggle("slow");
    		var img = $j(this).find("img");
		if( img.attr("alt") == "down"){
				img.attr("alt","up");
				img.attr("src", "images/arrow_up_red.png");
				$j('html, body').animate({scrollTop: $elem.height()}, 800);
		}else{
			img.attr("alt","down");
			img.attr("src", "images/arrow_big_red.png");
		}
		return false;
  	});
	$j("#displayProdUser").click(function()
	{
		var $elem = $j(document);
    		$j("#toggleProdUser").slideToggle("slow");
		$j('html, body').animate({scrollTop: $elem.height()}, 800);
  	});
	$j("#moreImage").click(function()
	{
		var $elem = $j(document);
    		$j("#toggleMoreImage").slideToggle("slow");
		$j('html, body').animate({scrollTop: $elem.height()}, 800);
  	});
	$j("#displayVideo").click(function()
	{
		var $elem = $j(document);
    		$j("#toggleVideo").slideToggle("slow");
    		var img = $j(this).find("img");
		if( img.attr("alt") == "down"){
				img.attr("alt","up");
				img.attr("src", "images/arrow_up_red.png");
				$j('html, body').animate({scrollTop: $elem.height()}, 800);
		}else{
			img.attr("alt","down");
			img.attr("src", "images/arrow_big_red.png");
		}
		return false;
  	});
	$j("#moreVideo").click(function()
	{
		var $elem = $j(document);
    		$j("#toggleMoreVideo").slideToggle("slow");
		$j('html, body').animate({scrollTop: $elem.height()}, 800);
  	});
	$j("#displayDoc").click(function()
	{
		var $elem = $j(document);
    		$j("#toggleDoc").slideToggle("slow");
    		var img = $j(this).find("img");
		if( img.attr("alt") == "down"){
				img.attr("alt","up");
				img.attr("src", "images/arrow_up_red.png");
				$j('html, body').animate({scrollTop: $elem.height()}, 800);
		}else{
			img.attr("alt","down");
			img.attr("src", "images/arrow_big_red.png");
		}
		return false;
  	});
	$j("#moreDoc").click(function()
	{
		var $elem = $j(document);
    		$j("#toggleMoreDoc").slideToggle("slow");
		$j('html, body').animate({scrollTop: $elem.height()}, 800);
  	});
	$j("#displayInfo").click(function()
	{
		var $elem = $j(document);
    		$j("#further_info").slideToggle("slow");
    		var img = $j(this).find("img");
		if( img.attr("alt") == "down"){
				img.attr("alt","up");
				img.attr("src", "images/arrow_up_red.png");
				$j('html, body').animate({scrollTop: $elem.height()}, 800);
		}else{
			img.attr("alt","down");
			img.attr("src", "images/arrow_big_red.png");
		}
		return false;
  	});

});
}

function change_arrow(arr_id,div_id)
{
	div=document.getElementById(div_id);
	arr_img=document.getElementById(arr_id);
	if(div.animate==show)
	{
		arr_img.src="images/arrow_up_red.png";
	}
	else
	{
		arr_img.src="images/arrow_big_red.png";
	}
}

function div_click()
{
	var id=document.getElementById('displayCompAct');
	id.click(function()
	{
		change_arrow('chng_arr','activities_div');
	}
	)
}

//=============================================for scheduling section ========================================

function validate_conference()

{

	//alert('aa');

var doc=document.frm;

var d = new Date();



//alert(d);

var curr_date = d.getDate();

//alert(curr_date);

var curr_month = d.getMonth();

curr_month = parseInt(curr_month)+1;

if(curr_month<10)

	{

		curr_month = '0'+curr_month;

	}

//alert(curr_month);

var curr_year = d.getFullYear();

//alert(curr_year);

var curr_hour = d.getHours();

var curr_min = d.getMinutes();

//  alert('cur hr='+curr_hour);

//  alert('cur min='+curr_min);

curr_min = parseInt(curr_min)+10

if(curr_min>=60)

{

curr_hour = parseInt(curr_hour)+1;

curr_min	=	parseInt(curr_min)-60;

if(curr_min<10)

{

	curr_min = '0'+curr_min;

}

// alert('len min='+meeting_mins);

// alert('len hr='+Meeting_len_hours);

}

var current_date = curr_year+'-'+curr_month+'-'+curr_date;

//alert(current_date);

var ampm = document.getElementById('meeting_sec').value;



var Meeting_len_hours = document.getElementById('meeting_hrs').value;



if(ampm==2 &&  Meeting_len_hours!='12')

{

	Meeting_len_hours		= parseInt(Meeting_len_hours) + 12;

}

if(ampm==2 &&  Meeting_len_hours=='12')

{

	Meeting_len_hours	= parseInt(Meeting_len_hours);

}

if(ampm==1 &&  Meeting_len_hours!='12')

{

	Meeting_len_hours	= parseInt(Meeting_len_hours);

}

if(ampm==1 &&  Meeting_len_hours=='12')

{

	Meeting_len_hours	= '00';

}



var meeting_mins = document.getElementById('meeting_mins').value;

// alert('len hr='+Meeting_len_hours);

// alert('len min='+meeting_mins);

/*meeting_mins = parseInt(meeting_mins)+10*/;

//alert('lenadded min='+meeting_mins);



if(Meeting_len_hours<10)

{

	Meeting_len_hours = '0'+Meeting_len_hours;

}

//alert(Meeting_len_hours);

// alert(document.getElementById('meeting_len_mins').value);

// alert(document.getElementById('meeting_len_hrs').value);

var public_meeting = document.getElementById('public_meeting');

var private_meeting = document.getElementById('private_meeting');



	if(public_meeting.checked==false && private_meeting.checked==false)

	{

		alert('Select meeting type!');

		return false;

	}



	else if(doc.meeting_name.value=="")

	{

		

		alert("Insert meeting name!");

		doc.meeting_name.focus();

		return false; 

	}



	else if(doc.meeting_name.value.charAt(0)==" ")

   	{

 		alert("Blank space not allowed at beginning!");

 		doc.meeting_name.select();

 		return false;

   	}



	else if(doc.meeting_agenda.value=="")

	{

		alert("Insert meeting agenda");

		doc.meeting_agenda.focus();

		return false; 

	}



	else if(doc.meeting_agenda.value.charAt(0)==" ")

   	{

 		alert("Blank space not allowed at beginning!");

 		doc.meeting_agenda.select();

 		return false;

   	}

	else if(document.getElementById('sch_date').value=="")

	{

		alert("Schedule date can't be empty! ");

		return false;

	}

	else  if(document.getElementById('meeting_hrs').value=="0")

	{

		alert("Insert Hours!");

		return false; 

	}

	

	else if(doc.meeting_mins.value=="")

	{

		alert("Insert Minutes!");

		return false; 

	}

	else if(document.getElementById('sch_date').value==current_date)

	{

		//alert('ss');

		if(curr_hour>Meeting_len_hours)

		{

			alert('Invalid Time!');

			return false;

		}

		else if(curr_hour==Meeting_len_hours)

		{

			if(curr_min>meeting_mins)

			{

				alert('Invalid Time!');return false;

			}

		}

	}

	 if(doc.time_zone.value=="0")

	{

		alert("Insert timezone!");

		doc.time_zone.focus();

		return false; 

	}



	 if((document.getElementById('pvt_chat').checked==false))

	{

		//alert("false");

		if((document.getElementById('pub_chat').checked==false))

		{

		alert("Please select atleast one record from chat section!");

		return false;	

		}

	}

		



 	if((document.getElementById('Images').checked==false))

 	{

 			if((document.getElementById('Documents').checked==false))

 			{	

 				if((document.getElementById('WhiteBoard').checked==false))

 				{	

					if((document.getElementById('Powerpoint').checked==false))

 					{

						alert("Please select atleast one record from resource section!");

						return false;	

					}

 				}

 			}

 	}



	if((document.getElementById('meeting_length_hrs').value==''))

	{

		alert("Please select hours for meeting length!");

 					return false;

	}



	if((document.getElementById('meeting_length_mins').value==''))

	{

		alert("Please select minutes for meeting length!");

 					return false;

	}

	if((document.getElementById('meeting_length_hrs').value=='00') && (document.getElementById('meeting_length_mins').value=='00'))

	{

		alert('Invalid meeting length!');return false;

	}

	return true;

}



function validatefeature(frm_name)

{

//alert("aa");

	//var doc = document.frm_name;

 	//var j=0;	

	if((document.getElementById('pvt_chat').checked==false))

	{

		//alert("false");

		if((document.getElementById('pub_chat').checked==false))

		{

		alert("Please select atleast one record from chat section!");

		return false;	

		}

	}

		



 	if((document.getElementById('Images').checked==false))

 	{

 			if((document.getElementById('Documents').checked==false))

 			{	

 				if((document.getElementById('WhiteBoard').checked==false))

 				{	

					if((document.getElementById('Powerpoint').checked==false))

 					{

						alert("Please select atleast one record from resource section!");

						return false;	

					}

 				}

 			}

 	}



	if((document.getElementById('meeting_hrs').value==''))

	{

		alert("Please select hours for meeting length!");

 					return false;

	}



	if((document.getElementById('meeting_mins').value==''))

	{

		alert("Please select minutes for meeting length!");

 					return false;

	}

	if((document.getElementById('meeting_hrs').value=='00') && (document.getElementById('meeting_mins').value=='00'))

	{

		alert('Invalid meeting length!');return false;

	}

	

}



function checkAll_chkboxz()

{

//alert("aa");



	var frm		=	document.frm;

	

	

	if(frm.selectall.checked==true)

	{

//alert("ww");

		for (i = 0; i < frm.length; i++)

		{

			if(frm.elements[i].type=='checkbox')

			{

				frm.elements[i].checked = true ;

			}

		}

	}

	else

	{//alert("df");

		for (i = 0; i < frm.length; i++)

		{

			if(frm.elements[i].type=='checkbox')

			{

				frm.elements[i].checked = false ;

				

			}

		}

	}

}

function uncheck()

{

	var frm=document.frm;

	if(frm.selectall.checked==true)

		frm.selectall.checked=false;

}



function validate_search()

{

var doc=document.adv_search;

	if(doc.sel_criteria.value=="0")

	{

		alert("Select criteria!");

		doc.sel_criteria.focus();

		return false; 

	}

	else if((doc.sel_criteria.value=="1") || (doc.sel_criteria.value=="2"))

	{

		if(doc.search_box.value=="")

		{

			alert("Insert search keyword!");

			doc.search_box.focus();

			return false; 

		}

		else if(doc.search_box.value.charAt(0)==" ")

   		{

			alert("Blank space not allowed at beginning!");

			doc.search_box.select();

			return false;

   		}

	}

	

	

ContentSearch_mail();

		

}



function validateMail(frm_name)

{



	var doc = frm_name;

	var count=0;

	var j=0;	

	for(i=1;i<doc.length;i++)



	{



		if(doc.elements[i].type=="checkbox" && doc.elements[i].checked==false)



		j=0;



		else if(doc.elements[i].type=="checkbox" && doc.elements[i].checked==true) 



		{



			j=1;

 		

			break;	



		}



	}	

	for(i=1;i<doc.length;i++)



	{

		if(doc.elements[i].type=="checkbox" && doc.elements[i].checked==true) 

		{

			count=count+1;

 			//alert(count);



		}

	}



	if(j==0)

	{



	 	alert("Please select atleast one record!");

		return false;

	}

	else

	{

		//alert(count);

 		return confirm('Are you sure you want to send mail to selected invitees!');

	}	



}



//==========functions used in coomunication-tool===========================

function img_upload(mid,orgnzr_id,meeting_type)

{

//alert('ss');

	uploadImgBox =  self.open('uploadimage.php?conference_id='+mid+'&meeting_type='+meeting_type+'','upload_img','height=250,width=500,scrollbars=no');

	uploadImgBox.moveTo(screen.width/2-230, screen.height/2-180);

	uploadImgBox.focus();

	click_img(mid,orgnzr_id,meeting_type);

	change_image(1,mid,orgnzr_id,meeting_type);

}

function showimg(img,uid,cid,meeting_type)
{
//alert(meeting_type);
	if(meeting_type=='private')
		var img_path = 'uploads/meeting_'+cid+'/image_'+uid+'/'+img ;//alert(img_path);
	else
		var img_path = 'uploads/image_'+cid+'/'+img ;
	document.getElementById('hid_img').src = img_path;

	document.getElementById('show_largeimg').style.display='';



}



function click_img(mid,orgnzr_id,meeting_type)

{

//alert('ss');

	document.getElementById('show_images').style.display="block";

	document.getElementById('show_docs').style.display="none";

	document.getElementById('show_whiteboard').style.display="none";

	document.getElementById('show_ppts').style.display="none";



 chnge_imgstatus(mid,orgnzr_id,meeting_type);

}





function chnge_imgstatus(confernce_id,orgnzr_id,meeting_type)

{

//alert('imagestatus');

// 	var confernce_id = document.getElementById('cid').value;
// 
// 	var orgnzr_id	 = document.getElementById('orgnzr_id').value;

	var vals	= confernce_id+'|'+orgnzr_id+'|'+meeting_type;

//alert(vals);



	showContent('meeting-showcontent.php',vals,1,'show_images','');

}



function delete_img(imgid,cid,orgnzr_id,meeting_type)

{

//alert(meeting_type);

	var img_id 	= 	imgid;

	var vals 	= img_id+'|'+cid+'|'+orgnzr_id+'|'+meeting_type;

	//alert(vals);

	var add		=	'img_content'+'|'+'show_largeimg';

	//alert(add);

	var where_to= confirm("Do you really want to remove this image?");

	if(where_to==true)

	{

//alert('true');

		showContent('meeting-content-delete.php',vals,'2',add,'');

	}

}



//===========functions related docs========



function doc_upload(mid,orgnzr_id,meeting_type)

{

//alert('ss');

	uploadImgBox =  self.open('upload-doc.php?conference_id='+mid+'&meeting_type='+meeting_type+'','upload_doc','height=250,width=500,scrollbars=no');

	uploadImgBox.moveTo(screen.width/2-230, screen.height/2-180);

	uploadImgBox.focus();

	click_doc(mid,orgnzr_id,meeting_type);

	change_image(3,mid,orgnzr_id,meeting_type);

}



function click_doc(confernce_id,orgnzr_id,meeting_type)

{

//alert(meeting_type);

	document.getElementById('show_docs').style.display="block";

	document.getElementById('show_images').style.display="none";

	document.getElementById('show_whiteboard').style.display="none";

	document.getElementById('show_ppts').style.display="none";

	



 chnge_docstatus(confernce_id,orgnzr_id,meeting_type);

}





function chnge_docstatus(confernce_id,orgnzr_id,meeting_type)

{

//alert('imagestatus');


	var vals	= confernce_id+'|'+orgnzr_id+'|'+meeting_type;

//alert(vals);



	showContent('meeting-showcontent.php',vals,2,'show_docs','');

}



function delete_doc(doc_id,cid,orgnzr_id,meeting_type)

{

//alert(meeting_type);

// 	var cid 	= document.getElementById('cid').value;
// 
// 	var orgnzr_id	= 	document.getElementById('orgnzr_id').value;

	var vals 	= doc_id+'|'+cid+'|'+orgnzr_id+'|'+meeting_type;

	//alert(vals);

	var where_to= confirm("Do you really want to delete this file??");

	if (where_to== true)

	{

		showContent('meeting-content-delete.php',vals,'1','show_docs','');

	}

}



//==============================functions related ppt =======

function ppt_upload(mid,orgnzr_id,meeting_type)

{

//alert('ss');

	

	uploadImgBox =  self.open('uploadppt.php?conference_id='+mid+'&meeting_type='+meeting_type+'','upload_ppt','height=250,width=300,scrollbars=yes');

	uploadImgBox.moveTo(screen.width/2-230, screen.height/2-180);

	uploadImgBox.focus();

	click_ppt(mid,orgnzr_id,meeting_type);

	change_image(5,mid,orgnzr_id,meeting_type);

	

}



function click_ppt(confernce_id,orgnzr_id,meeting_type)

{

//alert('ss');

	document.getElementById('show_ppts').style.display="block";

	document.getElementById('show_whiteboard').style.display="none";

	document.getElementById('show_images').style.display="none";

	document.getElementById('show_docs').style.display="none";

	

	var count_imgs = document.getElementById('count_imgs').value;//alert(count_imgs);

	var uid	       = orgnzr_id;

	if(count_imgs!='0')

	{

	//alert(count_imgs);

		chnge_ppt_status(count_imgs,confernce_id,orgnzr_id,meeting_type);

	}

}



function chnge_ppt_status(count_imgs,confernce_id,orgnzr_id,meeting_type)

{

//alert(count_imgs);

	
	var vals	= confernce_id+'|'+count_imgs+'|'+orgnzr_id+'|'+meeting_type;

//alert(vals);



	showContent('meeting-showcontent.php',vals,3,'show_ppts','');

}



//========function related whiteboard======

var whtbrd_refresh;

function click_whtbrd()

{

//alert('ss');

	

	document.getElementById('show_whiteboard').style.display="block";

	document.getElementById('show_ppts').style.display="none";

	document.getElementById('show_images').style.display="none";

	document.getElementById('show_docs').style.display="none";

// 	display_whtbrd();

}

//to display whtbrd content to invitees====

function display_whtbrd()

{

	whtbrd_refresh = setInterval('refresh_whtbrd()',6000);

}

function refresh_whtbrd()

{

	//alert('ss');

	var confernce_id = document.getElementById('cid').value;

	var vals	= confernce_id;

	//alert(vals);

	showContent('meeting-showcontent.php',vals,5,'show_whiteboard','');

	change_image('7');

}



function chnge_whtbrd_status()

{

//alert('ss');

	var confernce_id = document.getElementById('cid').value;

	var vals	= confernce_id;

	showContent('meeting-showcontent.php',vals,4,'','');

	change_image('7');

}



// ========for tabs============

function change_image(arg,confernce_id,orgnzr_id,meeting_type)

{

//alert(meeting_type);

	if(arg=='1')

	{

	//alert('on');

		

		document.getElementById('images_over').style.display="block";

		document.getElementById('images_on').style.display="none";

		document.getElementById('whtbrd_on').style.display="block";

		document.getElementById('whtbrd_over').style.display="none";

		document.getElementById('docs_on').style.display="block";

		document.getElementById('docs_over').style.display="none";

		document.getElementById('ppts_on').style.display="block";

		document.getElementById('ppts_over').style.display="none";

		//document.getElementById('images_on1').style.display="none";

		click_img(confernce_id,orgnzr_id,meeting_type);	

		window.clearInterval(whtbrd_refresh);	

	}

	if(arg=='2')

	{

		//alert('off');

		document.getElementById('images_on').style.display="block";

		document.getElementById('images_over').style.display="none";

		

	}

	if(arg=='3')

	{

		

		document.getElementById('docs_over').style.display="block";

		document.getElementById('docs_on').style.display="none";

		document.getElementById('whtbrd_on').style.display="block";

		document.getElementById('whtbrd_over').style.display="none";

		document.getElementById('ppts_on').style.display="block";

		document.getElementById('ppts_over').style.display="none";

		document.getElementById('images_on').style.display="block";

		document.getElementById('images_over').style.display="none";

		click_doc(confernce_id,orgnzr_id,meeting_type);

		window.clearInterval(whtbrd_refresh);

	}

	if(arg=='4')

	{

		document.getElementById('docs_on').style.display="block";

		document.getElementById('docs_over').style.display="none";

	}

	if(arg=='5')

	{

		

		document.getElementById('ppts_over').style.display="block";

		document.getElementById('ppts_on').style.display="none";

		document.getElementById('whtbrd_on').style.display="block";

		document.getElementById('whtbrd_over').style.display="none";

		document.getElementById('docs_on').style.display="block";

		document.getElementById('docs_over').style.display="none";

		document.getElementById('images_on').style.display="block";

		document.getElementById('images_over').style.display="none";

		click_ppt(confernce_id,orgnzr_id,meeting_type);

		window.clearInterval(whtbrd_refresh);

	}

	if(arg=='6')

	{

		document.getElementById('ppts_on').style.display="block";

		document.getElementById('ppts_over').style.display="none";

	}

	if(arg=='7')

	{

	

		document.getElementById('whtbrd_over').style.display="block";

		document.getElementById('whtbrd_on').style.display="none";

		document.getElementById('ppts_on').style.display="block";

		document.getElementById('ppts_over').style.display="none";

		document.getElementById('docs_on').style.display="block";

		document.getElementById('docs_over').style.display="none";

		document.getElementById('images_on').style.display="block";

		document.getElementById('images_over').style.display="none";

		click_whtbrd();

	}

	if(arg=='8')

	{

		document.getElementById('ppts_on').style.display="block";

		document.getElementById('ppts_over').style.display="none";

	}

	

		

}

function ShowHidePanel(condition,confernce_id,orgnzr_id,meeting_type)
{
	if(condition==1)
	{
		document.getElementById('showHide_ppt').style.display='';
		document.getElementById('showHide_img').style.display='none';
		document.getElementById('showHide_doc').style.display='none';
		change_image(5,confernce_id,orgnzr_id,meeting_type);
	}
	else if(condition==2)
	{
		document.getElementById('showHide_img').style.display='';
		document.getElementById('showHide_doc').style.display='none';
		document.getElementById('showHide_ppt').style.display='none';
		change_image(1,confernce_id,orgnzr_id,meeting_type);
	}
	else if(condition==3)
	{
		document.getElementById('showHide_doc').style.display='';
		document.getElementById('showHide_ppt').style.display='none';
		document.getElementById('showHide_img').style.display='none';
		change_image(3,confernce_id,orgnzr_id,meeting_type);
	}
	else if(condition==4)
	{
		document.getElementById('showHide_doc').style.display='none';
		document.getElementById('showHide_ppt').style.display='none';
		document.getElementById('showHide_img').style.display='none';
		
	}
}

//setInterval('content_status()',5000);



function content_status(cid,self_id_owner,orgnzr_id,meeting_type)

{



//alert('content_status()');

// 	var cid 	  = document.getElementById('cid').value;
// 
// 	var self_id_owner = document.getElementById('self_id').value;
// 
// 	var orgnzr_id 	  = document.getElementById('orgnzr_id').value;

	

	//alert(self_id_owner);

	var vals	=	cid+'|'+self_id_owner+'|'+orgnzr_id+'|'+meeting_type;

	//alert(vals);

	showContent('meeting-content-status.php',vals,'1','','');

	

	//alert('ss');

}



function chk_invitee(cid,uid)

{



//alert('chk_invitee()');

// 	var cid 	  = document.getElementById('cid').value;

// 	var self_id_owner = document.getElementById('self_id').value;

	var orgnzr_id 	  = document.getElementById('orgnzr_id').value;

	

	//alert(self_id_owner);

	var vals	=	cid+'|'+uid+'|'+orgnzr_id;

	//alert('vals'+vals);

	showContent('meeting-attendee-status.php',vals,'1','','');

	//alert('ss');

}

// function checkAll_chkboxz()

// {

// //alert("aa");

// 

// 	var frm		=	document.sch_meeting;

// 	

// 	

// 	if(frm.selectall.checked==true)

// 	{

// //alert("aa");

// 		for (i = 0; i < frm.length; i++)

// 		{

// 			if(frm.elements[i].type=='checkbox')

// 			{

// 				frm.elements[i].checked = true ;

// 			}

// 		}

// 	}

// 	else

// 	{//alert("aa");

// 		for (i = 0; i < frm.length; i++)

// 		{

// 			if(frm.elements[i].type=='checkbox')

// 			{

// 				frm.elements[i].checked = false ;

// 				

// 			}

// 		}

// 	}

// }

// function uncheck()

// {

// 	var frm=document.sch_meeting;

// 	if(frm.selectall.checked==true)

// 		frm.selectall.checked=false;

// }



function validateDelete_up()

{



	var doc = document.frm;

	var j=0;	



	for(i=1;i<doc.length;i++)

	{



		if(doc.elements[i].type=="checkbox" && doc.elements[i].checked==false)



		j=0;



		else if(doc.elements[i].type=="checkbox" && doc.elements[i].checked==true) 



		{



			j=1;



			break;



		}



	}



	if(j==0)

	{



	 	alert("Please select atleast one record!");

		return false;

	}

	else

	{

		return confirm('Are you sure you want to delete!');

	}	



}



function timedRefresh(timeoutPeriod) {



	setTimeout("location.reload(true);",timeoutPeriod);



}



function endMeeting()

{

//alert('kk');



	var where_to= confirm("Meeting wil be closed upon your exit.Are you sure you want to leave?");

	if (where_to== true)

	{

	//    window.location="http://yourplace.com/yourpage.htm";

		var cid = document.getElementById('cid').value;

		var vals = cid;

		//alert(vals);

		window.location = 'meeting-end.php?id='+cid;

	}

	

}



function leaveMeeting(inv_id)

{



	var where_to= confirm("Are you sure you want to leave?");

	if (where_to== true)

	{

	//    window.location="http://yourplace.com/yourpage.htm";

		var cid = document.getElementById('cid').value;

// 		alert(cid);

// 		alert(inv_id);

		window.location = 'leave_meeting.php?id='+cid+'&inv_id='+inv_id;

	}

}



function meeting_end(cid)



{

//alert(cid);

	showContent('meeting-end-opr.php',cid,1,'','');	



}



function refresh_content()

{

//	alert('s');

	setInterval('replace_content()',15000);



}

function replace_content()

{

//alert('c');

	showContent('todo-list-opr.php','1','1','content','');

	

}



function validateMail_popup(frm_name)

{



	var doc = frm_name;

	var inv_ids = 0;

	var count=0;

	var j=0;	

	for(i=1;i<doc.length;i++)



	{



		if(doc.elements[i].type=="checkbox" && doc.elements[i].checked==false)



		j=0;



		else if(doc.elements[i].type=="checkbox" && doc.elements[i].checked==true) 



		{



			j=1;

 		

			break;	



		}



	}	

	for(i=1;i<doc.length;i++)



	{

		if(doc.elements[i].type=="checkbox" && doc.elements[i].checked==true) 

		{

			count=count+1;

			var inv_id = doc.elements[i].value;

			inv_ids = inv_id+"-"+inv_ids; 

 			//alert(inv_ids);



		}

	}



	if(j==0)

	{



	 	alert("Please select atleast one record!");

		return false;

	}

	else

	{

		//alert(count);

 		var msg = confirm('Are you sure you want to send mail to selected invitees!');

		if(msg==true)

		{

			sendmail(inv_ids);

		}

	}	



}



function sendmail(inv_ids)

{

//alert('aa');

	var meeting_id	= document.getElementById('cid').value;

	var vals = meeting_id+'|'+inv_ids;

	//alert(vals);

	showContent('adm-invitees.php',vals,'1','frm_div','');

}



function ContentSearch_mail()

{

//alert('ss');

	var val1= document.getElementById('sel_criteria').value;

	var val2= document.getElementById('search_box').value;

	var val3 = '0';//to reset

	var vals=val1+'|'+val2+'|'+val3;

//alert(vals);

	showContent('sendmail-opr.php',vals,1,'content_div','');

}



function validate_reset()

{

//alert('ss');

	document.getElementById('sel_criteria').value = '0'

	var val1= document.getElementById('sel_criteria').value;

	document.getElementById('search_box').value = '';

	var val2= document.getElementById('search_box').value;

	var val3 = document.getElementById('reset_vals').value;//to reset 

// 	var val4 = document.getElementById('invi_ids').value;

	var vals=val1+'|'+val2+'|'+val3;

	//alert(vals);

	showContent('sendmail-opr.php',vals,1,'content_div','');

	//showContent('sendmail-opr.php',vals,1,'frm_div','');

}





function validateAddUser(frm_name,total)

{

//alert('ss');

 	var doc = frm_name;

//alert(doc);

	var inv_ids = 0;

	var count=0;

	var j=0;	

	var count_chk;

//alert(j);

//alert(total);

//alert(document.getElementById('checkAll1').value);

//alert(document.getElementById('invitee_ids').value);



//alert(j);



var public_meeting = document.getElementById('public_meeting');

var private_meeting = document.getElementById('private_meeting');

if((public_meeting.checked==false) && (private_meeting.checked==false))

{

	alert('Select meeting type from the parent page!');

	return false;

}

if(public_meeting.checked==true)

{

	meeting_type = "public";

	

}

else if(private_meeting.checked==true)

{

	meeting_type = "private";

	count_chk = '1';

}

//alert(meeting_type);



	for(i=0;i<total;i++)

	{

		//alert(i);

		if(document.getElementById('checkAll'+i).type=="checkbox" && document.getElementById('checkAll'+i).checked==false)

		j=0;

		else if(document.getElementById('checkAll'+i).type=="checkbox" && document.getElementById('checkAll'+i).checked==true) 

		{

			j=1;

			break;	

		}

		//alert(j);

	}

//alert(j);	

		

		for(i=0;i<total;i++)

		{

			if(document.getElementById('checkAll'+i).type=="checkbox" && document.getElementById('checkAll'+i).checked==true)

			{

				count=count+1;

				//alert(count);

	

			}

		}





		if(j=='0')

		{

	

			alert("Please select atleast one record!");

			return false;

		}

		else if(count_chk<count)

		{

			//alert(count);

			alert("You can't select more than 1 invitee for private meeting!");

			return false;

			

		}

		else

		{

		

			var msg = confirm('Are you sure you want to add selected invitees!');

			if(msg==true)

			{



				if(document.getElementById('invitee_ids').value!='')

{

	document.getElementById('invitee_ids').value='';

}

if(document.getElementById('inivtee_names').value!='')

{

	document.getElementById('inivtee_names').value='';

}



				for(i=0;i<total;i++)

				{



//alert(i);

		if(document.getElementById('checkAll'+i).type=="checkbox" && document.getElementById('checkAll'+i).checked==true) 

		{

			//alert(i);

			var inv_id = document.getElementById('checkAll'+i).value;

			var inv_mail = document.getElementById('inv_email'+i).value;

			//alert(inv_id);



			

			var invitee_ids = document.getElementById('invitee_ids').value;

			//alert(invitee_ids);

			//var broken_ids = invitee_ids.split(",");

			//alert('brids='+broken_ids);

			if(document.getElementById('invitee_ids').value=='')

				document.getElementById('invitee_ids').value=inv_id;

			else

				

				document.getElementById('invitee_ids').value+=","+inv_id;



			

			if(document.getElementById('inivtee_names').value=='')

				document.getElementById('inivtee_names').value=inv_mail;

			else

				document.getElementById('inivtee_names').value+=","+inv_mail;

		}

		

	}

				fb_hide();

			}

			

			

		}

//alert(j);

// 	if(j==0)

// 	{

// 

// 	 	alert("Please select atleast one record!");

// 		return false;

// 	}

// 	else

// 	{

// 		//alert(count);

//  		var msg = confirm('Are you sure you want to send mail to selected invitees!');

// 		if(msg==true)

// 		{

// 			add_invitee(id,mail_id);

// 		}

// 	}	





}



function add_invitee(inv_id,mail_id)

{

// 	alert('ddd');

// 	alert(inv_id);

// 		document.getElementById('inivtee_names').value=mail_id;

//  		document.getElementById('invitee_ids').value=inv_id;

// 		vals=USER_ID+'|'+0;

		//showContent('adm-email.php',vals,11,'msg_history','');

		if(document.getElementById('inivtee_names').value=='')

				document.getElementById('inivtee_names').value=mail_id;

			else

				document.getElementById('inivtee_names').value+=","+mail_id;

			

			if(document.getElementById('invitee_ids').value=='')

				document.getElementById('invitee_ids').value=inv_id;

			else

				document.getElementById('invitee_ids').value+=","+inv_id;

	tb_remove();

	

}





function online_attendees()

{

	var cid 	  = document.getElementById('cid').value;

	var self_id_owner = document.getElementById('self_id').value;

	var orgnzr_id 	  = document.getElementById('orgnzr_id').value;

	var vals	=	cid+'|'+self_id_owner+'|'+orgnzr_id;

	//alert(vals);

	showContent('refresh-attendees.php',vals,'1','show_attendees','');

}



function confirm_meeting()

{

	 i=0;j=0;y=0;

//alert(y);

	var frm=document.frm;

	for(i=0;i<frm.elements.length;i++)

	{//alert("g");

		if(frm.elements[i].type=='checkbox' && frm.elements[i].checked==true)

		y++;

		//alert('y='+y);

	}

//alert(y);

	if(y>0)

	{

		ans=confirm("Are you sure you want to confirm this meeting?");

			if (ans) 

			frm.submit();

			else 

				return false;

	}

	else 

	{

		alert("Select at least one record!"); return false;

	}	



	//return confirm("Are you sure you want to confirm this meeting?");

}



function deny_meeting()

{

	 i=0;j=0;y=0;

//alert(y);

	var frm=document.frm;

	for(i=0;i<frm.elements.length;i++)

	{//alert("g");

		if(frm.elements[i].type=='checkbox' && frm.elements[i].checked==true)

		y++;

		//alert('y='+y);

	}

//alert(y);

	if(y>0)

	{

		ans=confirm("Are you sure you want to deny this meeting?");

			if (ans) 

			frm.submit();

			else 

				return false;

	}

	else 

	{

		alert("Select at least one record!"); return false;

	}	



	//return confirm("Are you sure you want to confirm this meeting?");

}



function remove_attendee(cid,attnde_id)

{

	

	var vals = cid+'|'+attnde_id;

	var msg = confirm("Are you sure you want to remove this attendee from the meeting?");

	if(msg==true)

	{

		showContent('remove-attendees.php',vals,'1','','');

	}

}

//=============================
function page_redirect_BR(page,page_section)
{
	if(page=='pending-br-list')
		{
			//fb_hide();
			fb_show('br-list.php?navSection='+page_section);
		}
}
function page_redirect(page,page_sec,uid,prod_id)
	{
		if(page=='br')
		{
			//fb_hide();
			fb_show('br-list.php');
		}
		else if (page=='contact')
		{
			
			fb_show('my-contact-list.php');
		}
		else if (page=='ebooth')
		{
			//fb_hide();
			//fb_show('ebooth-prev.php?prod_id=<?php echo $prod_id;?>');
			if(page_sec=='index')
			{
				fb_show('ebooth_nav_prev.php?u_id='+uid+'&prod_id='+prod_id);
			}
			if(page_sec=='other')
			{
				fb_show('ebooth-prev.php?prod_id='+prod_id);
			}
		}
		else if (page=='bc')
		{
			if(page_sec=='index1')
			{
				fb_show('business-card-step3.php?u_id='+uid);
			}
			if(page_sec=='other1')
			{
				fb_show('business-card-step2.php');
			}
			if(page_sec=='from_innovation')
			{
				fb_show('innovations-room.php?u_id='+uid+'&prod_id='+prod_id);
			}
		}
	}
function getFullAccess()
{
	alert('Get PU2PU Full Access');
}
function bc_preview_stat(statId)
{
	fb_show('business-card-step2.php?statId='+statId);
}
function eb_preview_stat(statId)
{
	fb_show('ebooth-prev.php?statId='+statId);
}
function getFlashVersion()
{
  // ie
  try {
        try {
              var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
              try { axo.AllowScriptAccess = 'always'; }
          catch(e) { return '6,0,0'; }
        } catch(e) {}
        return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
  // other browsers
  } 
  catch(e) {
        try {
        if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)
        {
            return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
        }
        } catch(e) {}
  }
  return '0,0,0';
}
function flashVersion()
{/*alert('inside');*/
var version = getFlashVersion().split(',').shift();/*alert(version);*/
	if(version!='')
	{//alert(version);
		if(version>=10)
		{
			document.getElementById('flash_check').src = 'images/check_sys.jpg';
		}
		else
		{
			document.getElementById('flash_check').src = 'images/triangle_sys.jpg';
		}
		document.getElementById('flash_version').innerHTML = 'Your Version '+version+' / Required Version 10';
	}
}

function toggleSubMenu()
{
	//document.getElementById('to_do_list_sub_div').style.display='';
	$(document).ready(function(){
//Hide the tooglebox when page load
$("#to_do_list_sub_div").hide();
//slide up and down when hover over heading 2
$("#to_do_list_div").hover(function(){
// slide toggle effect set to slow you can set it to fast too.
$("#to_do_list_sub_div").slideToggle("fast");
return true;
});
});
// 	var elem = document.getElementById('to_do_list_sub_div').style;alert(elem.display);
// 	if(elem.dispaly=='none')
// 		elem.display='block';
// 	else
// 		elem.display='none';
}

function setActivityTime(u_id)
{
	showContent('refresh-attendees.php',u_id,'2','','');
}
function accessCheckAlert()
{
	alert('Get PU2PU Full Access');
}
function accessCheckAlertContact(checkBoxId)
{
	alert('Get PU2PU Full Access');
	document.getElementById(checkBoxId).checked=false;
}

//=============================

