var timer=0;function createCookie(name,value,days)
{alert('days');if(days)
{var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else
{var expires="";}
document.cookie=name+"="+value+expires+"; path=/";}
function readCookie(name)
{var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++)
{var c=ca[i];alert(c);while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)
{return c.substring(nameEQ.length,c.length);}}
return null;}
function eraseCookie(name)
{createCookie(name,"",-1);}
function validate(formName)
{var invalidChars='\/\'\\ ";:?!()[]\{\}~!#$%^&*+=^|,<>^';var addr=formName.primary_id.value;if(formName.gender_title.value=="")
{alert("Please select a Title.");formName.gender_title.focus();return false;}
else if(formName.fname.value=="")
{alert("Please enter a First Name.");formName.fname.focus();return false;}
else if(formName.lname.value=="")
{alert("Please enter a Last Name.");formName.lname.focus();return false;}
else if(formName.fname.value!="" && formName.mname.value!="" && formName.lname.value!="" && formName.fname.value==formName.lname.value && formName.fname.value==formName.mname.value)
{alert("First Name, Middle Name and Last Name should not be same.");formName.fname.focus();return false;}
else if(formName.fname.value!="" && formName.lname.value!="" && formName.fname.value==formName.lname.value)
{alert("First Name and Last Name should not be same.");formName.fname.focus();return false;}
else if(!validateEmail(formName.primary_id.value,true,true))
{formName.primary_id.focus();return false;}
else if(!validatePassword(formName.password.value))
{formName.password.focus();return false;}
else if(formName.select_country.value=="")
{alert("Please select a Country.");formName.select_country.focus();return false;}
else if(formName.check_value.value=="")
{alert("Please enter a Security String.");formName.check_value.focus();return false;}
for(i=0;i<invalidChars.length;i++)
{if(addr.indexOf(invalidChars.charAt(i),0)>-1)
{if(true)
{if(confirm("Email '"+addr+"' contains special characters. \\n Do you want to continue\?"))
{return(true);}
else{formName.primary_id.select();return(false);}}}}
formName.submit();}
function validatePart2(formname)
{if(!validateEmail(formname.pref_id.value,false,true))
{formname.pref_id.focus();return false;}
else if(!validateEmail(formname.ref_by.value,false,true))
{formname.ref_by.focus();return false;}
else if(!validateFileExtension(formname.user_icon.value))
{formname.user_icon.focus();return false;}
else if(formname.questions1.value=="")
{alert("Please select the first security question.");formname.questions1.focus();return false;}
else if(formname.a1.value=="")
{alert("Please enter the first answer.");formname.a1.focus();return false;}
else if(formname.questions2.value=="")
{alert("Please select the second security question.");formname.questions2.focus();return false;}
else if(formname.questions2.value==formname.questions1.value)
{alert("Please select the distinct security question.");formname.questions2.focus();return false;}
else if(formname.a2.value=="")
{alert("Please enter the second answer.");formname.a2.focus();return false;}
else if(formname.check_value.value=="")
{alert("Please enter a Security String.");formname.check_value.focus();return false;}
else if(!formname.adult.checked)
{alert("Please confirm your age.");formname.adult.focus();return false;}
else if(!formname.terms_conditions.checked)
{alert("Please accept the terms and conditions.");formname.terms_conditions.focus();return false;}
formname.submit();formname.detail_signup.disabled=true;}
function checkSecurityString(secString)
{if(formname.check_value.value=="")
{alert("Please enter the security string.");return false;}
else
{if(formname.check_value.value!=secString)
{alert("The security string does not match. Please re-enter.");return false;}}
return true;}
function decorate(div)
{if(div.style.backgroundColor=="")
div.style.backgroundColor="red";else
div.style.backgroundColor="";}
function loadData(tab,restoreData,hideTab)
{var title="";var fname="";var mname="";var lname="";var country="";var email="";var membership="";if(restoreData!="")
{var split=restoreData.split("|");var title=split[0];var fname=split[1];var mname=split[2];var lname=split[3];var country=split[4];var email=split[5];var membership=split[6];}
var content=document.getElementById('content');var tab1=document.getElementById('title1');var tab2=document.getElementById('title2');if(hideTab=="Y")
{tab2.style.visibility="hidden"}
else
{tab2.style.visibility=""}
content.style.borderTop="1px solid #EFEFEF";if(tab=="title1")
{tab1.style.backgroundColor="#EFEFEF"
tab2.style.backgroundColor="white"}
else if(tab=="title2")
{tab2.style.backgroundColor="#EFEFEF"
tab1.style.backgroundColor="white"}
xmlHttp=GetXmlHttpObject();if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{content.innerHTML=xmlHttp.responseText;}}
xmlHttp.open("GET","register_data.php?tab_id="+tab+"&title="+title+"&fname="+fname+"&mname="+mname+"&lname="+lname+"&country="+country+"&email="+email+"&membership="+membership+"&sid="+Math.random(),true);xmlHttp.send(null);}
function GetXmlHttpObject()
{var xmlHttp=null;try
{xmlHttp=new XMLHttpRequest();}
catch(e)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}
return xmlHttp;}
function showPopUp(temp)
{location.href="/login_info.php?action="+temp;}
function runLoop(time)
{time=time*1000;t=setTimeout("showPopUp()",time);}
function incrementTimer(temp)
{
	var newTemp=temp;
	var time=readCookie("popup_time");
	time=parseInt(time);
	if(!time)
	{time = 900;}
	var globalTimer=readCookie("global_timer");
	globalTimer=parseInt(globalTimer);
	if(!globalTimer)
	{
		globalTimer=timer+1;
	}
	else
	{
		globalTimer=globalTimer+1;
	}
	if(globalTimer<=time)
	{
		c=setTimeout("incrementTimer('"+newTemp+"')",1000);
	}
	else
	{
		globalTimer=0;showPopUp(newTemp);
	}
	if(globalTimer>=3000)
	{
		createCookie("global_timer","",-1);
	}
	createCookie("global_timer",globalTimer,1);
}
function hidePopUp()
{var popup=document.getElementById("popup");var fullpage=document.getElementById("fullpage");fullpage.style.visibility="hidden"
popup.style.visibility="hidden"}
function validateEmail(addr,man,db)
{if(addr==''&&man)
{if(db)alert('Please Enter a Valid Email.');return false;}
if(addr=='')return true;for(i=0;i<addr.length;i++)
{if(addr.charCodeAt(i)>127)
{if(db)alert("Email contains non ascii characters.");return false;}}
var atPos=addr.indexOf('@',0);var commaPos=addr.indexOf(',',0);if(commaPos!=-1)
{alert("Email Id cannot contain any comma");return false;}
if(atPos==-1)
{if(db)alert('Email must contain an @');return false;}
if(atPos==0)
{if(db)alert('Email must not start with @');return false;}
if(addr.indexOf('@',atPos+1)>-1)
{if(db)alert('Email must contain only one @');return false;}
if(addr.indexOf('.',atPos)==-1)
{if(db)alert('Email address must contain a period in the domain name.');return false;}
if(addr.indexOf('@.',0)!=-1)
{if(db)alert('Period must not immediately follow @ in Email.');return false;}
if(addr.indexOf('.@',0)!=-1)
{if(db)alert('Period must not immediately precede @ in Email.');return false;}
if(addr.indexOf('..',0)!=-1)
{if(db)alert('Two periods must not be adjacent in Email address.');return false;}
var suffix=addr.substring(addr.lastIndexOf('.')+1);if(suffix.length!=2&&suffix!='com'&&suffix!='net'&&suffix!='org'&&suffix!='edu'&&suffix!='int'&&suffix!='mil'&&suffix!='gov'&suffix!='arpa'&&suffix!='biz'&&suffix!='aero'&&suffix!='name'&&suffix!='coop'&&suffix!='info'&&suffix!='pro'&&suffix!='museum')
{if(db)alert('Invalid primary domain in the Email.');return false;}
return true;}
function validatePassword(password)
{var length=password.length;var alpha="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";var numeric="0123456789";var passCheck=new Array();var passCheckAlpha=new Array();var count=0; var alphaCount=0; if(length==0)
{alert("Please enter a Password.");return false;}
else if(length<8)
{alert("Password should be minimum 8 characters.");return false;}
else
{for(var i=0;i<length;i++)
{var str=password.charAt(i);passCheck[i]=numeric.indexOf(str);if(passCheck[i]!=-1)
{count=count+1;}}
for(var j=0;j<length;j++)
{var strAlpha=password.charAt(j);passCheckAlpha[j]=alpha.indexOf(strAlpha);if(passCheckAlpha[j]!=-1)
{alphaCount=alphaCount+1;}}
var regexAlphaNum=/^[0-9A-Za-z]+$/;var nonAlpanNumFound;if(regexAlphaNum.test(password)){nonAlpanNumFound=0;}else{nonAlpanNumFound=1;}}
if(count==0 || alphaCount==0 || nonAlpanNumFound==1)
{alert("Please enter an alphanumeric password.");return false;}
return true;}
function validateFileExtension(filename)
{var formatCheck=new Array(".jpg",".jpeg",".JPG",".JPEG",".gif",".GIF");var length=formatCheck.length;var count=0;var fileLength=filename.length;if(fileLength!=0)
{for(var i=0;i<length;i++)
{var extension=filename.lastIndexOf(formatCheck[i]);if(extension==-1)
{count=count+1;}
else if(extension!=-1)
{break;}}
if(count==length)
{alert("Invalid image format.");return false;}}
return true;}
function refreshCaptcha() { $("#captchaImg").attr("src", ""); d = new Date(); $("#captchaImg").attr("src", "/User/visual-captcha.php?"+d.getTime()); }

/*
 * Function.js
 */

function ShowDiv(divid,linkid)
{if(document.getElementById(divid).style.display!='block')
{document.getElementById(divid).style.display='block';}
else
{document.getElementById(divid).style.display='none';}
document.getElementById(linkid).style.display='none';}
function showHide(divid)
{if(divid=='HotPapers')
{document.getElementById('ContentHotPapers').style.display='block';document.getElementById('TabHotPapers').className='ActiveTab';}
else
{document.getElementById('ContentHotPapers').style.display='none';document.getElementById('TabHotPapers').className='Tab';}
if(divid=='LatestNews')
{document.getElementById('ContentLatestNews').style.display='block';document.getElementById('TabLatestNews').className='ActiveTab';}
else
{document.getElementById('ContentLatestNews').style.display='none';document.getElementById('TabLatestNews').className='Tab';}
if(divid=='Wequest')
{document.getElementById('ContentWequest').style.display='block';document.getElementById('TabWequest').className='ActiveTab';}
else
{document.getElementById('ContentWequest').style.display='none';document.getElementById('TabWequest').className='Tab';}
if(divid=='Articles'){
document.getElementById('ContentArticles').style.display='block';
document.getElementById('TabArticles').className='ActiveTab';
}
else{document.getElementById('ContentArticles').style.display='none';document.getElementById('TabArticles').className='Tab';}
if(divid=='PressRelease')
{document.getElementById('ContentPressRelease').style.display='block';document.getElementById('TabPressRelease').className='ActiveTab';}
else
{document.getElementById('ContentPressRelease').style.display='none';document.getElementById('TabPressRelease').className='Tab';}
/*if(divid=='ReportsForSale')
{document.getElementById('ContentReportsForSale').style.display='block';document.getElementById('TabReportsForSale').className='ActiveTab';}
else
{document.getElementById('ContentReportsForSale').style.display='none';document.getElementById('TabReportsForSale').className='Tab';}*/
if(divid=='Education')
{document.getElementById('ContentEducation').style.display='block';document.getElementById('TabEducation').className='ActiveTab';}
else
{document.getElementById('ContentEducation').style.display='none';document.getElementById('TabEducation').className='Tab';}}
function showHideAjax(divid,cat)
{var flag = false;
    if(divid=='HotPapers'){ document.getElementById('ContentHotPapers').style.display='block'; document.getElementById('TabHotPapers').className='ActiveTab'; document.getElementById('ContentHotPapers').innerHTML = 'Loading........';  $.ajax({  url: "/ajaxTab.php?var=hotpapers&cat="+cat,
  success: function(data){document.getElementById('ContentHotPapers').innerHTML = data;}
}); flag = true; }
else{document.getElementById('ContentHotPapers').style.display='none';document.getElementById('TabHotPapers').className='Tab';}
if(divid=='LatestNews'){document.getElementById('ContentLatestNews').style.display='block';document.getElementById('TabLatestNews').className='ActiveTab';document.getElementById('ContentLatestNews').innerHTML = 'Loading........';$.ajax({  url: "/ajaxTab.php?var=news&cat="+cat,
  success: function(data){document.getElementById('ContentLatestNews').innerHTML = '';$('#ContentLatestNews').append(data);}
}); flag = true; }
else{document.getElementById('ContentLatestNews').style.display='none';document.getElementById('TabLatestNews').className='Tab';}
if(divid=='Wequest'){document.getElementById('ContentWequest').style.display='block';document.getElementById('ContentWequest').innerHTML = 'Loading...';document.getElementById('TabWequest').className='ActiveTab';$.ajax({url: "/ajaxTab.php?var=wequest&cat="+cat,
  success: function(data){document.getElementById('ContentWequest').innerHTML = data;}}); flag = true;
}
else{document.getElementById('ContentWequest').style.display='none';document.getElementById('TabWequest').className='Tab';}
if(divid=='Articles'){
document.getElementById('ContentArticles').style.display='block';
document.getElementById('ContentArticles').innerHTML = 'Loading.....';
document.getElementById('TabArticles').className='ActiveTab';
$.ajax({
  url: "/ajaxTab.php?var=articles&cat="+cat,
  success: function(data){
    document.getElementById('ContentArticles').innerHTML = data;
}
}); flag = true;
}
else{document.getElementById('ContentArticles').style.display='none';document.getElementById('TabArticles').className='Tab';}
if(divid=='PressRelease')
{document.getElementById('ContentPressRelease').style.display='block';document.getElementById('ContentPressRelease').innerHTML = 'Loading..';
document.getElementById('TabPressRelease').className='ActiveTab';$.ajax({url: "/ajaxTab.php?var=press&cat="+cat,
  success: function(data){document.getElementById('ContentPressRelease').innerHTML = data;
}}); flag = true;
}
else
{document.getElementById('ContentPressRelease').style.display='none';document.getElementById('TabPressRelease').className='Tab';}
/*if(divid=='ReportsForSale' || divid=='Reports For Sale')
{
document.getElementById('ContentReportsForSale').style.display='block';
document.getElementById('ContentReportsForSale').innerHTML='Loading...';
document.getElementById('TabReportsForSale').className='ActiveTab';
$.ajax({
  url: "/ajaxTab.php?var=reports&cat="+cat,
  success: function(data){
    document.getElementById('ContentReportsForSale').innerHTML = data;
}
}); flag = true;

}
else
{document.getElementById('ContentReportsForSale').style.display='none';document.getElementById('TabReportsForSale').className='Tab';}*/
if(divid=='Education')
{
document.getElementById('ContentEducation').style.display='block';
document.getElementById('ContentEducation').innerHTML = 'Loading...';
document.getElementById('TabEducation').className='ActiveTab';
$.ajax({
  url: "/ajaxTab.php?var=isef&cat="+cat,
  success: function(data){
    document.getElementById('ContentEducation').innerHTML = data;
}
}); flag = true;

}
else
{document.getElementById('ContentEducation').style.display='none';document.getElementById('TabEducation').className='Tab';}
if(!flag){
showHideAjax('LatestNews',cat);
}
}

function showHideLoginBox(divid)
{if(divid=='Member')
{document.getElementById('ContentMember').style.display='block';document.getElementById('TabMember').className='ActiveTab';}
else
{document.getElementById('ContentMember').style.display='none';document.getElementById('TabMember').className='Tab';}
if(divid=='Reseller')
{document.getElementById('ContentReseller').style.display='block';document.getElementById('TabReseller').className='ActiveTab';}
else
{document.getElementById('ContentReseller').style.display='none';document.getElementById('TabReseller').className='Tab';}
if(divid=='Advertiser')
{document.getElementById('ContentAdvertiser').style.display='block';document.getElementById('TabAdvertiser').className='ActiveTab';}
else
{document.getElementById('ContentAdvertiser').style.display='none';document.getElementById('TabAdvertiser').className='Tab';}}
function showHideHotRecentMembers(divid)
{if(divid=='Hot')
{document.getElementById('TabHot').className='ActiveTab';}
else
{document.getElementById('TabHot').className='Tab';}
if(divid=='Recent')
{document.getElementById('TabRecent').className='ActiveTab';}
else
{document.getElementById('TabRecent').className='Tab';}
var rnd=Math.random();divMembers=document.getElementById('recentMembers');xmlHttp=GetXmlHttpObject();if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{divMembers.innerHTML=xmlHttp.responseText;}
else
{divMembers.innerHTML="<div style='height:160px' align='center'><br/><img src=\"/Images/ajax-loader1.gif\" /><b>Loading...</b></div><div class=\"ClearBoth\"></div>";}}
xmlHttp.open("GET","/get_random_members.php?show="+divid+"&rand="+rnd,true);xmlHttp.send(null);}
function showBorder(divId)
{var bordering=document.getElementById(divId);bordering.style.border="10px solid #CCCCCC"}
function hideBorder(divId)
{var bordering=document.getElementById(divId);bordering.style.border="10px solid transparent"}
function showLayer(e,layerId,loginId,extraOptions,libOptions,height)
{var mozilla=document.getElementById&&!document.all
var ie=(document.all)?true:false;var layers=document.getElementById(layerId);var bodyHeight=document.body.scrollHeight-e.clientY;if(e.which==3||e.button==2)
{layers.style.visibility='Visible';if(typeof(e.pageX)=='number')
{var xcoord=e.pageX;var ycoord=e.pageY;if(bodyHeight<1050)
{layers.style.left=xcoord-5+'px';layers.style.top=ycoord-125+'px';}
else
{layers.style.left=xcoord-5+'px';layers.style.top=ycoord-5+'px';}
layers.style.height=height;}
else if(typeof(e.clientX)=='number')
{var xcoord=e.clientX;var ycoord=e.clientY;if(document.body&&(document.body.scrollLeft||document.body.scrollTop))
{xcoord+=document.body.scrollLeft;ycoord+=document.body.scrollTop;}
else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop))
{xcoord+=document.documentElement.scrollLeft;ycoord+=document.documentElement.scrollTop;}
if(bodyHeight<1050)
{layers.style.left=xcoord-5+'px';layers.style.top=ycoord-130+'px';}
else
{layers.style.left=xcoord-5+'px';layers.style.top=ycoord-5+'px';}
layers.style.height=height;}}
xmlHttp=GetXmlHttpObject();if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{layers.innerHTML=xmlHttp.responseText;}}
xmlHttp.open("GET","/Paper/menu_index.php?login_id="+loginId+"&extra_options="+extraOptions+"&library_option="+libOptions+"&sid="+Math.random(),true);xmlHttp.send(null);}
function hide_menu(layer)
{layer.style.visibility='hidden'}
function show_menu(layer)
{layer.style.visibility=''}
function blinkIt()
{if(!document.all)return;else
{for(i=0;i<document.all.tags('blink').length;i++)
{s=document.all.tags('blink')[i];s.style.visibility=(s.style.visibility=='visible')?'hidden':'visible';}}}
function check_http()
{}
function redirect_to_signup()
{var clicks=readCookie('random_clicks');var tracker=readCookie('track_user');clicks=parseInt(clicks);tracker=parseInt(tracker);if(tracker>=clicks)
{var sPath=window.location;location.href="/User/registration_page.php?error_type=2&action_page="+sPath;}}
function trim(stringValue)
{return stringValue.replace(/(^\s*|\s*$)/,"");}
function validatePost()
{var trimmedText=trim(document.postQ.ask.value);var wesrchUrl=trim(document.postQ.wesrch_url.value);var pattern1=/^http:\/\/.*.wesrch.com.*$/;var pattern2=/^https:\/\/.*.wesrch.com.*$/;if(trimmedText=="")
{alert("Please Post a Question.");return false;}
else if(wesrchUrl.length!=0&&!(wesrchUrl.match(pattern1)||wesrchUrl.match(pattern2)))
{alert("Invalid URL! \nPlease Refer any wesrch url only.Like http://www.wesrch.com/..");document.postQ.wesrch_url.select();return false;}
else if(!checkAbuse(document.postQ.ask,"Question"))
{return false;}
else
{createCookie("insertOnce","done",1);}}
function validateAnswer()
{var trimmedText=trim(document.postA.answer.value);if(trimmedText=="")
{alert("Please Post a Answer.");return false;}
else if(!checkAbuse(document.postA.answer,"Answer"))
{return false;}}
function validateAbuse()
{var trimmedText=trim(document.postAbuse.abuse.value);if(trimmedText=="")
{alert("Please let us know why do you feel this is inappropriate. Please enter a comment.");return false;}
else if(!checkAbuse(document.postAbuse.abuse,"Comment"))
{return false;}}
function deleteCookie()
{if(readCookie("insertOnce")!="")
eraseCookie("insertOnce")}
function showQuestions(tab)
{var content=document.getElementById('content');xmlHttp=GetXmlHttpObject();if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{content.innerHTML=xmlHttp.responseText;}
else
{content.innerHTML="<br><br><p><center><img src='/Images/loading.gif' alt='Loading'></center></p>";}}
xmlHttp.open("GET","/ask/ask_wesrch_data.php?tab_id="+tab+"&sid="+Math.random(),true);xmlHttp.send(null);}
function show_text(divId,val,e)
{var myDiv=document.getElementById(divId);if(val<=-1&&(e.keyCode!=8&&e.keyCode!=46&&e.keyCode!=37&&e.keyCode!=38&&e.keyCode!=39&&e.keyCode!=40&&e.keyCode!=16))
{alert("You have exceeded the limit.");return false;}
else
{myDiv.innerHTML=val;}}
function incrDecr(thumb,type,id)
{var idAppend=""
var trackId=new Array();var askWesrchCookie=readCookie("voteOnce");var insertId=id+type;if(askWesrchCookie==null)
{idAppend=insertId;}
else
{var chunks=idAppend.split("|");for(i=0;i<chunks.length;i++)
{if(insertId!=chunks[i])
{idAppend=askWesrchCookie+"|"+id+type;}}}
var thumbType=thumb.id;xmlHttp=GetXmlHttpObject();if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{thumb.innerHTML=xmlHttp.responseText;createCookie("voteOnce",idAppend,1);}}
xmlHttp.open("GET","/ask/ask_wesrch_data.php?thumb="+thumbType+"&id="+id+"&type="+type+"&&checkStr="+insertId+"&sid="+Math.random(),true);xmlHttp.send(null);}
function glow(content)
{content.innerHTML="<img id='abimg' src='/Images/abuse_flag.jpg' style='vertical-align:middle'>&nbsp;&nbsp;Report Abuse";}
function unglow(content)
{content.innerHTML="<img id='abimg' src='/Images/abuse_flag_blank.gif' style='vertical-align:middle'>&nbsp;&nbsp;Report Abuse";}
function checkAbuse(text,where)
{var abuseStr=readCookie("cookie_abusive_words");abuseStr=decodeURI(abuseStr);abuseList=abuseStr.split("|");var trimmedText=trim(text.value);var titleArray=trimmedText.split(' ');for(i=0;i<abuseList.length;i++)
{for(j=0;j<titleArray.length;j++)
{if(titleArray[j]==abuseList[i])
{alert('Please avoid using abusing words in '+where+'. The word you used was '+abuseList[i]);return false;}}}
return true;}
var transparentDiv
var newimg
var Sname;Sname="";function browserSize()
{var bodyWidth=document.documentElement.clientWidth;var bodyHeight=document.documentElement.clientHeight;var bodyWidth,bodyHeight;if(self.innerHeight)
{bodyWidth=self.innerWidth;bodyHeight=self.innerHeight;}
else if(document.documentElement&&document.documentElement.clientHeight)
{bodyWidth=document.documentElement.clientWidth;bodyHeight=document.documentElement.clientHeight;}
else if(document.body)
{bodyWidth=document.body.clientWidth;bodyHeight=document.body.clientHeight;}
return[bodyWidth,bodyHeight];}
function showSaveDialog_search(e,loginId,role,primaryId,searchWord,wordCriteria,graphicsCriteria,dateCriteria,pageCriteria,paperType,searchIn,categoryNames,documentType,sortType,sortParameter,actionPage)
{if(loginId=="")
{var error="Please login to use this feature.";location.href="../Documents/intermidate_page.php?error_data="+error+"&action_page="+actionPage;}
else
{var bodyWidth=document.body.scrollWidth;var bodyHeight=document.body.scrollHeight;if(document.body.clientHeight>bodyHeight)
{bodyHeight=document.body.clientHeight;}
if(document.body.clientWidth>bodyWidth)
{bodyWidth=document.body.clientWidth;}
var dialog=document.getElementById("saveDialog");var fullpage=document.getElementById("fullpage");dialog.style.visibility=""
fullpage.style.visibility=""
fullpage.style.width=bodyWidth+"px"
fullpage.style.height=bodyHeight+"px"
fullpage.style.zIndex="1001"
dialog.style.zIndex="1002"
if(e.pageX!=null)
{if(e.pageX>1000)
{dialog.style.left=e.pageX-240+"px";dialog.style.top=e.pageY+10+"px";}
else
{dialog.style.left=e.pageX+10+"px";dialog.style.top=e.pageY+10+"px";}}
else
{var xcoord=e.clientX;var ycoord=e.clientY;if(document.body&&(document.body.scrollLeft||document.body.scrollTop))
{xcoord+=document.body.scrollLeft;ycoord+=document.body.scrollTop;}
else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop))
{xcoord+=document.documentElement.scrollLeft;ycoord+=document.documentElement.scrollTop;}
if(xcoord>1000)
{dialog.style.left=xcoord-305+"px";dialog.style.top=ycoord+10+"px";}
else
{dialog.style.left=xcoord+10+"px";dialog.style.top=ycoord+10+"px";}}
xmlHttp=GetXmlHttpObject();if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{document.getElementById('saveDialog').innerHTML=xmlHttp.responseText;}}
var qury="login_id="+encodeURIComponent(loginId)+"|role="+encodeURIComponent(role)+"|primary_id="+encodeURIComponent(primaryId)+"|search_word="+encodeURIComponent(searchWord)+"|word_criteria="+encodeURIComponent(wordCriteria)+"|graphics_criteria="+encodeURIComponent(graphicsCriteria)+"|date_criteria="+encodeURIComponent(dateCriteria)+"|page_criteria="+encodeURIComponent(pageCriteria)+"|paper_type="+encodeURIComponent(paperType)+"|search_in="+encodeURIComponent(searchIn)+"|category_names="+encodeURIComponent(categoryNames)+"|document_type="+encodeURIComponent(documentType)+"|sort_type="+encodeURIComponent(sortType)+"|sort_parameter="+encodeURIComponent(sortParameter)+"|action_page="+encodeURIComponent(actionPage);var url="show_save_dialog.php";var query="qry="+qury+"&sid="+Math.random();var contentType="application/x-www-form-urlencoded; charset=UTF-8";xmlHttp.open("post",url,true);xmlHttp.setRequestHeader("Content-Type",contentType);xmlHttp.send(query);}}
function hideSearchDialog()
{var dialog=document.getElementById("saveDialog");var fullpage=document.getElementById("fullpage");fullpage.style.visibility="hidden"
dialog.style.visibility="hidden"
Sname="";}
function validate_search_save(saveName)
{Sname="";Sname=saveName.value;}
function saveSearchInfo(query,name)
{if(name=="")
{errorDisplay.innerHTML="<font size='2px' color='red'>Name cannot be empty</font>";return false;}
else
{xmlHttp=GetXmlHttpObject();if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{name="";document.getElementById('saveDialog').innerHTML=xmlHttp.responseText;}}
var url="save_to_library.php";var query1="qry="+encodeURIComponent(query)+"|save_name="+encodeURIComponent(name)+"|sid="+Math.random();var contentType="application/x-www-form-urlencoded; charset=UTF-8";xmlHttp.open("post",url,true);xmlHttp.setRequestHeader("Content-Type",contentType);xmlHttp.send(query1);}}
function show_KeywordAlert(e,loginId,role,primaryId,searchWord,wordCriteria,graphicsCriteria,dateCriteria,pageCriteria,paperType,searchIn,categoryNames,documentType,sortType,sortParameter,actionPage,alertSql)
{if(loginId=="")
{var error="Please login to use this feature.";location.href="../Documents/intermidate_page.php?error_data="+error+"&action_page="+actionPage;}
else
{var bodyWidth=document.body.scrollWidth;var bodyHeight=document.body.scrollHeight;if(document.body.clientHeight>bodyHeight)
{bodyHeight=document.body.clientHeight;}
if(document.body.clientWidth>bodyWidth)
{bodyWidth=document.body.clientWidth;}
var dialog=document.getElementById("KeywordAlert");var fullpage=document.getElementById("fullpage");dialog.style.visibility=""
fullpage.style.visibility=""
fullpage.style.width=bodyWidth+"px"
fullpage.style.height=bodyHeight+"px"
fullpage.style.zIndex="1001"
dialog.style.zIndex="1002"
if(e.pageX!=null)
{if(e.pageX>1000)
{dialog.style.left=e.pageX-240+"px";dialog.style.top=e.pageY+10+"px";}
else
{dialog.style.left=e.pageX+10+"px";dialog.style.top=e.pageY+10+"px";}}
else
{var xcoord=e.clientX;var ycoord=e.clientY;if(document.body&&(document.body.scrollLeft||document.body.scrollTop))
{xcoord+=document.body.scrollLeft;ycoord+=document.body.scrollTop;}
else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop))
{xcoord+=document.documentElement.scrollLeft;ycoord+=document.documentElement.scrollTop;}
if(xcoord>1000)
{dialog.style.left=xcoord-305+"px";dialog.style.top=ycoord+10+"px";}
else
{dialog.style.left=xcoord+10+"px";dialog.style.top=ycoord+10+"px";}}
xmlHttp=GetXmlHttpObject();if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{document.getElementById('KeywordAlert').innerHTML=xmlHttp.responseText;}}
var qury="login_id="+encodeURIComponent(loginId)+"|role="+encodeURIComponent(role)+"|primary_id="+encodeURIComponent(primaryId)+"|search_word="+encodeURIComponent(searchWord)+"|word_criteria="+encodeURIComponent(wordCriteria)+"|graphics_criteria="+encodeURIComponent(graphicsCriteria)+"|date_criteria="+encodeURIComponent(dateCriteria)+"|page_criteria="+encodeURIComponent(pageCriteria)+"|paper_type="+encodeURIComponent(paperType)+"|search_in="+encodeURIComponent(searchIn)+"|category_names="+encodeURIComponent(categoryNames)+"|document_type="+encodeURIComponent(documentType)+"|sort_type="+encodeURIComponent(sortType)+"|sort_parameter="+encodeURIComponent(sortParameter)+"|action_page="+encodeURIComponent(actionPage);var url="show_keyword_alert.php";var query="qry="+qury;var contentType="application/x-www-form-urlencoded; charset=UTF-8";xmlHttp.open("post",url,true);xmlHttp.setRequestHeader("Content-Type",contentType);xmlHttp.send(query);}}
function hideDialog()
{var dialog=document.getElementById("KeywordAlert");var fullpage=document.getElementById("fullpage");fullpage.style.visibility="hidden"
dialog.style.visibility="hidden"
Sname="";}
function validate_save(saveName)
{Sname="";Sname=saveName.value;}
function saveInfo(query)
{xmlHttp=GetXmlHttpObject();if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{document.getElementById('KeywordAlert').innerHTML=xmlHttp.responseText;}}
var url="save_to_alert.php";var query1="qry="+encodeURIComponent(query);var contentType="application/x-www-form-urlencoded; charset=UTF-8";xmlHttp.open("post",url,true);xmlHttp.setRequestHeader("Content-Type",contentType);xmlHttp.send(query1);}
function GetXmlHttpObject()
{var xmlHttp=null;try
{xmlHttp=new XMLHttpRequest();}
catch(e)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}
return xmlHttp;}


//http://herd.idhasoft.us/Js/sharebookmark.js

function blockError(){return true;}
	    window.onerror = blockError;
	    var dtTT_startofpage = new Date();
	    var rndtno = Math.random();
function getQueryString(key)
{
	var qString = window.location.search;

	if (qString.indexOf('?'+ key) > -1)
	{
  		qString = qString.substr(qString.indexOf('?'+ key)) ;
 	}
 	else if (qString.indexOf('&'+ key) > -1)
	{
  		qString = qString.substr(qString.indexOf('&'+ key)) ;
 	}
 	else
	{
  		 return "";
 	}
 	 qString = qString.split('=')[1];
	 qString = qString.split('&')[0];
	 return unescape(qString);
}


var addtoLayout='';
var addtoMethod=1;
var AddURL = getQueryString("url");
var AddTitle = getQueryString("title");
var txtVersion = "1.1";
var addtoInterval = null;
var popupWin = '';
function intervalMgr(){
		if(/Safari/i.test(navigator.userAgent)){ //Test for Safari
			var addtoInterval=setInterval(function(){
	  		if(/loaded|complete/.test(document.readyState)){
				clearInterval(addtoInterval)
				closeAddTo()
	  		}}, 1000)
		}
		else{var addtoInterval = setInterval("closeAddTo();",1000);}
	}
function addtoWin(addtoFullURL)
{
	if (!popupWin.closed && popupWin.location){
		popupWin.location.href = addtoFullURL;
		intervalMgr();
	}
	else{
		popupWin = window.open(addtoFullURL);
		if (!popupWin.opener) popupWin.opener = self;
		intervalMgr();
	}
	if (window.focus) {popupWin.focus()}
	return false;
}

function closeAddTo() {
	if (!popupWin.closed && popupWin.location){
		if (popupWin.location.href == AddURL)
		popupWin.close();
	}
	else {
		clearInterval(addtoInterval)
		return true
	}
}
function addto(addsite){
		switch(addsite){
		case 0:	//	Itimes
			var AddSite = "http://www.addtobookmarks.com/socialbookmarking.htm?";
			var AddUrlVar = "url";
			var AddTitleVar = "title";
			var AddNoteVar = "";
			var AddReturnVar = "";
			var AddOtherVars = "";	
			break	
		case 1:	//	Delicious
		//alert("case1")
			var AddSite = "http://del.icio.us/post?";
			var AddUrlVar = "url";
			var AddTitleVar = "title";
			var AddNoteVar = "";
			var AddReturnVar = "";
			var AddOtherVars = "";	
			break
		case 2:	//	Facebook
			var AddSite = "http://www.facebook.com/sharer.php?";
			var AddUrlVar = "u";
			var AddTitleVar = "t";
			var AddNoteVar = "";
			var AddReturnVar = "";
			var AddOtherVars = "";		
			break
		case 3:	//	Stumble Upon
			var AddSite = "http://www.stumbleupon.com/submit?";
			var AddUrlVar = "url";
			var AddTitleVar =  "title";
			var AddNoteVar =  "";
			var AddReturnVar =  "";
			var AddOtherVars = "";
			break
		case 4:	//	Newsvine
	
			var AddSite = "http://www.newsvine.com/_tools/user/login?redirect";
			var AddUrlVar = "url";
			var AddTitleVar = "t";
			var AddNoteVar = "";
			var AddReturnVar = "";
			var AddOtherVars = "";	
			break
		case 5:	//	Technorati
			var AddSite = "http://technorati.com/signup/?f=favorites";
			var AddUrlVar = "url";
			var AddTitleVar = "title";
			var AddNoteVar = "";
			var AddReturnVar = "";
			var AddOtherVars = "";	
			break
		case 6:	//	YahooBookmark
			var AddSite = "http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&";
			var AddUrlVar = "u";
			var AddTitleVar = "t";
			var AddNoteVar = "";
			var AddReturnVar = "";
			var AddOtherVars = "";
			break
		case 7:	//	GoogleBookmark
			var AddSite = "http://www.google.com/bookmarks/mark?op=add&";
			var AddUrlVar = "bkmk";
			var AddTitleVar = "title";
			var AddNoteVar = "";
			var AddReturnVar = "";
			var AddOtherVars = "";
			break
		case 8:	//	Digg
			var AddSite = "http://digg.com/submit?phase=2&";
			var AddUrlVar = "url";
			var AddTitleVar = "title";
			var AddNoteVar = "";
			var AddReturnVar = "";
			var AddOtherVars = "";
			break
		case 9:	//	MyIndiatimes
			var AddSite = "http://my.indiatimes.com/";
			var AddUrlVar = "url";
			var AddTitleVar = "title";
			var AddNoteVar = "";
			var AddReturnVar = "";
			var AddOtherVars = "";
			break
		case 10:	//	Furl
			var AddSite = "http://www.furl.net/storeIt.jsp?u=";
			var AddUrlVar = "url";
			var AddTitleVar = "title";
			var AddNoteVar = "";
			var AddReturnVar = "";
			var AddOtherVars = "";
			break
		
		case 11:	//	YahooMyWeb
			var AddSite = "http://myweb.yahoo.com/myresults/bookmarklet?";
			var AddUrlVar = "u";
			var AddTitleVar = "t";
			var AddNoteVar = "";
			var AddReturnVar = "";
			var AddOtherVars = "";
			break
		
		case 12:	//	Reddit
			var AddSite = "http://reddit.com/submit?url=";
			var AddUrlVar = "url";
			var AddTitleVar = "title";
			var AddNoteVar = "";
			var AddReturnVar = "";
			var AddOtherVars = "";
			break
		
		case 13:	//	Live Bookmarks
			var AddSite = "http://favorites.live.com/quickadd.aspx?url=";
			var AddUrlVar = "url";
			var AddTitleVar = "title";
			var AddNoteVar = "";
			var AddReturnVar = "";
			var AddOtherVars = "";
			break
		case 14:	//	MyAol
			var AddSite = "http://www.spurl.net/spurl.php?";
			var AddUrlVar = "url";
			var AddTitleVar = "title";
			var AddNoteVar = "blocked";
			var AddReturnVar = "";
			var AddOtherVars = "&v=3";
			break
	
    	case 15:	//	BolgMarks
			var AddSite = "http://blogmarks.net/my/new.php?mini=1&simple=1&title=";
			var AddUrlVar = "url";
			var AddTitleVar = "title";
			var AddNoteVar = "";
			var AddReturnVar = "";
			var AddOtherVars = "";
			break
		
		case 16:	//	Viggo
			var AddSite = "http://www.spurl.net/spurl.php?";
			var AddUrlVar = "url";
			var AddTitleVar = "title";
			var AddNoteVar = "blocked";
			var AddReturnVar = "";
			var AddOtherVars = "&v=3";
			break
			
		case 17:	//	FreeRang
			var AddSite = "http://www.spurl.net/spurl.php?";
			var AddUrlVar = "url";
			var AddTitleVar = "title";
			var AddNoteVar = "blocked";
			var AddReturnVar = "";
			var AddOtherVars = "&v=3";
			break			
		case 18:	 //	hotklix
			var AddSite = "http://hotklix.com/?ref=share_this&";
			var AddUrlVar = "addurl";
			var AddTitleVar =  "title";
			var AddNoteVar =  "";
			var AddReturnVar =  "";
			var AddOtherVars = "";			
			break		
		case 19:	 //	LinkedIn
			var AddSite = "http://www.linkedin.com/shareArticle?mini=true&ro=false&trk=bookmarklet&";
			var AddUrlVar = "url";
			var AddTitleVar =  "title";
			var AddNoteVar =  "";
			var AddReturnVar =  "";
			var AddOtherVars = "";			
			var metaDescription;
			var metas = document.getElementsByTagName('meta');
			for (var x=0,y=metas.length; x<y; x++) {
			  if (metas[x].name.toLowerCase() == "description") {
				metaDescription = metas[x];
				metaDescription = metaDescription.content;
				if(metaDescription!='') {
					metaDescription = encodeURIComponent(metaDescription);
					AddOtherVars = "&summary="+metaDescription;
				}
			  }
			}
			if(AddOtherVars=='') { AddOtherVars = "&summary="+AddTitle; }
			break
		case 20:	 //	MySpace
			var AddSite = "http://www.myspace.com/Modules/PostTo/Pages/?";
			var AddUrlVar = "u";
			var AddTitleVar =  "t";
			var AddNoteVar =  "";
			var AddReturnVar =  "";
			var AddOtherVars = "";			
			break	
		case 21:	 //	Twitter
			var AddSite = "http://twitter.com/home?";
			var AddUrlVar = "status";
			var AddTitleVar =  "";
			var AddNoteVar =  "";
			var AddReturnVar =  "";
			var AddOtherVars = "";			
			AddURL = encodeURIComponent(document.comment.short_url_hidden.value);
			break
		//	To add more bookmarking sites, find the posting URL, identify the variable names, and create another case statement
		default:
	}
	//Added by balraj on 05-10-2010 for mantis issue #371
	var sPath = window.location.pathname;
	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
	if(AddURL.search('news.php')!=-1 || sPage=='' || sPage=='latest-news' || AddURL.search('news-')!=-1)
	{
	  	AddURL = document.getElementById('short_url_hidden').value;
		AddTitle = encodeURIComponent(document.getElementById('newstitle').value);
		Adddesc = encodeURIComponent(document.getElementById('newsdesc').value);
		if(19==addsite) { AddOtherVars = "&summary="+Adddesc; }
	}
	
//	Build the URL
	if(21==addsite) {
		var len = decodeURIComponent(AddURL).length;
		NEWTITLE = '';
		if(len<140)
		{
		  var strlen = parseInt(139 - len);
		  var NEWTITLE = '';
		  var OLDTITLE = decodeURIComponent(AddTitle);
		  for(var i=0;i<strlen;i++)
		  {
			   if(OLDTITLE[i])
			   {
			   		NEWTITLE = NEWTITLE + OLDTITLE[i];
			   }
		  }
		  NEWTITLE = encodeURIComponent(NEWTITLE);
		}
		var addtoFullURL = AddSite + AddUrlVar + "=" + NEWTITLE + ' ' + AddURL;
	} else {
		var addtoFullURL = AddSite + AddUrlVar + "=" + AddURL + "&" + AddTitleVar + "=" + AddTitle + AddOtherVars ;
	}
	if (AddNoteVar != "") 
		{
		var addtoFullURL = addtoFullURL + "&" + AddNoteVar + "=" + AddTitle;
	
		}
	if (AddReturnVar != "")
		{
			
		var addtoFullURL = addtoFullURL + "&" + AddReturnVar + "=" + AddURL;}
//	Checking AddToMethod, to see if it opens in new window or not
	 switch(addtoMethod){
		case 0:	// 0=direct link			
			self.location = addtoFullURL;			
			break;
		case 1:	// 1=popup
		   	addtoWin(addtoFullURL);			
			break;
		default: 
		}
		//return true;
}
 function popup1(url,w,h)
					{
			 var width  = w;
			 var height = h;
			 var left   = (screen.width  - width)/2;
			 var top    = (screen.height - height)/2;
			 var params = 'width='+width+', height='+height;
			 params += ', top='+top+', left='+left;
			 params += ', directories=no';
			 params += ', location=no';
			 params += ', menubar=no';
			 params += ', resizable=no';
			 params += ', scrollbars=no';
			 params += ', status=no';
			 params += ', toolbar=no';
			 newwin=window.open(url,'windowname5', params);
			 if (window.focus) {newwin.focus()}
			 return false;
			}
var AddURL = encodeURIComponent(window.location.href);
var AddTitle = encodeURIComponent(document.title);
function move() {
  winref = window.open('http://hotklix.com/?ref=share_this&addurl='+location.href) ;
  winref.focus();
}

// http://herd.idhasoft.us/Js/validation.js
var chars="abcdefghijklmnopqrstuvwxyz0123456789";function createCookie(name,value,days)
{if(days)
{var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else var expires="";document.cookie=name+"="+value+expires+"; path=/";}
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 null;}
function eraseCookie(name)
{createCookie(name,"",-1);}
function registration_disable_option(field_name)
{field_name.disabled=true;}
function registration_enable_option(field_name)
{field_name.disabled=false;}
function check_blank_fields(field_name,s)
{if(field_name.value=="")
{var error="Cannot leave the "+s+" field blank";alert(error);return false;}
return true;}
function frmgetname(name,val,frm)
{if(val.checked)
{frm.author.value=name;frm.author.disabled=true;}
else
{frm.author.value="";frm.author.disabled=false;}}
function getRndStr(field_name)
{anum=new Array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');nums=new Array('0','1','2','3','4','5','6','7','8','9');var endpass="";for(i=0;i<2;i++)
{nextChar=Math.floor(Math.random()*52);nextDig=Math.floor(Math.random()*10);}
for(j=0;j<2;j++)
{nextDig=Math.floor(Math.random()*10);endpass=nums[nextDig]+endpass;}
for(j=0;j<6;j++)
{nextChar=Math.floor(Math.random()*52);endpass=anum[nextChar]+endpass;}
field_name.value=endpass;}
function reset_field(field_name)
{field_name.value='';}
function enable_disable_field(field_name)
{if(field_name.disabled==true)
{field_name.disabled=false;}
else
{field_name.disabled=true;}}
function enable_disable_field_onload(flag,field_name)
{if(flag==false)
{field_name.disabled=false;}
else
{field_name.disabled=true;}}
function check_max_count(field_name,max_limit)
{if(count_characters(field_name)>max_limit)
{alert('you can not Enter more than '+max_limit+' Characters');return false;}}
function count_characters(field_name)
{return(field_name.value.length);}
function display_total_characters(field_name)
{total=count_characters(field_name);return total;}
function show_text(divId,val,e)
{var myDiv=document.getElementById(divId);if(val<=-1&&(e.keyCode!=8&&e.keyCode!=46&&e.keyCode!=37&&e.keyCode!=38&&e.keyCode!=39&&e.keyCode!=40&&e.keyCode!=16))
{alert("You have exceeded the limit.");return false;}
else
{myDiv.innerHTML=val;}}
function showMyDiv(mydiv)
{var img_name=document.ad_upload.ad_image.value;mydiv.style.visibility="visible";var pre_img=document.getElementById('preview_img');pre_img.src=img_name;}
function show_list(mydiv)
{var mydiv=document.getElementById('mydiv');mydiv.style.visibility="visible";}
function confirm_delete(field_name,type)
{var field_name;if(field_name.checked==true)
var status=(confirm("Are you sure you want to delete this "+type+"? \nClick Submit to Delete it."));if(!status)
field_name.checked=false;}
function confirm_ie()
{if(navigator.appName!="Microsoft Internet Explorer")
{alert("Compatible with Microsoft Internet Explorer Only");}}
function compareDate(date,date1)
{if(Date.parse(date.value)>Date.parse(date1))
{alert("Hire date cannot be greater than today's date");return false;}
return true;}
function disable_option()
{
	document.form1.paper_upload_type[1].disabled = true;
	document.form1.paper_upload_type[0].disabled = false;
	document.form1.paper_upload_type[0].checked = true;

	//Added by Pankaj, for mantis issue 000054. Dt: 15/09/2010. Start
	document.form1.paper_upload_type[2].disabled = true;
	document.form1.paper_upload_type[3].disabled = true;
	document.form1.paper_upload_type[4].disabled = true;
	document.form1.paper_upload_type[5].disabled = true;
	document.form1.paper_upload_type[6].disabled = true;
	document.form1.paper_upload_type[7].disabled = true;
	//Added by Pankaj, for mantis issue 000054. Dt: 15/09/2010. End
}
function enable_option()
{document.form1.paper_upload_type[0].disabled=false;document.form1.paper_upload_type[1].disabled=false;}
function paper_enable_option()
{
	document.form1.paper_upload_type[0].disabled = false;
	document.form1.paper_upload_type[1].disabled = false;
	document.form1.paper_upload_type[1].checked = true;

	//Added by Pankaj, for mantis issue 000054. Dt: 15/09/2010. Start
	document.form1.paper_upload_type[2].disabled = false;
	document.form1.paper_upload_type[3].disabled = false;
	document.form1.paper_upload_type[4].disabled = false;
	document.form1.paper_upload_type[5].disabled = false;
	document.form1.paper_upload_type[6].disabled = false;
	document.form1.paper_upload_type[7].disabled = false;
	//Added by Pankaj, for mantis issue 000054. Dt: 15/09/2010. End
}
function pdf_enable_option()
{
	document.form1.paper_upload_type[1].disabled = false;
	document.form1.paper_upload_type[1].checked = true;
	document.form1.paper_upload_type[0].disabled = true;

	//Added by Pankaj, for mantis issue 000054. Dt: 15/09/2010. Start
	document.form1.paper_upload_type[2].disabled = true;
	document.form1.paper_upload_type[3].disabled = true;
	document.form1.paper_upload_type[4].disabled = true;
	document.form1.paper_upload_type[5].disabled = true;
	document.form1.paper_upload_type[6].disabled = true;
	document.form1.paper_upload_type[7].disabled = true;
	//Added by Pankaj, for mantis issue 000054. Dt: 15/09/2010. End
}
function press_release_enable_option()
{
	document.form1.paper_upload_type[0].disabled = false;
	document.form1.paper_upload_type[1].disabled = false;
	document.form1.paper_upload_type[0].checked = true;

	//Added by Pankaj, for mantis issue 000054. Dt: 15/09/2010. Start
	document.form1.paper_upload_type[2].disabled = true;
	document.form1.paper_upload_type[3].disabled = true;
	document.form1.paper_upload_type[4].disabled = true;
	document.form1.paper_upload_type[5].disabled = true;
	document.form1.paper_upload_type[6].disabled = true;
	document.form1.paper_upload_type[7].disabled = true;
	//Added by Pankaj, for mantis issue 000054. Dt: 15/09/2010. End
}
function del_community()
{if(confirm('Are you sure you want to delete this community?'))
return true;else
return false;}
function confirm_sponsor()
{if(confirm('Are you sure you want to proceede to sponsor this page? You will get logged out of your current account.'))
return true;else
return false;}
function doedit(id,action)
{if(action=='show')
{document.getElementById(id).style.visibility="visible";document.getElementById(id).style.position="static";}
if(action=='hide')
{document.getElementById(id).style.visibility="hidden";document.getElementById(id).style.position="absolute";}}
function IsNumeric(strString)
{var strValidChars="0123456789.";var strChar;var blnResult=true;if(strString.length==0)return false;for(i=0;i<strString.length&&blnResult==true;i++)
{strChar=strString.charAt(i);if(strValidChars.indexOf(strChar)==-1)
{blnResult=false;}}
return blnResult;}
function frmsubmit(id1,id2,tempvar,action)
{var commentid="edit_comments"+id1;var ratingid="editrating"+id2+""+tempvar;var rating="";if(id1!=0)
{var comment=document.comment.elements[commentid].value;}
if(id2!=0)
{var rating=document.comment.elements[ratingid].value;}
if(action=="update"&&comment=="")
{alert("comment cannot be blank ");document.comment.elements[commentid].focus();}
else if(action=="update"&&(rating==""||rating>5||rating<0||(!IsNumeric(rating)))&&id2!=0)
{if(rating=="")
{alert("Rating cannot be blank ");}
else if(rating<0||rating>5)
{alert("Rating Must be between 0 to 5");}
else if(!IsNumeric(rating))
{alert("Please Enter Number for Rating");}
document.comment.elements[ratingid].focus();}
else
{document.comment.elements['hidaction'].value=action;document.comment.elements['hratingid'].value=id2;document.comment.elements['hid'].value=id1;document.comment.elements['tempvar'].value=tempvar;document.comment.submit();}}
function div_visible(id,text,textb,comm_id,type_flag)
{var e=document.getElementById(id);var text=document.getElementById(text);var textb=document.getElementById(textb);textb.value=text.value;document.getElementById('comment_id').value=comm_id;document.getElementById('type_flag').value=type_flag;e.style.visibility='';}
function div_invisible(id)
{var e=document.getElementById(id);e.style.visibility='hidden';}
function is_number_temp(field_name,s)
{if(field_name.value=="")
{var error="Cannot leave the "+s+" field blank";alert(error);return false;}
if(isNaN(field_name.value))
{var error=s+" field Should Be Numberic";alert(error);return false;}
return true;}
function div_invisible_tooltip(id,id1)
{var e=document.getElementById(id);e.style.visibility='hidden';}
function div_visible_tooltip(id,id1,m)
{var e=document.getElementById(id);var f=document.getElementById(id1);if(m.pageX!=null)
{e.style.left=m.pageX+5+"px";e.style.top=m.pageY+5+"px";}
else
{var xcoord=m.clientX;var ycoord=m.clientY;if(document.body&&(document.body.scrollLeft||document.body.scrollTop))
{xcoord+=document.body.scrollLeft;ycoord+=document.body.scrollTop;}
else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop))
{xcoord+=document.documentElement.scrollLeft;ycoord+=document.documentElement.scrollTop;}
e.style.left=xcoord+5+"px";e.style.top=ycoord+5+"px";}
e.innerHTML=f.value;e.style.visibility='';e.style.zIndex=999;}
function func(frmElem,domain)
{var frm=document.formname;if(frmElem.value=="scat")
{if(domain=="WS1")
{var domainid=frm.domain
[frm.domain.selectedIndex].value;var domaintext=frm.domain
[frm.domain.selectedIndex].text;}
else
{domainid="";domaintext="";}
var catid=frm.category
[frm.category.selectedIndex].value;var cattext=frm.category
[frm.category.selectedIndex].text;var win=window.open("/Paper/My_papers/get_subcategory.php?did="+domainid+"&dtxt="+domaintext+"&catid="+catid+"&cattxt="+cattext,"win1","left=20,top=20,width=350,height=200");win.focus();}}
function funcnew(frmElem,domain)
{var frm=document.formname;if(frmElem=="scat")
{if(domain=="WS1")
{var domainid=frm.select_domain
[frm.select_domain.selectedIndex].value;var domaintext=frm.select_domain
[frm.select_domain.selectedIndex].text;}
else
{domainid="";domaintext="";}
var catid=frm.select_category
[frm.select_category.selectedIndex].value;var cattext=frm.select_category
[frm.select_category.selectedIndex].text;var win=window.open("/Paper/My_papers/get_subcategory.php?did="+domainid+"&dtxt="+domaintext+"&catid="+catid+"&cattxt="+cattext,"win1","left=20,top=20,width=350,height=200");win.focus();}}
function ajax_call()
{xmlHttp=GetXmlHttpObject();if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{document.getElementById('result').innerHTML=xmlhttp.responseText;window.location.reload();}}
xmlhttp.open("GET","edit_comment.php?comment_id="+document.getElementById('comment_id').value+"&comment_text="+document.getElementById('textb').value+"&type_flag="+document.getElementById('type_flag').value,true);xmlHttp.send(null);}
function disable_submit()
{document.formname.get_reg.disabled=true;}
function hideall(count)
{var i;for(i=0;i<count;i++)
{var divId='layer'+i;var div1Id='layer_hot'+i;var menu=document.getElementById(divId);var menu1=document.getElementById(div1Id);if(menu.style.visibility=='visible')
menu.style.visibility='hidden';if(menu1.style.visibility=='visible')
menu1.style.visibility='hidden';}}
function startTime(){if(timerOn==false){timerID=setTimeout('hideall(5)',timecount);timerOn=true;}}
function stopTime(){alert(hi);if(timerOn){clearTimeout(timerID);timerID=null;timerOn=false;}}
function validateReportPrice(price,errorDiv)
{xmlHttp=GetXmlHttpObject();if(xmlHttp==null)
{alert("Browser does not support HTTP Request");return;}
xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{document.getElementById(errorDiv).innerHTML=xmlHttp.responseText;}
else
{if(price!="")
{document.getElementById(errorDiv).innerHTML="<img src='/Images/ajax-loader1.gif' height='20' width='20'/>";}}}
xmlHttp.open("GET","validate_price.php?price="+price,true);xmlHttp.send(null);}<!--
function check_length(obj,limit,divID)
{var myDiv=document.getElementById(divID);maxLen=limit;if(obj.value.length>maxLen){var msg="You have reached your maximum limit of characters allowed";alert(msg);obj.value=obj.value.substring(0,maxLen);myDiv.innerHTML=maxLen-obj.value.length;}
else{myDiv.innerHTML=maxLen-obj.value.length;}}

//changed by rajesh, for issue 54, Dt. 12/10/2010 - start
function removeComment ()
{
	if(document.getElementById('background'))
	{
		var a=document.getElementById('background');
		document.body.removeChild(a);
	}

	if(document.getElementById('commentBox'))
	{
		var b=document.getElementById('commentBox');
		document.body.removeChild(b);
	}
	hideDialog();
}
function getComments(loginId,paperId,paperType,paperLink)
{
	var pageNum = currPageNum;
	var pageLink = paperJpegsPathHttp;
	var mylib = document.getElementById('myLibrary').innerHTML;
	var myPage = document.getElementById('myPageAsSlide').innerHTML;
	if (parent.document.getElementById('commentBox'))
	{
		var a = parent.document.getElementById('commentBox');
		parent.document.body.removeChild(a);
	}

	if (parent.document.getElementById('background'))
	{
		var a = parent.document.getElementById('background');
		parent.document.body.removeChild(a);
	}

	var commentBoxData = '<table width="100%"><tr><td align="left"><table width="100%"><tr><td colspan="2" align="left">'+mylib+'</td></tr><tr><td colspan="2" align="left"><a href="#" onclick=\'javascript:savePaperPage("'+loginId+'","'+paperId+'","'+paperType+'","'+pageNum+'","'+paperLink+'","'+pageLink+'");\'><b>Save this page</b></a></td></tr><tr><td colspan="2" align="left">'+myPage+'</td></tr><tr><td colspan="2"> </td></tr></table></td><td valign="top" align="right"><img src="/Images/cancel.gif" onClick="removeComment()"></td></tr></table>';
	var height = "100px";

	//<img src="/Images/new.gif" border="0" alt="" />
	/*Added by Rajesh Reddy on 25-6-2010*/

	//alert(parent.document.documentElement.scrollHeight);
	/*if (type == 'usrEditFlag')
	{*/
		var bgheight = parent.document.documentElement.scrollHeight;
	/*}else
	{
		var bgheight = parent.window.screen.height;
	}*/
	/*end*/

	var background = parent.document.createElement('iframe');
	var divIdName = 'background';
	background.setAttribute('id',divIdName);
	background.style.width = parent.window.screen.width+"px";
	background.style.height = bgheight +"px";
	background.style.left = "0px";
	background.style.top = "0px";
	background.style.background = "black";
	background.style.opacity=".25";
	background.style.filter="alpha(opacity=25)";
	background.style.position ="absolute";
	background.style.zIndex ="10";
	background.style.visibility = "visible";
	parent.document.body.appendChild(background);

	var commentBox = parent.document.createElement('div');
	var divIdName = 'commentBox';
	commentBox.setAttribute('id',divIdName);
	commentBox.className="popWindow";
	//commentBox.style.left = (parent.document.body.clientWidth/2.5) + "px";
	//commentBox.style.top =  (parent.document.body.clientHeight/2) + "px";
	commentBox.style.left = "370px";
	commentBox.style.top =  "262px";
	commentBox.style.position ="absolute";
	commentBox.style.width = "200px";
	commentBox.style.height = height;
	//commentBox.style.padding = "25px 25px 25px 25px";
	commentBox.style.padding = "5px 5px 5px 5px";
	commentBox.innerHTML = commentBoxData;
	commentBox.style.zIndex ="200";
	commentBox.style.visibility = "visible";
	parent.document.body.appendChild(commentBox);

	//document.userOptions.done.focus();
}
//changed by rajesh, for issue 54, Dt. 12/10/2010 - end
/*Added by Rajesh Reddy for issue 401*/
function checkdelslide(field_name)
{
    var field_name;
    if(field_name.checked==false)
    {
            alert("Please select the checkbox to delete the Slide");
            return false;
    }else
    {
           return true;
    }
}
/*end*/

// facebook.js

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function showLoginPopup(msg)
{


		var bodyWidth = document.body.scrollWidth;
		var bodyHeight = document.body.scrollHeight;

		if(document.body.clientHeight > bodyHeight)
		{
			bodyHeight=document.body.clientHeight;
		}

		if(document.body.clientWidth > bodyWidth)
		{
			bodyWidth=document.body.clientWidth;
		}

		var dialog = document.getElementById("saveDialog1");
		var fullpage = document.getElementById("fullpage1");

		dialog.style.visibility=""
		fullpage.style.visibility=""
                $("#saveDialog1").hide();
                $("#fullpage1").hide();
                $("#saveDialog1").fadeIn('slow');
                $("#fullpage1").fadeIn('slow');
		fullpage.style.width=bodyWidth-10+"px"
		fullpage.style.height=bodyHeight+100+"px"
		fullpage.style.zIndex="10100"
		dialog.style.zIndex="10200"


  $("#saveDialog1").html('<div style="width:80%;margin:0pt auto;"><span id="msg" style="height: 20px; font-family: tahoma; font-weight: bold;">'+msg+'</span><br/><br/><br/><center><input type="button" value="Close" onclick="closeDialog()" /></center></div>');

}
function closeDialog(){

    $("#saveDialog1").fadeOut('slow');
    $("#fullpage1").fadeOut('slow');
    var dialog = document.getElementById("saveDialog1");
    var fullpage = document.getElementById("fullpage1");

     dialog.style.visibility="hidden";
    fullpage.style.visibility="hidden";
        $("#saveDialog1").hide();
        $("#fullpage1").hide();
        $("#saveDialog1").fadeIn('slow');
        $("#fullpage1").fadeIn('slow');
}

//http://herd.idhasoft.us/Js/navMenu.js
var arrowimages={down:['/Images/downarrowclass','/Images/greyArrowDown.gif',00],right:['rightarrowclass','/Images/arrow-right.gif']}
var jquerycssmenu={fadesettings:{overduration:350,outduration:100},buildmenu:function(menuid,arrowsvar){jQuery(document).ready(function($){var $mainmenu=$("#"+menuid+">ul")
var $headers=$mainmenu.find("ul").parent()
$headers.each(function(i){var $curobj=$(this)
var $subul=$(this).find('ul:eq(0)')
this._dimensions={w:this.offsetWidth,h:this.offsetHeight,subulw:$subul.outerWidth(),subulh:$subul.outerHeight()}
this.istopheader=$curobj.parents("ul").length==1?true:false
$subul.css({top:this.istopheader?this._dimensions.h+"px":-1})
$curobj.children("a:eq(0)").css(this.istopheader?{paddingRight:arrowsvar.down[2]}:{}).append('<img src="'+(this.istopheader?arrowsvar.down[1]:arrowsvar.right[1])
+'" class="'+(this.istopheader?arrowsvar.down[0]:arrowsvar.right[0])
+'" style="border:0;" />')
$curobj.hover(function(e){var $targetul=$(this).children("ul:eq(0)")
this._offsets={left:$(this).offset().left,top:$(this).offset().top}
var menuleft=this.istopheader?0:this._dimensions.w
menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())?(this.istopheader?-this._dimensions.subulw+this._dimensions.w:-this._dimensions.w):menuleft
$targetul.css({left:menuleft+"px"}).fadeIn(jquerycssmenu.fadesettings.overduration)},function(e){$(this).children("ul:eq(0)").fadeOut(jquerycssmenu.fadesettings.outduration)})})
$mainmenu.find("ul").css({display:'none',visibility:'visible'})})}}
jquerycssmenu.buildmenu("myjquerymenu",arrowimages)
jquerycssmenu.buildmenu("myjquerymenuNew",arrowimages)

//http://herd.idhasoft.us/Js/instant_popup.js

function instant_popup()
{if(readCookie('sessionhidepopup')==null)
{var varcontent=document.getElementById('CurPopupContainer');xmlHttpInsPop=GetXmlHttpObject();if(xmlHttpInsPop==null)
{alert("Browser does not support HTTP Request")
return}
xmlHttpInsPop.onreadystatechange=function()
{if(xmlHttpInsPop.readyState==4||xmlHttpInsPop.readyState=="complete")
{var retText=xmlHttpInsPop.responseText;if(retText!='N'&&retText!='')
{if(varcontent)
{varcontent.innerHTML=retText;hideUserOriPopUp();hideUserPopUp();showUserPopUp();}}}}
xmlHttpInsPop.open("GET","/Network/get_instant_message.php?sid="+Math.random(),true);xmlHttpInsPop.send(null);}}
function hideUserPopUp()
{var curuserpopup=document.getElementById('curuserpopup');if(curuserpopup!=null)
{curuserpopup.style.display="none";}}
function hideUserOriPopUp()
{var userpopup=document.getElementById('userpopup');if(userpopup!=null)
{userpopup.style.display="none";}}
function showUserPopUp()
{var curuserpopup=document.getElementById('curuserpopup');if(curuserpopup!=null)
{curuserpopup.style.display="block";}}
function positionit(){var curpopobj=document.all?document.all.curuserpopup:document.getElementById('curuserpopup');var logpopobj=document.all?document.all.userpopup:document.getElementById('userpopup');var swidth=screen.width;var sheight=screen.height;var iebody=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;var dsocleft=document.all?iebody.scrollLeft:pageXOffset;var dsoctop=document.all?iebody.scrollTop:pageYOffset;if(curpopobj)
{if(swidth==800)
{if(document.all||document.getElementById){curpopobj.style.left=parseInt(dsocleft)+200+"px";curpopobj.style.top=dsoctop+125+"px";}}else if(swidth==1280&&sheight==1024)
{if(document.all||document.getElementById){curpopobj.style.left=parseInt(dsocleft)+400+"px";curpopobj.style.top=dsoctop+300+"px";}}else
{if(document.all||document.getElementById){curpopobj.style.left=parseInt(dsocleft)+308+"px";curpopobj.style.top=dsoctop+215+"px";}}}
if(logpopobj)
{if(swidth==800)
{if(document.all||document.getElementById){logpopobj.style.left=parseInt(dsocleft)+200+"px";logpopobj.style.top=dsoctop+100+"px";}}else if(swidth==1280&&sheight==1024)
{if(document.all||document.getElementById){logpopobj.style.left=parseInt(dsocleft)+450+"px";logpopobj.style.top=dsoctop+225+"px";}}else
{if(document.all||document.getElementById){logpopobj.style.left=parseInt(dsocleft)+308+"px";logpopobj.style.top=dsoctop+150+"px";}}}}
function hideUserPopUpSession()
{var content=document.getElementById('CurPopupContainer');xmlHttpHups=GetXmlHttpObject();if(xmlHttpHups==null)
{alert("Browser does not support HTTP Request")
return}
xmlHttpHups.onreadystatechange=function()
{if(xmlHttpHups.readyState==4||xmlHttpHups.readyState=="complete")
{var retText=xmlHttpHups.responseText;if(retText=="Logout")
{alert('You have been logout from this session. Please login again.');eraseCookie('sessionhidepopup');hideUserOriPopUp();hideUserPopUp();window.location.reload();}else{hideUserOriPopUp();hideUserPopUp();createCookie('sessionhidepopup','Y','1');}}}
xmlHttpHups.open("GET","/Network/set_instant_message.php?sid="+Math.random(),true);xmlHttpHups.send(null);}
function createCookie(name,value,days)
{if(days)
{var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else var expires="";document.cookie=name+"="+value+expires+"; path=/";}
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 null;}
function eraseCookie(name){createCookie(name,"",-1);}
//Start : Saurabh has been added for issue share[+]
function ShowEditBox(e,actionPage,checkDetailSignup,editBox,editField,displayfieldvalue,id){

    editBoxOld = editBox;
	editBox = editBox.split('_');
	editBox = editBox[0];
	if(checkDetailSignup=="")
	{
		location.href= "/User/registration_page.php?error_type=1&amp;show_page=2";
	}
	else
	{
		displayfieldblock=document.getElementById(displayfieldvalue);
		//displayfieldblock.innerHTML = displayfieldblock.innerHTML.replace(/\\&amp;/g, '&');
		document.getElementById(editField).value=displayfieldblock.innerHTML;
		document.getElementById(editField).value = document.getElementById(editField).value.replace(/\\&amp;/g, '&');
		document.getElementById(editField).value = document.getElementById(editField).value.replace(/\\&lt;/g, '<');
		document.getElementById(editField).value = document.getElementById(editField).value.replace(/\\&gt;/g, '>');
		//alert(summarytextblock.innerHTML);
		//alert(document.getElementById(editField).value + '--1');
		//alert(displayfieldblock.innerHTML+ '--1.5');

		var bodyWidth = document.body.scrollWidth;
		var bodyHeight = document.body.scrollHeight;

		if(document.body.clientHeight > bodyHeight)
		{
			bodyHeight=document.body.clientHeight;
		}

		if(document.body.clientWidth > bodyWidth)
		{
			bodyWidth=document.body.clientWidth;
		}

		var dialog = document.getElementById(editBoxOld);
		var responcedialog = document.getElementById("ResponceBox");
		var fullpage = document.getElementById("fullpage");
		var loading = document.getElementById("loading");
		//if (editBox != 'showbookmark') {
			var editauthorlink = document.getElementById("editAuthorLink");
			var edittitlelink = document.getElementById("editTitleLink");
			var editsummarytextlink = document.getElementById("editSummaryTextLink");
			var addbookmarklink = document.getElementById("addBookMarkLink_"+id);

			/*if (editauthorlink) {
				editauthorlink.style.visibility="hidden";
			}
			if (editsummarytextlink) {
				editsummarytextlink.style.visibility="hidden";
			}
			if (edittitlelink) {
				edittitlelink.style.visibility="hidden";
			}*/
			if (addbookmarklink) {
				addbookmarklink.style.visibility="hidden";
			}

		//}
		dialog.style.visibility=""
		/*if (editBox=='EditSummaryTextBox') {
			fullpage.style.visibility="";
			if (loading){
				loading.style.visibility="hidden";
			}
		}

		fullpage.style.width=bodyWidth+"px"
		fullpage.style.height=bodyHeight+"px"*/

		/*fullpage.style.zIndex="100"
		dialog.style.zIndex="200"
		responcedialog.style.zIndex="200"*/

		if(e.pageX!=null)
		{
			//alert('Test1');
			if(e.pageX > 1000)
			{
				//alert('Test1>1000');

				if(editBox== 'EditSummaryTextBox' || editBox== 'showbookmark')
				{
					dialog.style.left=e.pageX - 340 + "px";
					dialog.style.top=e.pageY + 10 + "px";
				}else
				{
					dialog.style.left=e.pageX - 340 + "px";
					dialog.style.top=e.pageY + 20 + "px";
				}
				responcedialog.style.left=e.pageX - 340 + "px";
				responcedialog.style.top=e.pageY + 10 + "px";
			}
			else
			{
				//alert('Test1<1000 '+ editBox + ' X ' + e.pageX + ' Y ' + e.pageY);

				if(editBox== 'EditSummaryTextBox')
				{
					dialog.style.left=350 + "px";
					dialog.style.top=300 + "px";
				}else if(editBox== 'showbookmark')
				{
					dialog.style.left=e.pageX - 40 + "px";
					dialog.style.top=e.pageY  - 30 + "px";
				}else
				{
					dialog.style.left=e.pageX + 10 + "px";
					dialog.style.top=e.pageY - 55 + "px";
				}

				responcedialog.style.left=e.pageX + 10 + "px";
				responcedialog.style.top=e.pageY - 50 + "px";
			}

			if(editBox!= 'EditSummaryTextBox')
			{
				dialog.style.height="90px";
				responcedialog.style.height="90px";
			}
			if(editBox == 'showbookmark')
			{
				dialog.style.height="";
				//setfocus(document.getElementById(editBox));
				setfocus(document.getElementById(editBoxOld));
			}


		}
		else
		{

			//alert('Test2');
			var xcoord = e.clientX;
			var ycoord = e.clientY;

			if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) )
			{
				xcoord += document.body.scrollLeft;
				ycoord += document.body.scrollTop;
			}
			else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) )
			{
				xcoord += document.documentElement.scrollLeft;
				ycoord += document.documentElement.scrollTop;
			}

			if(xcoord > 1000)
			{
				//alert('Test2> 1000');
				if(editBox== 'EditSummaryTextBox' )
				{
					dialog.style.left= xcoord - 305  + "px";
					dialog.style.top= ycoord + 10 + "px";
				}else if(editBox== 'showbookmark')
				{
					dialog.style.left= xcoord - 305  + "px";
					dialog.style.top= ycoord + 10 + "px";
				}else
				{
					dialog.style.left= xcoord - 305  + "px";
					dialog.style.top= ycoord + 10 + "px";

				}

				responcedialog.style.left= xcoord - 305  + "px";
				responcedialog.style.top= ycoord + 10 + "px";
			}
			else
			{
				//alert('Test2< 1000 '+ editBox + 'x ' + xcoord + 'y ' + ycoord);

				if(editBox== 'EditSummaryTextBox')
				{
					dialog.style.left=  350 + "px";
					dialog.style.top=  300 + "px";
				}else if(editBox== 'showbookmark')
				{
					dialog.style.left= xcoord - 15 + "px";
					dialog.style.top=  ycoord - 25 + "px";
				}else
				{
					dialog.style.left= xcoord - 10 + "px";
					dialog.style.top= ycoord  - 55 + "px";

				}

				responcedialog.style.left= xcoord - 10 + "px";
				responcedialog.style.top= ycoord - 30 + "px";

			}
			if(editBox == 'showbookmark')
			{
				dialog.style.height="";
				//setfocus(document.getElementById(editBox));
				setfocus(document.getElementById(editBoxOld));

			}

		}
	}
}
function SendEditRequest(loginId,paperId,paperType,field,editBox,editfield,displayfieldvalue)
	{
		updatevalue=document.getElementById(editfield);
		//alert(editTitle);
		if(field== 'paper_summary')
		{
			var myTextField = document.getElementById(editfield);
			var max_limit= 500;

			if(myTextField.value.length > max_limit)
			{
				alert('You have exceeded the character limit on Summary; only '+ max_limit +' characters allowed.');
				return;
			}
		}

		if(updatevalue=='')
		{
				alert('Updated Field can not be blank');
				return;
		}

		xmlHttp=GetXmlHttpObject();

		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}

		xmlHttp.onreadystatechange=function ()
		{

			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{
				document.getElementById(editBox).style.visibility='hidden';

				response=xmlHttp.responseText;
				//msg=response;
				//alert(response); return;
				//alert(updatevalue.value+'-- 2');

				if(response== 'success')
				{
					msg='<br /><b>Successfully updated</b><br /><br /><input onclick="hideEditBox(\'ResponceBox\')" type="button" value="continue" />';
					document.getElementById(displayfieldvalue).innerHTML = stripHtml(updatevalue.value);
					//alert(updatevalue.value+'--2.5');
					//alert(document.getElementById(displayfieldvalue).innerHTML+'-- 3');
					if(field== 'title')
					{
						document.title=stripHtml('weSRCH.com - '+updatevalue.value);
					}

				}
					else if(response=='error')
				{
						msg='<br /><b>Not able to update. Please retry.</b><br /><input onclick="hideEditBox(\'ResponceBox\')" type="button" value="continue" />';
				}
				document.getElementById("ResponceBox").innerHTML=msg;
				document.getElementById("ResponceBox").style.visibility='';


				//document.getElementById('EditBox').innerHTML =;
				//document.getElementById('').innerHTML =xmlHttp.responseText;
			}
		}
		var params  = "login_id="+loginId+"&paper_id="+paperId+"&field="+field+"&updatevalue="+encodeURIComponent(updatevalue.value)+"&paper_type="+paperType+"&sid="+Math.random();
		//*
		//alert (params);

		xmlHttp.open("POST","/Paper/edit_paper_title.php",true);
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; text/xml; charset=UTF-8");
		//xmlHttp.setRequestHeader("Content-type", "text/xml; charset=UTF-8");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");


		xmlHttp.send(params);
		//*/
		/*
		xmlHttp.open('GET',"edit_paper_title.php?login_id="+loginId+"&amp;paper_id="+paperId+"&amp;paper_type="+paperType+"&amp;field="+field+"&amp;updatevalue="+stripHtml(updatevalue.value)+"&amp;sid="+Math.random(),true);
		xmlHttp.send(null);
		//*/
		//xmlHttp.send(null);
	}
function hideEditBox(ActiveBox,id)
{
	//alert(ActiveBox);
	var dialog = document.getElementById(ActiveBox);
	//var fullpage = document.getElementById("fullpage");
	//document.getElementById("fullpage").visibility="hidden"
	//fullpage.style.visibility="hidden"
	dialog.style.visibility="hidden"
	//var editauthorlink = document.getElementById("editAuthorLink");
	//var edittitlelink = document.getElementById("editTitleLink");
	//var editsummarytextlink = document.getElementById("editSummaryTextLink");*/
	var addbookmarklink = document.getElementById("addBookMarkLink_"+id);
	/*if (editauthorlink) {
		editauthorlink.style.visibility="";
	}
	if (editsummarytextlink) {
		editsummarytextlink.style.visibility="";
	}
	if (edittitlelink) {
		edittitlelink.style.visibility="";
	}*/
	if (addbookmarklink) {
		addbookmarklink.style.visibility="";
	}
}
function stripHtml(s)
{
	return s.replace(/\\&/g, '&amp;').replace(/\\</g, '&lt;').replace(/\\>/g, '&gt;').replace(/\\t/g, '&nbsp;&nbsp;&nbsp;');
}
function addNewsDetail(newsid , title , serverpath , newssumm)
{
	document.getElementById('short_url_hidden').value=serverpath+'/news-'+newsid;
	document.getElementById('newsid').value=newsid;
	document.getElementById('newstitle').value=title;
	document.getElementById('newsdesc').value=newssumm;
}
function deleteNewsDetail()
{
	document.getElementById('short_url_hidden').value = '';
	document.getElementById('newsid').value='';
	document.getElementById('newstitle').value='';
	document.getElementById('newsdesc').value='';
}
//End : Saurabh has been added for issue share[+]

