

function bookmark(id){
	var xmlhttp;
	if (window.XMLHttpRequest)
	  {
	  xmlhttp=new XMLHttpRequest();
	  }
	else
	  {
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xmlhttp.onreadystatechange=function()
	{
	if(xmlhttp.readyState==4)
	  {
		if(document.getElementById(id).src.indexOf("_off") > 0)
			document.getElementById(id).src = document.getElementById(id).src.replace("_off","_on");
		else
			document.getElementById(id).src = document.getElementById(id).src.replace("_on","_off");
	  }
	}
	xmlhttp.open("POST","index.aspx?a=Bookmark.Set&nh=1&ns=1&ajax=1&id="+id,true);
	xmlhttp.send(null);
}



// --- AjaxGeneric: 
// <action> POST or GET
// <link> link to server method
function AjaxGeneric(action,link,responseAction) {
	var xmlhttp;
	if (window.XMLHttpRequest)
	  {
	  // code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	  }
	else
	  {
	  // code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
   if(responseAction != "") {
      xmlhttp.onreadystatechange=function()
      {
         if(xmlhttp.readyState==4) {
            //handle response action here, maybe the best would be for responseAction to be a delegate function
         }
      }
   }
	
	xmlhttp.open(action,link,true);
	xmlhttp.send(null);

}




var strParamArray=new Array();var strDivIdArray=new Array();function checkNewComments(){for(var i=0;i<strDivIdArray.length;i++)
{var xmlhttprefresh;if(window.XMLHttpRequest)
{xmlhttprefresh=new XMLHttpRequest();}
else if(window.ActiveXObject)
{xmlhttprefresh=new ActiveXObject("Microsoft.XMLHTTP");}
else
{alert("Your browser does not support XMLHTTP!");}
xmlhttprefresh.open("GET","index.aspx?a=Content.CheckUpdate&noheader=1&params="+strParamArray[i],false);xmlhttprefresh.send(null);if(xmlhttprefresh.readyState==4)
{var tst=document.getElementById("RefreshSection"+strDivIdArray[i]);tst.innerHTML=xmlhttprefresh.responseText;xmlhttprefresh.close;}}}

function countAdClick( userId,  pubId,  currentUrl,  link,  contentId,  siteId,  pageId, type){

	var xmlhttp;
	if (window.XMLHttpRequest)
	  {
	  // code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	  }
	else
	  {
	  // code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xmlhttp.open("POST","index.aspx?a=PubTrace.Save&noheader=1&userId=" +userId+"&pubId=" +pubId+"&url="+currentUrl+"&link="+link + "&contentId="+contentId+"&siteId="+siteId+"&pageId="+pageId+"&type="+type,true);
	xmlhttp.send(null);

}

function SetDateFromCombo(strName){eval("document.getElementById('"+strName+"').value = document.getElementById('"+strName+"Month').value + '/' + document.getElementById('"+strName+"Day').value + '/' + document.getElementById('"+strName+"Year').value ");try{eval("document.getElementById('"+strName+"').value += ' ' + document.getElementById('"+strName+"Time').value");}catch(err){}}
function autoIframe(frameId){try{frame=document.getElementById(frameId);innerDoc=(frame.contentDocument)?frame.contentDocument:frame.contentWindow.document;objToResize=(frame.style)?frame.style:frame;var newHeight=innerDoc.body.scrollHeight+30;objToResize.height=newHeight;frame.height=newHeight;frame.style.display='block';}
catch(err){}}
var iframeids=[]
var iframehide="yes"
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1?16:0
function resizeCaller(){var dyniframe=new Array()
for(i=0;i<iframeids.length;i++){if(document.getElementById)
resizeIframe(iframeids[i])
if((document.all||document.getElementById)&&iframehide=="no"){var tempobj=document.all?document.all[iframeids[i]]:document.getElementById(iframeids[i])
tempobj.style.display="block"}}}
function resizeIframe(frameid){var currentfr=document.getElementById(frameid)
if(currentfr&&!window.opera){currentfr.style.display="block"
if(currentfr.contentDocument&&currentfr.contentDocument.body.offsetHeight)
currentfr.height=currentfr.contentDocument.body.offsetHeight+FFextraHeight;else if(currentfr.Document&&currentfr.Document.body.scrollHeight)
currentfr.height=currentfr.Document.body.scrollHeight+10;if(currentfr.addEventListener)
currentfr.addEventListener("load",readjustIframe,false);else if(currentfr.attachEvent){currentfr.detachEvent("onload",readjustIframe);currentfr.attachEvent("onload",readjustIframe);}}}
function readjustIframe(loadevt){var crossevt=(window.event)?event:loadevt
var iframeroot=(crossevt.currentTarget)?crossevt.currentTarget:crossevt.srcElement
if(iframeroot)
resizeIframe(iframeroot.id);}
function loadintoIframe(iframeid,url){if(document.getElementById)
document.getElementById(iframeid).src=url}
function launchRefreshDaemons(){var refreshRate=undefined;if(strDivIdArray.length>0&&typeof(strDivArray)!=undefined){for(var i=0;i<strDivIdArray.length;i++)
{strParams=strParamArray[i];var tmp=strParams.match(/refresh-rate=\d+/);tmp=Number(tmp[0].match(/\d+/));if(!refreshRate||refreshRate>tmp){refreshRate=tmp;}}
setInterval("checkNewComments()",refreshRate*1000);}}
function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){if(oldonload){oldonload();}
func();}}}
if(window.addEventListener)
window.addEventListener("load",resizeCaller,false)
else if(window.attachEvent)
window.attachEvent("onload",resizeCaller)
else
addLoadEvent(resizeCaller)
addLoadEvent(launchRefreshDaemons);function closeAllTab(tabName)
{for(i=0;i<15;i++){try{closeTab(tabName+i);eval("document.all.divTab"+tabName+i+".style.display = 'none'");}
catch(err){}}}
function closeTab(tabName)
{var boxTabCornerLeftOff="aqc/boxTabCornerLeftOff.gif";var boxTabCornerRightOff="aqc/boxTabCornerRightOff.gif";var boxTabFill="url(aqc/boxTabFillOff.gif)";var boxTabColorOff="#a0a0a0";eval("document.all.boxTabCornerLeft"+tabName+".src=boxTabCornerLeftOff");eval("document.all.boxTabCornerRight"+tabName+".src=boxTabCornerRightOff");eval("document.all.boxTabTd"+tabName+".style.backgroundImage=boxTabFill");eval("document.all.boxTabCaption"+tabName+".style.color=boxTabColorOff");}
function overTab(tabName)
{curColor="";eval("curColor= document.all.boxTabTd"+tabName+".style.backgroundColor");if(curColor=="#7b9ece")
{var sOver="E1E8F3";}
else
{var sOver="000000";}
eval("document.all.boxTabCaption"+tabName+".style.color=sOver");}
function outTab(tabName)
{curColor="";eval("curColor= document.all.boxTabTd"+tabName+".style.backgroundColor");if(curColor=="#e7ebf7")
{var sNormal="3D6092";}
else
{var sNormal="808080";}
eval("document.all.boxTabCaption"+tabName+".style.color=sNormal");}
function openTab(tabName)
{lastTab=tabName
var boxTabCornerLeftOn="aqc/boxTabCornerLeftOn.gif";var boxTabCornerRightOn="aqc/boxTabCornerRightOn.gif";var boxTabFill="url(aqc/boxTabFillOn.gif)";var boxTabColorOn="808080";var underline="underline";eval("document.all.boxTabCornerLeft"+tabName+".src=boxTabCornerLeftOn");eval("document.all.boxTabCornerRight"+tabName+".src=boxTabCornerRightOn");eval("document.all.boxTabTd"+tabName+".style.backgroundImage=boxTabFill");eval("document.all.boxTabCaption"+tabName+".style.color=boxTabColorOn");eval("document.all.divTab"+tabName+".style.display = 'block'");}
function SearchInList(objList){var l_objList=eval('document.all.'+objList);var l_objSearch=eval('document.all.txtSearch'+objList);sSearchString=l_objSearch.value.toUpperCase();iSearchTextLength=sSearchString.length;for(j=0;j<l_objList.options.length;j++){sOptionText=l_objList.options[j].text;sOptionComp=sOptionText.substr(0,iSearchTextLength).toUpperCase();if(sSearchString==sOptionComp){l_objList.selectedIndex=j;break;}}}
function SearchInList(objList){var l_objList=eval('document.all.'+objList);var l_objSearch=eval('document.all.txtSearch'+objList);sSearchString=l_objSearch.value.toUpperCase();iSearchTextLength=sSearchString.length;for(j=0;j<l_objList.options.length;j++){sOptionText=l_objList.options[j].text;sOptionComp=sOptionText.substr(0,iSearchTextLength).toUpperCase();if(sSearchString==sOptionComp){l_objList.selectedIndex=j;break;}}}
function ComboDb_CopySelection(objList){var l_objList=eval('document.all.'+objList);var l_objSearch=eval('document.all.txtSearch'+objList);l_objSearch.value=l_objList.options[l_objList.selectedIndex].text}
