<!--

if(document.all)
{
	g_szNavigatorUserAgent = navigator.userAgent.toLowerCase();
	var ie4=g_szNavigatorUserAgent.indexOf('msie 4')!=-1;
	var ie5=g_szNavigatorUserAgent.indexOf('msie 5')!=-1;
	var ie6=g_szNavigatorUserAgent.indexOf('msie 6')!=-1;
	var ie7=g_szNavigatorUserAgent.indexOf('msie 7')!=-1;
}

  function getValueFromId(a_szId)
  {
    var oe = ei(a_szId);
    if(!oe) return null;
    return oe.value;
  }

  function ei(a_szId)
  {
    if(a_szId == null)
    {
      return null;
    }
    
    if('string' != typeof(a_szId))
    {
      return a_szId;
    }
    
    if(document.getElementById && document.getElementById(a_szId))
    {
      return document.getElementById(a_szId);
    }
    else if (document.all && document.all(a_szId))
    {
      return document.all(a_szId);
    }
    else if (document.layers && document.layers[a_szId])
    {
      return document.layers[a_szId];
    }
    else
    {
      return null;
    }
  }

  function trimLeft(a_szString, a_szSubString, a_optCount)
  {
    if(a_szString)
    {
      if(null == a_szSubString)
      {
        a_szSubString = ' ';
      }
      var iCount = 0;
      while( 0 == a_szString.indexOf(a_szSubString) )
      {
        a_szString = a_szString.substring(a_szSubString.length,a_szString.length);
        iCount++;
        if(a_optCount)
        {
          if(iCount >= a_optCount)
          {
            break;
          }
        }
      }
    }
    return a_szString;
  }

  function trimRight(a_szString, a_szSubString, a_optCount)
  {
    if(a_szString)
    {
      if(null == a_szSubString)
      {
        a_szSubString = ' ';
      }
      
      var iDiff = a_szString.length - a_szSubString.length;
      var iCount = 0;
      while(a_szString.lastIndexOf(a_szSubString) == iDiff)
      {
        a_szString = a_szString.substring(0,a_szString.length-a_szSubString.length);
        iDiff = a_szString.length - a_szSubString.length;
        iCount++;
        if(a_optCount)
        {
          if(iCount >= a_optCount)
          {
            break;
          }
        }
      }
    }
    return a_szString;
  }

  function trim(a_szString, a_szSubString)
  {
    a_szString = trimLeft(a_szString, a_szSubString);
    return trimRight(a_szString, a_szSubString);
  }

  function removeTags(xStr){
    xStr = xStr.replace(/<\/?[^>]+>/gi,"");
    return xStr;
  }

/**/
  
function showHide(obj, totCount)
{
  if(document.getElementById('choices'+obj).name !='set'+obj )
  {
    document.getElementById('choices'+obj).style.display='';
    document.getElementById('choices'+obj).name='set'+obj;
  }
  else
  {
    document.getElementById('choices'+obj).style.display='None';
    document.getElementById('choices'+obj).name='unset'+obj;
  }
}

function checkNumeric(obj)
{
	var val;
	val = parseInt(obj.value);
	if(!val){
		alert("Please enter numeric value");
		obj.value="";
		obj.focus();
		return false;
	}
}

function checkAbove(obj)
{
	if(obj.value != ""){
		alert("hello");
	}
}


function confirmDelete(){
	if(confirm("Do you really want to delete selected item ?")){
		return true;
	}else{
		return false
	}
}

function confirmDisable(){
	if(confirm("Are you sure you want to disable the user?")){
		return true;
	}else{
		return false
	}
}

function confirmDisabled(){
	if(confirm("Are you sure to disable the selected record ?")){
		return true;
	}else{
		return false
	}
}
function confirmEnabled(){
	if(confirm("Are you sure to enable the selected record ?")){
		return true;
	}else{
		return false
	}
}


function confirmEnable(){
	if(confirm("Are you sure you want to enable the user?")){
		return true;
	}else{
		return false
	}
}

function confirmPotential(){
	if(alert("Please associate plan with potential user?")){
		return false;
	}else{
		return false
	}
}


function confirmDeleteCategory(){
	if(confirm("All questions under this category will be deleted, continue?")){
		return true;
	}else{
		return false
	}
}

function validUrl(id){
	 expre = /^(http:\/\/www\.|https:\/\/www\.|ftp:\/\/|www\.)?([\w\d])+(\.{1}[\w\d]{1,3})+(\/{1}[\w]+)*$/;
		 if(expre.test(id.value) != true){
			 alert("please fill the correct Url ");
		    return false;
		 }else{
		   return true;
		 }

}

function confirmEdit(){
	if(confirm("Do you really want to update selected record ?")){
		return true;
	}else{
		return false
	}
}

function confirmCancelled(){
	if(confirm("Do you really want to cancel selected item?")){
		return true;
	}else{
		return false
	}
}

function confirmRedirection(){
	if(confirm("All the data you entered in the form will be lost.Do you want to continue?")){
			return true;
	}else{
			return false;
	}
}



function confirmNewCancelled(intUserId){
	if(confirm("Do you really want to cancel selected item?")){
					<!--
					window.open('cancelReminder.php?Cid='+intUserId,'Comment', 'resizable=no, scrollbars=no, top=200, left=180, height=350, width=550')
					//-->
		return true;
	}else{
		return false
	}
}

function showHide(obj){
		if(obj.value==1){
			document.getElementById('tabAssociate').style.display='';
			obj.checked=true;
		}else{
			document.getElementById('tabAssociate').style.display='None';
			obj.checked=true;
		}
	}



	function mmLoadMenus()
	{
		var RowCount
		//RowCount = document.getElementById("txtRowCount").value;
		if (window.mm_menu_0928113710_0) window.mm_menu_0928113710_0=null;
			window.mm_menu_0928113710_0 = new Menu("root",115,18,"Verdana, Arial, Helvetica, sans-serif",12,"#0066FF","#000000","#FFFFE0","#FFFFCC","left","middle",3,0,500,-5,7,true,true,true,0,true,true);
			mm_menu_0928113710_0.addMenuItem("Edit Options","EditSurvey();");										
			
			//alert(m_myID)
			/*for(i=3;i<=RowCount;i++)
			{
				if(document.getElementById("SurveyListGrid__ctl"+ i +"_txtIsOpen").value=='Open')
				{
					mm_menu_0928113710_0.addMenuItem("Close Survey","CloseSurvey()");
				}
				else
				{*/
					mm_menu_0928113710_0.addMenuItem("Close Survey","CloseSurvey()");
				/*}
			}*/
			
			mm_menu_0928113710_0.addMenuItem("Deploy Survey","DeploySurvey();");
			mm_menu_0928113710_0.addMenuItem("Share Survey","ShareSurvey()");
			mm_menu_0928113710_0.addMenuItem("Analyze Results","AnalyseResults();");
			mm_menu_0928113710_0.addMenuItem("Create Report","CreateReport()");
			//mm_menu_0928113710_0.addMenuItem("Test Survey","TestSurvey()");
			//mm_menu_0928113710_0.addMenuItem("Clear Tests","ClearTests()");
			mm_menu_0928113710_0.addMenuItem("Clear All","ClearAll()");
			mm_menu_0928113710_0.addMenuItem("Manual Input","ManualInput()");
			mm_menu_0928113710_0.addMenuItem("Delete Survey","DeleteSurvey()");
			mm_menu_0928113710_0.hideOnMouseOut=true;
			mm_menu_0928113710_0.menuBorder=1;
			mm_menu_0928113710_0.menuLiteBgColor='#FFFFFF';
			mm_menu_0928113710_0.menuBorderBgColor='#777777';
			mm_menu_0928113710_0.writeMenus();
			
	} // mmLoadMenus()
	
				
function confirmArchive(){
	if(confirm("Do you really want to move selected item to expired folder ?")){
		return true;
	}else{
		return false
	}
}
function confirmSold(){
	if(confirm("Do you really want to move selected item to sold folder?")){
		return true;
	}else{
		return false
	}
}

function confirmActiveFromSold(){
	if(confirm("Do you really want to move selected item from sold folder to active ?")){
		return true;
	}else{
		return false
	}
}

function confirmActiveFromArchive(){
		if(confirm("Do you really want to move selected item from expired folder to active ?")){
		return true;
	}else{
		return false
	}

}
function confirmActiveFromDeleted(){
		if(confirm("Do you really want to move selected item from Deleted to active ?")){
		return true;
	}else{
		return false
	}

}
function confirmRefund()
{
	if (confirm("Are you sure you want to refund this transaction?"))
		return true;
	else
		return false;
}

function deleteCookie(a_szName, a_szPath)
{
  if('' != getCookie(a_szName))
  {
    document.cookie = a_szName + "=" +
                    "; path=" + ((!a_szPath) ? "/" : a_szPath) +
                    "; expires=" + new Date(0).toGMTString();
  }
}

function getCookie(a_szName)
{
  var szReturn = '';
  var szSearch = a_szName + '=';
  if(document.cookie.length > 0)
  {
    var iOffset = document.cookie.indexOf(szSearch);
    if(iOffset != -1) {
      iOffset += szSearch.length;
      var iEnd = document.cookie.indexOf(";", iOffset);
      if(iEnd == -1)
	  {
	  	iEnd = document.cookie.length;
	  } 
      szReturn = unescape(document.cookie.substring(iOffset, iEnd));
    }
  }
  return szReturn;
}

function setCookie(a_szName, a_szValue, a_dateExpire, a_szPath)
{
  document.cookie = a_szName + "=" + escape(a_szValue) +
                    ((!a_dateExpire) ? "" : ("; expires=" + a_dateExpire.toUTCString())) +
                    "; path=" + ((!a_szPath) ? "/" : a_szPath);
}

function popup(mylink, windowname, width, height, a_szExtra)
{
if (! window.focus)
return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
if(typeof(a_szExtra) == 'undefined')
{
	a_szExtra = ',scrollbars=no'; 
}

window.open(href, windowname, 'width=' + width + ',height=' + height + ', ' + a_szExtra);
return false;
}

function escapeHTML(a_szText)
{
  var div = document.createElement('div');
  var text = document.createTextNode(a_szText);
  div.appendChild(text);
  return div.innerHTML;
}

function unescapeHTML(a_szText)
{
  var div = document.createElement('div');
  div.innerHTML = a_szText;
  return div.childNodes[0] ? div.childNodes[0].nodeValue : '';
}

function convertHtmlToText(a_szHtml)
{
	if('undefined' == typeof(a_szHtml))
	{
		return '';
	}
	a_szHtml = a_szHtml.replace(/(<br\s*\/?>)/ig,"\r\n").replace(/(<\/p>)/ig,"\r\n").replace(/(<\/td>)/ig,"\r\n").replace(/(<([^>]+)>)/ig,'').replace(/!!!ListingAgentPhoto!!!/g,'').replace(/!!!MyPhoto!!!/g,'').replace(/!!!ListingAgentImage!!!/g,'').replace(/!!!MyImage!!!/g,'').replace(/!!!EmailLogo!!!/g,'').replace(/!!!EmailBorderStart!!!/g,'').replace(/!!!EmailBorderEnd!!!/g,'').replace(/!!!EmailHeaderBar!!!/g,'').replace(/!!!EmailFooter!!!/g,'').replace(/^\s+/,'').replace(/\s+$/,'').replace(/[\t ]{3,}/g,'').replace(/(\r\n){3,}/g,"\r\n");
	return unescapeHTML(a_szHtml);
}


//-->
