var v_Tot_Records="";var JSG_alldivs = "", JSG_cp = "", JSG_akk = "http://imgs.bharatmatrimony.com",v_Req_Type, v_View_Type, v_File_Name,LastUrl='',checkcntei;
var dname = document.domain;  // for getting the domain name dynamically
 
// Function used for Apply class while clicking Interest link from left panel
 function classApply(clickingLP) {
	if(clickingLP ==1) {
	  $('#receive').addClass("linkon");
	  $('#sent').removeClass("linkon");
	 } else if(clickingLP ==2) {
	     $('#receive').removeClass("linkon");
	     $('#sent').addClass("linkon");
	  }
  }

function topEIClass(clickEvent,ClickPage){
	for(var i=1; i<=4; i++){
	 $('#'+ClickPage+i).removeClass("inactive");
	 $('#'+ClickPage+i).removeClass("active");
	}
	for(var j=1; j<=4; j++){
		if(j == clickEvent) {
	  		$('#'+ClickPage+j).addClass("active");
		}
		else {
			$('#'+ClickPage+j).addClass("inactive");}
	}
}

function confirmAccept(closeDiv){
	var	senderid=dgebid("senderid").value;
	var iid=dgebid("iid").value;
	var multiselect=dgebid("multiselect").value; var fromvp =0;
	if(dgebid("fromVp") && dgebid("fromVp").value != '')
		fromvp = dgebid("fromVp").value;
	arg="rand="+genNumbers()+"&st=1&iid="+iid+"&senderid="+senderid+"&all="+multiselect+"&VCS="+dgebid("VCS").value+"&fromVp="+fromvp;
	url="/expressinterest/expupdatependinglist.php";
	if(multiselect == 0 && dgebid("entry").value == 'FREE')
		jqajaxRequest(url,'GET',arg,'AcceptSucess');
	else if(multiselect == 0 && dgebid("entry").value == 'PAID'){
		jqajaxRequest(url,'GET',arg,closeDiv);
	}
	else 
		jqajaxRequest(url,'GET',arg,'cboxLoadedContent');
}

function disableActionStuff(dbCnt,deleteProfileCnt){
	if(dbCnt == deleteProfileCnt) {
		document.getElementById('removeLinks').innerHTML='';
		document.getElementById('removeLinksbottom').innerHTML='';
	}
}

function acceptAll(action,id) {
	var sellist = getSelList(action);
	idlist = sellist.split('|'); 
	if(idlist[0] != '') {
		accepturl ='http://'+dname+'/expressinterest/expupdatependinglist.php?rand='+genNumbers()+'&senderid='+idlist[0]+'&iid='+idlist[1]+'&st=1&all=1&Acceptconfirm=getConfirm';		 
		$("#accept"+id).attr('href',accepturl);
		$("#accept"+id).attr('class','litebox');		
		$(".litebox").colorbox($.extend({}, getParameters()));
		$(".litebox").colorbox({
			onLoad:function(){ 	
				setCloseDiv();				
			},			
			onClosed:function(){ 	
				$("#accept"+id).attr('href','javascript:void(0)');
				$("#accept"+id).attr('class','');
			}
		});

	} else {
		$("#accept"+id).attr('href','javascript:void(0)');
		$("#accept"+id).attr('class','');

	}
}

function setCloseDiv(){
	$("#cboxClose").remove();
	var $close = $('<div id="cboxClose" style="" onclick="$.colorbox.close();eirefreshMainWindow();" class="">close</div>').appendTo('#cboxContent');
}
function declineAll(action,id){
	var sellist = getSelList(action);
	idlist = sellist.split('|');
	if(idlist[0] != '') {		
		declineurl = 'http://'+dname+'/expressinterest/showdeclinemsg.php?rand='+genNumbers()+'&senderid='+idlist[0]+'&iid='+idlist[1]+'&st=2&all=1';	
		$("#decline"+id).attr('href',declineurl);
		$("#decline"+id).attr('class','litebox');
		$(".litebox").colorbox($.extend({}, getParameters()));
		$(".litebox").colorbox({
			onLoad:function(){ 	
				setCloseDiv();				
			},	
			onClosed:function(){ 	
				$("#decline"+id).attr('href','javascript:void(0)');
				$("#decline"+id).attr('class','');
			}
		});
	}else {
		$("#decline"+id).attr('href','javascript:void(0)');
		$("#decline"+id).attr('class','');
	}
}
function deleteAll(deltype,stat,page,refpg,action,id) {
	var sellist = getSelList(action); 
	idlist = sellist.split('|');  
	if(idlist[0] != '' || idlist[1] != '' || idlist[2] != '' || idlist[3] != '') {
 		var alldeletematriid = idlist[0] +"~"+ idlist[2];
		var alldeleteinterestId = idlist[1] +"~"+ idlist[3]; 
 		deleteurl = 'http://'+dname+'/expressinterest/expdelete.php?rand='+genNumbers()+'&senderid='+alldeletematriid+'&iid='+alldeleteinterestId+'&st='+stat+'&recdel='+deltype+'&cpg='+page+'&delete=getconfirm';
		$("#delete"+id).attr('href',deleteurl);	
		$("#delete"+id).attr('class','litebox');
		$(".litebox").colorbox($.extend({}, getParameters()));
		$(".litebox").colorbox({
			onLoad:function(){ 	
				setCloseDiv();				
			},	
			onClosed:function(){ 	
				$("#delete"+id).attr('href','javascript:void(0)');
				$("#delete"+id).attr('class','');
			}
		});
	}else {
		$("#delete"+id).attr('href','javascript:void(0)');
		$("#delete"+id).attr('class','');
	}
}

function expSentInterestNew() {
	sentnewurl = 'http://'+dname+'/expressinterest/expsentall.php?rand='+genNumbers()+'&page=sentnew&view='+v_View_Type+'&async=1'; 
	$(".litebox").attr('href',sentnewurl);		 
	$(".litebox").colorbox($.extend({}, getParameters()));
}

function acceptAllReminder(action,id) {
	var sellist = getSelList(action);
	idlist = sellist.split('|');
	if(idlist[0] != '') {
		acceptallreminderurl = 'http://'+dname+'/expressinterest/expsentpendingmailer.php?rand='+genNumbers()+'&senderid='+idlist[0]+'&iid='+idlist[1]+'&st=1&all=1';
		$("#sendremind"+id).attr('href',acceptallreminderurl);		 
		$("#sendremind"+id).attr('class','litebox');
		$(".litebox").colorbox($.extend({}, getParameters()));
		$(".litebox").colorbox({
			onLoad:function(){ 	
				setCloseDiv();				
			},	
			onClosed:function(){ 	
				$("#sendremind"+id).attr('href','javascript:void(0)');
				$("#sendremind"+id).attr('class','');
			}
		});
		
	}else {
		$("#sendremind"+id).attr('href','javascript:void(0)');
		$("#sendremind"+id).attr('class','');	}
}


function checkAll1(){ 
	try
	{
		var cnt = document.eifrm.listcnt.value;
		var obj;
		for(i=0; i<=cnt; i++)
		{
			obj = dgebid('profile'+i); obj1 = dgebid('profiledel'+i);
			if(document.eifrm.selectalltop.checked == true) {
				obj.checked = true; obj1.checked = true;
				document.eifrm.selectallbottom.checked = true;
			}
			else {
				obj.checked = false;
				$("#accept").attr('href','javascript:void(0)');
				$("#accept").attr('class','');

				document.eifrm.selectallbottom.checked = false;
			}
		}
		dgebid("showallerr").innerHTML = "";dgebid("showallerrbottom").innerHTML = "";		
	}
	catch (e)
	{
		alert(e)
	}
}

function eicheckall() {
	var totelement = document.eifrm.elements.length;
	for(var i = 0; i < totelement; i++) {
		var e = document.eifrm.elements[i];
		if(e.type == 'checkbox' && e.name.indexOf('profile[]') != -1) {
			if(e.checked == false) {
				if(document.eifrm.selectalltop) {
					document.eifrm.selectalltop.checked = false;
					document.eifrm.selectallbottom.checked = false;
					return false;
				}
			}else {
				if(document.eifrm.selectalltop) {
					document.eifrm.selectalltop.checked = true;
					document.eifrm.selectallbottom.checked = true;
				}
			}
		}
	}
}
function checkone(obj){
	dgebid(obj).checked=true;
}
function checkAll2(){
	try
	{
		var cnt = document.eifrm.listcnt.value;
		var obj;
		for(i=0; i<=cnt; i++)
		{
			obj = dgebid('profile'+i);
			if(document.eifrm.selectallbottom.checked == true) {
				obj.checked = true;
				document.eifrm.selectalltop.checked = true;
			}
			else {
				obj.checked = false;				
				$(".litebox").attr('href','');
				document.eifrm.selectalltop.checked = false;
			}
		}
		dgebid("showallerr").innerHTML = "";	dgebid("showallerrbottom").innerHTML = "";	
	}
	catch (e)
	{
	}
}
 
function getSelList(action)
{
	var idlist = '';
	var intlist = dellist = intdellist ='';
	try
	{
		var cnt = document.eifrm.listcnt.value;
		var obj;
		for(i=0; i<=cnt; i++)
		{ 
			obj = dgebid('profile'+i); obj1 = dgebid('profiledel'+i);
			if(obj.checked == true || obj1.checked == true)
			{
				if(dgebid('sender'+i)){
						if(idlist!='') {
							idlist = idlist + '~';
						}
						idlist = idlist+dgebid('sender'+i).value;
					}

					if(dgebid('int'+i)){
						if(intlist!='') {
							intlist = intlist + '~';
						}
						intlist = intlist+dgebid('int'+i).value;
					}

					if(action == 'delete') {
						if(dgebid('delprofile'+i)){
							if(dellist!='') {
								dellist = dellist + '~';
							}
							dellist = dellist+dgebid('delprofile'+i).value;
						}
						if(dgebid('intdel'+i)){
							if(intdellist!='') {
								intdellist = intdellist + '~';
							}
							intdellist = intdellist+dgebid('intdel'+i).value;
						}
					}
			}
		}	
	}
	catch (e)
	{
	}
	if((idlist.length == 0) && (intlist.length == 0) && (dellist.length == 0) && (intdellist.length == 0) && (action != 'reminder')) {
		dgebid("showallerr").innerHTML = "You have not selected the profiles you want to "+action;
		dgebid("showallerrbottom").innerHTML = "You have not selected the profiles you want to "+action;
	}

	else if((idlist.length == 0) && (intlist.length == 0) && (action == 'reminder')){
		dgebid("showallerr").innerHTML = "You have not selected the profiles you want to send reminder";
		dgebid("showallerrbottom").innerHTML = "You have not selected the profiles you want to send reminder";

	}
	
	else {
		dgebid("showallerr").innerHTML = "";dgebid("showallerrbottom").innerHTML = "";
	}
	//alert( idlist+'|'+intlist + '|'+ dellist+ '|' + intdellist);
	return idlist+'|'+intlist + '|'+ dellist+ '|' + intdellist;
}

function eiviewshowAll() {
	var exptxt = $("#eicontentshow").html();
	var expsplittxt = exptxt.split("~"); 
 	if (expsplittxt[6]) {
		dgebid("eicontentshow").innerHTML = expsplittxt[6];
	}else{
		dgebid("eicontent").innerHTML = exptxt;
	}
	JSG_alldivs = expsplittxt[0]; //total pg
	JSG_cp = expsplittxt[1]; //current pg
 	JSG_akk = "http://imgs.bharatmatrimony.com";
	v_Req_Type = expsplittxt[2]; //sub pages new,acc,dec
	v_View_Type = expsplittxt[3]; // basicview 1,2,4, or 6
	v_File_Name = expsplittxt[4]; //file name
	v_Tot_Records = expsplittxt[5]; 
	if(JSG_alldivs > 0) {
		expdisplayLink(); 
		//dgebid("exppaging1").innerHTML = exppagecontent;
		//dgebid("exppaging2").innerHTML = exppagecontent;
	}  else {
		dgebid("exppaging1").innerHTML = '';
		dgebid("exppaging2").innerHTML = '';
	}
	cookieTabUpdate(v_Req_Type);
}

// Page Navigation Related Stuff Start

function expdisplayLink() 
{
	var pretext="Prev";
	var nexttext="Next";
	var next_content="",prev_content="";page_str="";st_pg_val="";end_pg_val="";gotoExpTopcontent="";gotoExpBottomcontent="";
	var gotoclass='';
	if(parseInt(JSG_alldivs)!=0)
	{
  	    Jsg_total_pages=JSG_alldivs;
		if(Jsg_total_pages>1 && JSG_cp < Jsg_total_pages )
		{			
			next_content="<li><a href='#top' onclick='exploadprofiles("+(parseInt(JSG_cp)+1)+");' class='inactive pntr'>"+nexttext+" &raquo;</a></li>";
		}

		if(JSG_cp>1)
		{
			prev_content="<li><a href='#top' onclick='exploadprofiles("+(parseInt(JSG_cp)-1)+");' class='inactive  pntr'>&laquo; "+pretext+"</a></li>";
			end_pg_val=JSG_cp*10;st_pg_val=end_pg_val-9;
		}
		else { end_pg_val=10;st_pg_val=1; }

		if(end_pg_val>JSG_alldivs){end_pg_val=JSG_alldivs;}
		page_str="<div style='margin-top: 3px;' class='fright'><ul id='pagination'>"+prev_content+Ei_print_pgnav(JSG_cp)+next_content+"</ul></div>";	
	}

	if(Jsg_total_pages > 5){
		gotoExpTopcontent = "<div id='gotoEi' class='fright'><form name='goto_frmEi' id='goto_frmEi'><div class='fleft paddt2'><span> <input type=text name='gototxtEi' id='gototxtEi' class='textfield'  onKeyPress='return ei_go_entsub(event,1)'   maxlength='"+Jsg_total_pages+"' size='4' style='width: 30px; height: 15px; margin: 0px 10px'></span></div><div class='fleft'><input type='button' value='Go!'  onclick='Eigotopg(1);' class='button vsmall'></div></form></div>";

		gotoExpBottomcontent = "<div id='gotoEibottom' class='fright'><form name='goto_frmEibottom' id='goto_frmEibottom'><div class='fleft paddt2'><span> <input type=text name='gototxtEibottom' id='gototxtEibottom' class='textfield'  onKeyPress='return ei_go_entsub(event,2)'   maxlength='"+Jsg_total_pages+"' size='4' style='width: 30px; height: 15px; margin: 0px 10px'></span></div><div class='fleft'><input type='button' value='Go!'  onclick='Eigotopg(2);' class='button vsmall'></div></form></div>";

	}

	if($("#exppaging2"))
		 $("#exppaging2").html(""+gotoExpTopcontent+""+page_str);	
	if($("#exppaging1"))
		 $("#exppaging1").html(""+gotoExpBottomcontent+""+page_str);		
}

function ei_go_entsub(e,vals) 
{   
	var agt, isIe, isGecko, key;var keychar;var splcheck;

	agt = navigator.userAgent.toLowerCase();
	
	isIE    = ((agt.indexOf("msie")  != -1) && (agt.indexOf("opera") == -1));
	isGecko = ((agt.indexOf('gecko') != -1) && (agt.indexOf("khtml") == -1));
	ischrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;

	if (isIE)
	{
		key = window.event.keyCode;
		if (key == 13){Eigotopg(vals);event.keyCode = 0;}
	}

	if(isGecko)
	{
		key = e.which;
		if (key == 13){Eigotopg(vals);(e.which) ? e.which : 0;return false;}
	}
	
	if(ischrome)
	{
		key = e.which;
		if (key == 13){Eigotopg(vals);(e.which) ? e.which : 0;return false;}
	}

	keychar = String.fromCharCode(key)
	splcheck = /\'|\"/
	return !splcheck.test(keychar);
}

function Ei_print_pgnav(dispg_val)
{
	var print_msg="";cur_pg=dispg_val;
	if(cur_pg>3)
	{  
		var disp_pg=cur_pg;
		for(i=(parseInt(disp_pg)-2);i<=(parseInt(disp_pg)+2);i++)
		{ 
			if(i<=Jsg_total_pages)
			{ 
 				if(i==cur_pg)
				{print_msg=print_msg+"<li id='"+i+"'><a href=\"#top\" class=\"active\"  id=\"pagingdiv"+i+"link\">"+i+"</a></li>";}
				else{print_msg=print_msg+"<li id='"+i+"' style='color:#ff0000'><a href=\"#top\" class=\"inactive\" onclick=\"exploadprofiles("+i+")\" id=\"pagingdiv"+i+"link\">"+i+"</a></li>";}
			}
			else
			{ 
				print_msg=print_msg+"<li id='"+i+"' style='color:#0000ff'><span class=\"hidden\" id=\"pagingdiv"+i+"link\">"+i+"</span></li>";
			}
		}
	}
	
	if(cur_pg<=3)
	{
		for(i=1;i<=5;i++)
		{
			if(i<=Jsg_total_pages)
			{
				if(i==cur_pg)
				{print_msg=print_msg+"<li id='"+i+"' style='color:#00ff00'><a href=\"#top\" class=\"active\"  id=\"pagingdiv"+i+"link\">"+i+"</a></li>";}
				else{print_msg=print_msg+"<li id='"+i+"' style='color:#ff0000'><a href=\"#top\" class=\"inactive\" onclick=\"exploadprofiles("+i+")\" id=\"pagingdiv"+i+"link\">"+i+"</a></li>";}
			}
			else
			{
				print_msg=print_msg+"<li id='"+i+"' style='color:#0000ff'><span class=\"hidden\" id=\"pagingdiv"+i+"link\">"+i+"</span></li>";
			}
		}
	}
	/*if(Jsg_memberid!='' && Jsg_goto_page < parseInt(gotopagecount) && Jsg_goto_page > 1 && Jsg_tt=='one' && gotopageflag==1){*/
		print_msg+="<li>&nbsp; of &nbsp;</li><li><span  class='inactive'>"+Jsg_total_pages+"</span></li>";
	/*}*/
	return print_msg;
}


function Ei_goto_ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}

function Eigotopg(vals)
{
	if(vals == 1) var fname="gototxtEi";
	else var fname="gototxtEibottom";

	var upg_val=Ei_goto_ltrim(dgebid(fname).value, "0");

	if(IsEmpty(dgebid(fname), "text"))
	{alert("Enter page number");dgebid(fname).focus();}
	else if(upg_val=="")
	{alert("Enter page number");dgebid(fname).focus();}
	else if(!CompareValue(dgebid(fname).value,"1234567890"))
	{alert("Invalid page number");dgebid(fname).focus();}
	else
	{
	var usr_pgval=parseInt(Ei_goto_ltrim(dgebid(fname).value, "0")); 
 	var tot_mod=parseInt(JSG_alldivs%10);

	if(tot_mod!=0){tot_pg=parseInt(JSG_alldivs)+1;}
	
 	if(usr_pgval > JSG_alldivs){alert ("Page number exceeding number of results");dgebid(fname).focus();}
	else
	{exploadprofiles(usr_pgval);dgebid(fname).value="";}
	}
}
// Page Navigation Related Stuff End

function exploadprofiles(loadpagenum) {
	$(window).scrollTop(0);
	url = 'http://'+dname+'/expressinterest/'+v_File_Name;
	arg ='rand='+genNumbers()+'&page='+v_Req_Type+'&view='+v_View_Type+'&expcurpage='+loadpagenum+'&async=1&'; 
	jqajaxRequest(url,'GET',arg,'eicontentshow','',eiviewshowAll);
  }


function readCookie(name) {
	var nameEQ=name+"=";
	var ca=document.cookie.split(";");
	for(var i=0;i < ca.length;i++) {
		var c=ca[i];
		while (c.charAt(0)==" ") c=c.substring(1,c.length);
		if(c.indexOf(nameEQ)==0) return c.substring(nameEQ.length,c.length);
	} return "err";
}

function hotkeys() {
	shortcut.add("Right",function() {
		if(JSG_cp<JSG_alldivs) exploadprofiles((JSG_cp+1),"frompaging");
	});

	shortcut.add("Left",function() {
		if(JSG_cp<JSG_alldivs && JSG_cp>1) exploadprofiles((JSG_cp-1),"frompaging");
	});

	shortcut.add("1",function() {
		if(v_View_Type!="1") open_view_eiall('1',v_Req_Type,'');
	});

	shortcut.add("2",function() {
		if(v_View_Type!="2") open_view_eiall('2',v_Req_Type,'');
	});

	shortcut.add("4",function() {
		if(v_View_Type!="4") open_view_eiall('4',v_Req_Type,'');
	});

	shortcut.add("6",function() {
		if(v_View_Type!="6") open_view_eiall('6',v_Req_Type,'');
	});
}

function open_view_eiall(divid,expsubpg,expmainpg)
{ 
	if(JSG_alldivs == "" || JSG_alldivs == 0) {
		return false;
	} 
	if(expsubpg.indexOf('sent') >= 0) {
		loadpagenum = ei_get_new_page_number(divid);
		LastUrl = 'http://'+dname+'/expressinterest/expsentall.php?rand='+genNumbers()+'&page='+expsubpg+'&view='+divid+'&async=1&expcurpage='+loadpagenum;
		var url = 'http://'+dname+'/expressinterest/expsentall.php';
		var arg = 'rand='+genNumbers()+'&page='+expsubpg+'&view='+divid+'&async=1&expcurpage='+loadpagenum;
		jqajaxRequest(url,'GET',arg,'eicontentshow','',eiviewshowAll);

	} else {
		loadpagenum = ei_get_new_page_number(divid);
		LastUrl = 'http://'+dname+'/expressinterest/expreceivedall.php?rand='+genNumbers()+'&page='+expsubpg+'&view='+divid+'&async=1&expcurpage='+loadpagenum; 

		var url = 'http://'+dname+'/expressinterest/expreceivedall.php';
		var arg = 'rand='+genNumbers()+'&page='+expsubpg+'&view='+divid+'&async=1&expcurpage='+loadpagenum;

		jqajaxRequest(url,'GET',arg,'eicontentshow','',eiviewshowAll);
	}
}

function ei_get_new_page_number(n_View_Type) {
	var var1 = JSG_cp;
	var var2 = (v_View_Type * 10);
	var var3 = (n_View_Type * 10);
	var newcp = Math.ceil(parseInt(((var1-1)*parseInt((var2))+1)/(var3)))+1;
	if(newcp==0 || newcp=="") newcp=1;
		return newcp;
}
function cookieTabUpdate(ReqType){
 	var file = 'http://'+dname+'/expressinterest/geteicookie.php';
	var qs = 'type='+ReqType+"rand="+genNumbers();
 	$.ajax({  
			url: file,	
			type: 'GET',
			data: qs,
			success: function (html) {
				var splitHtml = html.split("~");
  				   if(document.getElementById('newEiRec') && splitHtml[0] != ''){
					   $('#newEiRec').html("("+splitHtml[0]+")");
				   }if(document.getElementById('acceptEiRec')  && splitHtml[1] != ''){
					   $('#acceptEiRec').html("("+splitHtml[1]+")");
				   }if(document.getElementById('filterEiRec')  && splitHtml[3] != ''){
					   $('#filterEiRec').html("("+splitHtml[3]+")");
				   }if(document.getElementById('declinedEiRec')  && splitHtml[2] != ''){
					   $('#declinedEiRec').html("("+splitHtml[2]+")");
				   }if(document.getElementById('sentAcceptEi') && splitHtml[6] != ''){
					   $('#sentAcceptEi').html("("+splitHtml[6]+")");
				   }if(document.getElementById('sentNewEi') && splitHtml[5] != ''){ 
					   $('#sentNewEi').html("("+splitHtml[5]+")");
				   }if(document.getElementById('sentdeclineEi') && splitHtml[8] != ''){
					   $('#sentdeclineEi').html("("+splitHtml[8]+")");
				   }if(document.getElementById('totalreceive') && splitHtml[7] != ''){
					   $('#totalreceive').html("("+splitHtml[7]+")");
				   }  if(document.getElementById('totalsent') && splitHtml[4] != ''){
					   $('#totalsent').html("("+splitHtml[4]+")");
				   }    
 			}
		}); 
}

function eirefreshMainWindow() {
	// This Variable comes while accept showing Sendmail option
	if(arguments[3] == '' || typeof(arguments[3]) == 'undefined'){
		var acceptRefresh = 'No';
	} else { var acceptRefresh = 'Yes'; }

 	if(arguments[0] =='' || typeof(arguments[0]) == 'undefined'){ 
		checkcntei=eicountallcheck();
		refoldpage=v_Tot_Records-checkcntei;
		v_Tot_Records=refoldpage;
		if((refoldpage%10==0)&&(JSG_cp>1)){JSG_cp=JSG_cp-1;} 
		LastUrl = 'http://'+dname+'/expressinterest/'+v_File_Name+'?rand='+genNumbers()+'&page='+v_Req_Type+'&view='+v_View_Type+'&expcurpage='+JSG_cp+'&async=1'; 	

		if(LastUrl !=''){
			var url = 'http://'+dname+'/expressinterest/'+v_File_Name;
			var arg = 'rand='+genNumbers()+'&page='+v_Req_Type+'&view='+v_View_Type+'&expcurpage='+JSG_cp+'&async=1';

 			if($('#actiondone').val() == 1 || acceptRefresh == 'Yes'){ 
				$(window).scrollTop(0);		
				jqajaxRequest(url,'GET',arg,'eicontentshow','',eiviewshowAll);
			}
		}
	} else {
		var viewcontactURL= 'http://'+dname+'/profiledetail/contactsummaryfunctions.php?action=1';
		var viewcontacthistoryArg = 'rand='+genNumbers()+'&loginid='+arguments[1]+'&viewid='+arguments[2];
		//if($('#actiondone').val() == 1)
			jqajaxRequest(viewcontactURL,'GET',viewcontacthistoryArg,'cboxLoadedContent');
	} 
}

function eicountallcheck(){ 
	if(document.eifrm){
var totelement=document.eifrm.elements.length;var chkcount=0;chkval="";for(var i=0;i<totelement;i++){ 
var e=document.eifrm.elements[i];if(e.type=='checkbox'&&e.name.indexOf('profile[]')!=-1){ 
if(document.eifrm.elements[i].checked==true){ 
chkcount++;if(chkval==""){ 
chkval=document.eifrm.elements[i].value;}else{ 
chkval=chkval+"~"+document.eifrm.elements[i].value;}}}}return chkcount;}}

function togglediv(alreadyopened,conc) {
 	 if(document.getElementById('opendiv').value != '' && alreadyopened != document.getElementById('opendiv').value){
		$("#"+document.getElementById('opendiv').value).show();
		document.getElementById(document.getElementById('opendiv').value).style.display ='none';

		document.getElementById(document.getElementById('opendiv').value).innerHTML ='';
		document.getElementById('opendiv').value ='';
	}
	if(document.getElementById('opendiv').value == '' && conc == 2){
		document.getElementById('opendiv').value=alreadyopened;
	}
 }   

 
function loadinbox(matid,fromVp,storeContent,all,CS) {
 	var inburl = 'http://'+dname+'/inbox/inbcontact.php';
	if(CS ==1) { var setWidth = '104'; var reqfrom ='VCS';}
	else if(fromVp ==1)   { var setWidth = '465'; var reqfrom ='EI';}
	else  { var setWidth = '430'; var reqfrom ='EI';}

	var inbarg = 'rand='+genNumbers()+'&EID='+matid+'&fromVp='+fromVp+'&hdiv=ei&all='+all+'&VCS='+CS+'&reqfrom='+reqfrom+'&arrowpadd='+setWidth;
	//var inbarg = 'rand='+genNumbers()+'&EID='+matid+'&fromVp='+fromVp+'&hdiv=ei&all=1';
	
 	if(all ==1)
		jqajaxRequest(inburl,'GET',inbarg,'cboxLoadedContent');
	else 	
		jqajaxRequest(inburl,'GET',inbarg,storeContent);

	
 } 
