﻿function ShowEmbedWithYear(VoteId,PageName,QueryString)
{
 
    var scrOfX = 0, scrOfY = 0;  
    if( typeof( window.pageYOffset ) == 'number' )
     {
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
     } 
     else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) )
      {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
      }
       else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) )
        {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
       }

    var myWidth = 0, myHeight = 0; 

    if( typeof( window.innerWidth ) == 'number' )
     {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } 
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
     {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    }
     else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
      {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }
var TotalWidth;
TotalWidth=myWidth+scrOfX;
displayDisabilityMasterPage(true); 
document.getElementById('ctl00_mainCopy_divMain').style.top=scrOfY+ parseInt(myHeight/2)-150 + 'px';
document.getElementById('ctl00_mainCopy_divMain').style.left=parseInt(TotalWidth/2)- parseInt(document.getElementById('ctl00_mainCopy_divMain').offsetWidth/2) + 'px'; 

document.getElementById('ctl00_mainCopy_txtLink').value ="http://www.govit.com/"+ PageName + "?" +QueryString;
document.getElementById('ctl00_mainCopy_hdnVoteIdtoLink').value =  VoteId;
return false;


}

function ShowEmbed(VoteId,BillNumber,Title)
{

var scrOfX = 0, scrOfY = 0;  
    if( typeof( window.pageYOffset ) == 'number' )
     {
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
     } 
     else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) )
      {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
      }
       else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) )
        {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
       }

    var myWidth = 0, myHeight = 0; 

    if( typeof( window.innerWidth ) == 'number' )
     {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } 
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
     {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    }
     else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
      {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }
var TotalWidth;
TotalWidth=myWidth+scrOfX;
displayDisabilityMasterPage(true); 
document.getElementById('ctl00_mainCopy_divMain').style.top=scrOfY+ parseInt(myHeight/2)-150 + 'px';
document.getElementById('ctl00_mainCopy_divMain').style.left=parseInt(TotalWidth/2)- parseInt(document.getElementById('ctl00_mainCopy_divMain').offsetWidth/2) + 'px'; 
var BillNumberForLink;
BillNumberForLink=BillNumber;
BillNumberForLink = BillNumberForLink.replace(/ /g, "_");
document.getElementById('ctl00_mainCopy_txtLink').value ="http://www.govit.com/"+ BillNumberForLink + "/" + Title + "/";
document.getElementById('ctl00_mainCopy_hdnVoteIdtoLink').value =  VoteId;
return false;

}    


function OpenLogin()
{

document.getElementById('divHeaderLoagin').style.display = '';
document.getElementById('ctl00_dvMemberInnerLogin').className = 'loginselect';
document.getElementById('ctl00_lnkbtnMemberLogin').className = 'bluebuttonsloginselect';
document.getElementById('ctl00_lblErrMsg').innerHTML='';
document.getElementById('ctl00_lblErrMsgPassword').innerHTML='';
document.getElementById('ctl00_txtPassword1').value=document.getElementById('ctl00_hdnPassword').value;
document.getElementById('ctl00_txtUsername1').value=document.getElementById('ctl00_hdnUserName').value;
document.getElementById('ctl00_txtUsername1').focus();
return false;   
}

function ValidateForgotPasswordPopUp()
{

var strError = '';
if (Trim(document.getElementById('ctl00_mainCopy_txtForgotEmail').value)=='')
{
document.getElementById('ctl00_mainCopy_lblErrorMsgForgotPassword').innerHTML = 'enter email address';
}
else if(!(ValidateEmail(Trim(document.getElementById('ctl00_mainCopy_txtForgotEmail').value))))
{    
document.getElementById('ctl00_mainCopy_lblErrorMsgForgotPassword').innerHTML = 'invalid email address';
} 
else
{
document.getElementById('ctl00_mainCopy_lblErrorMsgForgotPassword').innerHTML ='';
}
if(document.getElementById('ctl00_mainCopy_lblErrorMsgForgotPassword').innerHTML!='')
{       
return false; 
}
else
{
document.getElementById('ctl00_mainCopy_lblErrorMsgForgotPassword').innerHTML='';
return true;     
}
}


function OpenForgotPasswordDiv()
{
var scrOfX = 0, scrOfY = 0;  
    if( typeof( window.pageYOffset ) == 'number' )
     {
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
     } 
     else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) )
      {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
      }
       else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) )
        {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
       }

    var myWidth = 0, myHeight = 0; 

    if( typeof( window.innerWidth ) == 'number' )
     {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } 
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
     {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    }
     else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
      {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }
var TotalWidth;
TotalWidth=myWidth+scrOfX;

document.getElementById('ctl00_mainCopy_divForgotPassword').style.top=scrOfY+ parseInt(myHeight/2)-150 + 'px';
document.getElementById('ctl00_mainCopy_divForgotPassword').style.left=parseInt(TotalWidth/2)- parseInt(document.getElementById('ctl00_mainCopy_divForgotPassword').offsetWidth/2) + 'px'; 
document.getElementById('ctl00_mainCopy_lblErrorMsgForgotPassword').innerHTML = '';
document.getElementById('ctl00_mainCopy_lblErrorMsgForgotPassword').innerHTML = '';
return false;
}

function ResetPasswordConfirmation()
{
var scrOfX = 0, scrOfY = 0;  
    if( typeof( window.pageYOffset ) == 'number' )
     {
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
     } 
     else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) )
      {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
      }
       else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) )
        {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
       }

    var myWidth = 0, myHeight = 0; 

    if( typeof( window.innerWidth ) == 'number' )
     {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } 
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
     {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    }
     else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
      {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }
var TotalWidth;
TotalWidth=myWidth+scrOfX;
displayDisabilityMasterPage(true);
document.getElementById('ctl00_mainCopy_divResetPasswordConfirmation').style.top=scrOfY+ parseInt(myHeight/2)-150 + 'px';
document.getElementById('ctl00_mainCopy_divResetPasswordConfirmation').style.left=parseInt(TotalWidth/2)- parseInt(document.getElementById('ctl00_mainCopy_divResetPasswordConfirmation').offsetWidth/2) + 'px'; 
} 

function VoteSendConfirmation()
{
var scrOfX = 0, scrOfY = 0;  
    if( typeof( window.pageYOffset ) == 'number' )
     {
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
     } 
     else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) )
      {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
      }
       else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) )
        {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
       }

    var myWidth = 0, myHeight = 0; 

    if( typeof( window.innerWidth ) == 'number' )
     {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } 
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
     {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    }
     else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
      {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }
var TotalWidth;
TotalWidth=myWidth+scrOfX;
displayDisabilityMasterPage(true);
document.getElementById('ctl00_mainCopy_divVotesEmailConfirmation').style.top=scrOfY+ parseInt(myHeight/2)-150 + 'px';
document.getElementById('ctl00_mainCopy_divVotesEmailConfirmation').style.left=parseInt(TotalWidth/2)- parseInt(document.getElementById('ctl00_mainCopy_divVotesEmailConfirmation').offsetWidth/2) + 'px'; 

}  

function ShowSendEmail(VoteId, Subject, Message, VotesNo, VotesYes, UserName)
{
var scrOfX = 0, scrOfY = 0;  
    if( typeof( window.pageYOffset ) == 'number' )
     {
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
     } 
     else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) )
      {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
      }
       else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) )
        {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
       }

    var myWidth = 0, myHeight = 0; 

    if( typeof( window.innerWidth ) == 'number' )
     {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } 
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
     {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    }
     else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
      {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }
var TotalWidth;
TotalWidth=myWidth+scrOfX;
var BillNumberForBottom;
BillNumberForBottom=Trim(Subject);
if ((BillNumberForBottom.indexOf("HR")>=0)||(BillNumberForBottom.indexOf("hr")>=0))
{
BillNumberForBottom=BillNumberForBottom.replace(/HR/g, "H.R");
BillNumberForBottom=BillNumberForBottom.replace(/hr/g, "h.r");
}
BillNumberForBottom = BillNumberForBottom.replace(/ /g, ".");
VotesNo=VotesNo.replace("No", "")
VotesYes=VotesYes.replace("Yes", "")
displayDisabilityMasterPage(true); 
document.getElementById('ctl00_mainCopy_divEmailThisVote').style.top=scrOfY+ parseInt(myHeight/2)-150 + 'px';
document.getElementById('ctl00_mainCopy_divEmailThisVote').style.left=parseInt(TotalWidth/2)- parseInt(document.getElementById('ctl00_mainCopy_divEmailThisVote').offsetWidth/2) + 'px'; 
document.getElementById('ctl00_mainCopy_lblErrMsgSendEmail').innerHTML=''; 
document.getElementById('ctl00_mainCopy_txtEmail1').focus();
document.getElementById('ctl00_mainCopy_hdnVoteIdtoSendEmail').value =  VoteId;
document.getElementById('ctl00_mainCopy_txtSubject').value= "Check Out " + Subject;
document.getElementById('ctl00_mainCopy_txtEmail').value= "Hi,\n\nThis legislation is important, and Congress is voting on it any day.\n\nPlease cast your vote on www.govit.com, and have your vote sent to your representatives.\n\n" + Subject+ ":" + Message + "\n\nGovit members voted:\nYes " + VotesYes + "\nNo " + VotesNo + "\n\n" + BillNumberForBottom + "\n\nSincerely,\n" + UserName + "\n\nCopyright @ 2008 GovIt. All Rights Reserved.";
document.getElementById('ctl00_mainCopy_hdnTitleForPopUp').value= Message;
document.getElementById('ctl00_mainCopy_hdnBillNo').value= Subject;
document.getElementById('ctl00_mainCopy_hdnVotesNo').value= VotesNo;
document.getElementById('ctl00_mainCopy_hdnVotesYes').value= VotesYes;
return false;
}
function ShowFeedDialogue( templateId, billId,sponsorId,questionId,descriptionId,yesVoteVal,noVoteVal)
{   
     var billEle = document.getElementById(billId);
     var sponsorEle = document.getElementById(sponsorId);
     var descriptionEle = document.getElementById(descriptionId);
     var questionEle = document.getElementById(questionId);
    //var yesVoteEle = document.getElementById(yesVoteId);
    //var nosVoteEle = document.getElementById(noVoteId);
     var billTitle = questionEle.value;
     if( billTitle.length > 174 )
        {
           billTitle = billTitle.substring(0,173); 
           billTitle += "<a href='"+billEle.href+"'>...more</a>"
        }
	 billTitle = billTitle.replace("Description:","");

     var billarray = billEle.innerHTML.split(' ');
     var newbillNumber= "";
     if( billarray.length > 1 )
        {
            for( var i=0 ; i< billarray.length; i++ )
            {
	            newbillNumber += newbillNumber==""?billarray[i]: "."+billarray[i];
            }
        }

    billTitle = billTitle.replace(newbillNumber,"");
    newbillNumber = newbillNumber.replace("HR","H.R");
    billTitle = billTitle.replace(newbillNumber,"");

    var statusMsg = "";
    if( eval(yesVoteVal) > eval(noVoteVal) )
        statusMsg = "This vote is Winning";
     else
      statusMsg = "This vote is Losing";
     
    var comment_data = {"BillURL":""+billEle.href+"",
                        "BillNumber":""+billEle.innerHTML+"",
                        "BillTitle":""+billTitle+"",
                        "SponsoredBy":""+sponsorEle.innerHTML+"",                   
                        "VotedYes":""+yesVoteVal+"",
                        "VotedNo":""+noVoteVal+"",
                        "VoteStatusMsg":""+statusMsg+""};
                                 
  if( typeof(FB) != 'undefined' && FB.Connect && FB.Connect.get_status().get_isReady())
  {
    FB.Connect.showFeedDialog(templateId, comment_data, null, null, FB.FeedStorySize.shortStory, FB.RequireConnect.doNotRequire);
  }
}

function ShowBetweenLoginDiv(value, msg)
{
var scrOfX = 0, scrOfY = 0;  
    if( typeof( window.pageYOffset ) == 'number' )
     {
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
     } 
     else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) )
      {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
      }
       else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) )
        {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
       }

    var myWidth = 0, myHeight = 0; 

    if( typeof( window.innerWidth ) == 'number' )
     {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } 
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
     {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    }
     else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
      {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }
var TotalWidth;
TotalWidth=myWidth+scrOfX;
	displayDisabilityMasterPage(true); 

	document.getElementById('ctl00_mainCopy_divLogin').style.top=scrOfY+ parseInt(myHeight/2)-150 + 'px';
document.getElementById('ctl00_mainCopy_divLogin').style.left=parseInt(TotalWidth/2)- parseInt(document.getElementById('ctl00_mainCopy_divLogin').offsetWidth/2) + 'px'; 
	document.getElementById('ctl00_mainCopy_lblErrMsgForgotPassword').innerHTML='';
	document.getElementById('ctl00_mainCopy_lblErrMsgLogin').innerHTML='';
	if ((value!=1) && (value!=2))
	{
	document.getElementById('ctl00_mainCopy_txtPassword').value=document.getElementById('ctl00_hdnPassword').value;
	document.getElementById('ctl00_mainCopy_txtUsername').value=document.getElementById('ctl00_hdnUserName').value;
	}
	document.getElementById('ctl00_mainCopy_txtUsername').focus();
	
	if (value==1)
	{
		document.getElementById('ctl00_mainCopy_lblErrMsgLogin').innerHTML=msg;
		document.getElementById('ctl00_mainCopy_lblErrMsgForgotPassword').innerHTML='';
	}
	else if (value==2)
	{
		document.getElementById('ctl00_mainCopy_lblErrMsgLogin').innerHTML='';
		document.getElementById('ctl00_mainCopy_lblErrMsgForgotPassword').innerHTML=msg;
	}
	else
	{
		document.getElementById('ctl00_mainCopy_lblErrMsgLogin').innerHTML='';
		document.getElementById('ctl00_mainCopy_lblErrMsgForgotPassword').innerHTML='';
	}

	return false;
}

function ValidateSendEmailFields()
{
try
{  
var strError = "";

if(Trim(document.getElementById('ctl00_mainCopy_txtEmail1').value) == '' && Trim(document.getElementById('ctl00_mainCopy_txtEmail2').value) == '' && Trim(document.getElementById('ctl00_mainCopy_txtEmail3').value) == '' && Trim(document.getElementById('ctl00_mainCopy_txtEmail4').value) == '' && Trim(document.getElementById('ctl00_mainCopy_txtEmail5').value) == '' && Trim(document.getElementById('ctl00_mainCopy_txtEmail6').value) == '')
{
strError += ", Enter atleast one email";
}
else
{
if(Trim(document.getElementById('ctl00_mainCopy_txtEmail1').value)!='')
{
if(!ValidateEmail(Trim(document.getElementById('ctl00_mainCopy_txtEmail1').value)))
{
strError += ", Email 1";
}
}
if(Trim(document.getElementById('ctl00_mainCopy_txtEmail2').value)!='')
{
if(!ValidateEmail(Trim(document.getElementById('ctl00_mainCopy_txtEmail2').value)))
{
strError += ", Email 2";
}
}
if(Trim(document.getElementById('ctl00_mainCopy_txtEmail3').value)!='')
{
if(!ValidateEmail(Trim(document.getElementById('ctl00_mainCopy_txtEmail3').value)))
{
strError += ", Email 3";
}
}
if(Trim(document.getElementById('ctl00_mainCopy_txtEmail4').value)!='')
{
if(!ValidateEmail(Trim(document.getElementById('ctl00_mainCopy_txtEmail4').value)))
{
strError += ", Email 4";
}
}
if(Trim(document.getElementById('ctl00_mainCopy_txtEmail5').value)!='')
{
if(!ValidateEmail(Trim(document.getElementById('ctl00_mainCopy_txtEmail5').value)))
{
strError += ", Email 5";
}
}
if(Trim(document.getElementById('ctl00_mainCopy_txtEmail6').value)!='')
{
if(!ValidateEmail(Trim(document.getElementById('ctl00_mainCopy_txtEmail6').value)))
{
strError += ", Email 6";
}
}
}

if(Trim(document.getElementById('ctl00_mainCopy_txtSubject').value)=='')
{
strError += ",  Subject";

}

if(Trim(document.getElementById('ctl00_mainCopy_txtEmail').value)=='')
{
strError += ",  Message";

}  

if(strError.length > 0)
{
document.getElementById("ctl00_mainCopy_lblErrMsgSendEmail").innerHTML = "The following field(s) have invalid values: " + strError.substring(1) + ".";
return false;
}
else
{
document.getElementById("ctl00_mainCopy_lblErrMsgSendEmail").innerHTML = "";
return true;
}


}
catch(err)
{}
} 
function SelectallText()
{ 
document.getElementById('ctl00_mainCopy_txtLink').select();
}

function ValidatePopUpLogin()
{  
var strError = '';
if (Trim(document.getElementById('ctl00_mainCopy_txtUsername').value)=='')
{
document.getElementById('ctl00_mainCopy_lblErrMsgLogin').innerHTML="enter username / email";
}
else
{
document.getElementById('ctl00_mainCopy_lblErrMsgLogin').innerHTML="";
}
if(Trim(document.getElementById('ctl00_mainCopy_txtPassword').value)=="")
{
document.getElementById('ctl00_mainCopy_lblErrMsgForgotPassword').innerHTML="enter password";
}
else
{
document.getElementById('ctl00_mainCopy_lblErrMsgForgotPassword').innerHTML="";
}

if(document.getElementById('ctl00_mainCopy_lblErrMsgLogin').innerHTML !='' || document.getElementById('ctl00_mainCopy_lblErrMsgForgotPassword').innerHTML !='')
{       
return false; 
}
else
{
document.getElementById('ctl00_mainCopy_lblErrMsgLogin').innerHTML='';
document.getElementById('ctl00_mainCopy_lblErrMsgForgotPassword').innerHTML='';
return true;     
}   
}
function ShowAddFriend(VoteId)
{
var scrOfX = 0, scrOfY = 0;  
    if( typeof( window.pageYOffset ) == 'number' )
     {
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
     } 
     else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) )
      {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
      }
       else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) )
        {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
       }

    var myWidth = 0, myHeight = 0; 

    if( typeof( window.innerWidth ) == 'number' )
     {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } 
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
     {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    }
     else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
      {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }
var TotalWidth;
TotalWidth=myWidth+scrOfX;
displayDisabilityMasterPage(true); 
document.getElementById('ctl00_mainCopy_divAddFriend').style.top=scrOfY+ parseInt(myHeight/2)-150 + 'px';
document.getElementById('ctl00_mainCopy_divAddFriend').style.left=parseInt(TotalWidth/2)- parseInt(document.getElementById('ctl00_mainCopy_divAddFriend').offsetWidth/2) + 'px'; 
document.getElementById('ctl00_mainCopy_hdnMemberIdAddFriend').value =  VoteId;
return false;
} 

