function createXMLHttpRequest() {
   try { return new XMLHttpRequest(); } catch(e) {}
   try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
   try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
   alert("XMLHttpRequest not supported");
   return null;
 }

function RC_GetCrossLinkHTML(appPath, ratingMode, tabModID, comobjtype, comobjval, comobjval2 )
{
	//debugger;
    var xmlHttpReq= createXMLHttpRequest();
	var domainName= document.domain;
//	if(domainName.indexOf('.') ==-1)
//	{
//		var strURL=window.location.href;
//		var dname = 'http://' + domainName;
//		strURL=strURL.slice(dname.length+1);
//		strURL=strURL.slice(0,strURL.indexOf('/'));
//		domainName = domainName + '/' + strURL + appPath;
//	}
	
	if(comobjtype=='Q')
	{
		if(comobjval2==null)
			comobjval2='';
xmlHttpReq.open("GET", "http://" + domainName + appPath + "/desktopmodules/dnncentric-ratingandcomments/CrossLinking.ashx?comobjtype=" + comobjtype + "&comobjval=" + comobjval + ":" + comobjval2 + "&tabmodid=" + tabModID + "&ratingmode=" + ratingMode, false);
	}
	else
	{
	    xmlHttpReq.open("GET", "http://" + domainName + appPath + "/desktopmodules/dnncentric-ratingandcomments/CrossLinking.ashx?comobjtype=" + comobjtype + "&comobjval=" + comobjval + "&tabmodid=" + tabModID + "&ratingmode=" + ratingMode, false);
	}
    
    xmlHttpReq.send(null);
    var resString = xmlHttpReq.responseText;
    return resString;
	
}

function RC_getQuerystring(key, default_)
{
  if (default_==null) default_="";
  key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
  var qs = regex.exec(window.location.href);
  if(qs == null)
    return default_;
  else
    return qs[1];
} 


