/* ---------------- Script c 2006-2009 EC Software ----------------
This script was created by Help & Manual. It is designed for use 
in combination with the output of Help & Manual and must not
be used outside this context.     http://www.helpandmanual.com

Do not modify this file! It will be overwritten by Help & Manual.
-----------------------------------------------------------------*/

var topicInitScriptAvailable = true;
var HMToggles = new Array();

function hmtoggleexpandall(value)
{
	if (HMToggles.length != null){ 
	  for (i=0; i<HMToggles.length; i++){ 
		HMToggleExpand(HMToggles[i], value); 
	  }
	}
}

function hmtoggle()
{ 
	var op = hmtoggle.arguments[0];
	for (i=1; i<hmtoggle.arguments.length; i++) {
			var objID = hmtoggle.arguments[i].toUpperCase(); 
			var obj = document.getElementById(objID);
 	  switch (op) {
		case "toggle": 
		  var state = obj.getAttribute("hm.state");
		  if (state == null) { state = "0" }; 
		  HMToggleExpand(obj, (state != "1"));
		  break;

		case "expand":
		  HMToggleExpand(obj, true);
		  break;

		case "collapse":
		  HMToggleExpand(obj, false);
		  break;
	  }
	}
}

function HMToggleExpand(obj, value)
{
	tagName = obj.nodeName.toLowerCase();
	switch (tagName) {
		case "span":
		  obj.style.display = (value ? "inline" : "none");
		  break;
		case "table":
		  obj.style.display = (value ? "block" : "none");
		  break;
		case "img":
		  obj.src = (value ? obj.getAttribute("hm.src1") : obj.getAttribute("hm.src0"));
		  var newTitle = (value ? obj.getAttribute("hm.title1") : obj.getAttribute("hm.title0"));
		  if (newTitle != null) { obj.title = newTitle; }
		  var newCaption = (value ? obj.getAttribute("hm.caption1") : obj.getAttribute("hm.caption0"));
		  if (newCaption != null) { obj.parentNode.parentNode.parentNode.nextSibling.firstChild.firstChild.innerHTML = newCaption; }
		  break;
	}
	obj.setAttribute("hm.state", value ? "1" : "0");
}

function HMSearchCheck(obj) 
{
  var foundHilite = window.location.search.lastIndexOf("zoom_highlight") > 0;
  if (!foundHilite) {
    var fontTags = obj.getElementsByTagName("FONT");
    if (fontTags.length > 0) {
      var hStyle = "";
      for (var cCheck = 0; cCheck < fontTags.length; cCheck++) {
        hStyle = fontTags[cCheck].style.cssText;
        if (hStyle.indexOf("BACKGROUND-COLOR") == 0) {
	  foundHilite = true;
          break; 
        }
      }
    }
  }
  return foundHilite;     
}

function HMInitToggle()
{
    if (document.getElementById) {
	var node = document.getElementById(HMInitToggle.arguments[0]);
	for (i=1; i<HMInitToggle.arguments.length-1; i=i+2) { 
		if (HMInitToggle.arguments[i] == "onclick") {
		  node.onclick = Function(HMInitToggle.arguments[i+1]); 
		}
		else { 
		  node.setAttribute(HMInitToggle.arguments[i], decodeURI(HMInitToggle.arguments[i+1])); 
		}
		if (HMInitToggle.arguments[i].substring(0,6) == "hm.src") {
			var img = new Image();
			img.src = HMInitToggle.arguments[i+1];
		}
	}
	mustExpand = HMSearchCheck(node); 
	if (node.nodeName.toLowerCase() == "img") {
	   var aLink = node.parentNode;
	   if (aLink.nodeName.toLowerCase() == "a") { 
		aLink.href = "javascript:hmtoggle('toggle','" + HMInitToggle.arguments[0] +"')";
		mustExpand = false; 
	   }
	}
	HMToggles[HMToggles.length] = node;
        if (mustExpand) { 
          node.setAttribute("hm.state", "1"); 
          var nodeImg = document.getElementById('$'+node.getAttribute("id")+'_ICON');
          if (nodeImg) { HMToggleExpand(nodeImg, true); }
        }
	HMToggleExpand(node, ((node.getAttribute("hm.state") == "1") || mustExpand));
    }
}


		$(document).ready(function() 
		{

			var text = '<div id="notification" style="position: fixed; top: 0px; width:100%;z-index:100; border-bottom:solid 1px #D6800C; padding:7px 0 7px 50px;text-align:left;background-color:#F4A83D; font-weight: bold; color: #735005; font-family:Arial,Helvetica,sans-serif; display: none;">';
			var url=window.location.toString();
			if (url.indexOf('/asprunnerpro/')>0)
			{		
				text+='Looking for ASP code generator? <a href="http://www.xlinesoft.com/asprunnerpro">Download</a> your copy now.';
			}
			else if (url.indexOf('/asprunnernet/')>0)
			{
				text+='Looking for ASP.NET (C#, VB.Net) code generator? <a href="http://www.xlinesoft.com/asprunnernet">Download</a> your copy now.';
			}
			else 
			{
				text+='Looking for PHP+MySQL code generator? <a href="http://www.xlinesoft.com/phprunner">Download</a> your copy now.';
			}

			text+='</div>';			
	
			var ref=document.referrer;
			//ref="http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=ww0&q=The+Microsoft+Jet+database+engine+cannot+open+the+file+%27%28unknown%29%27.+It+is+already+opened+exclusively+by+another+user&aq=f&oq=&aqi=";
			if (ref.length>0 && ref.indexOf('http://xlinesoft.com')<0)
			{
				$('body').children(":first-child").before(text); 
    			$('#notification').css({display:'block'});
				var p=$('#notification').outerHeight();
				$('body').css({margin: p + ' 0'});
			
			//

    		}
			var end = (url.indexOf("?") == -1) ? url.length : url.indexOf("?");
		    filename = url.substring(url.lastIndexOf("/")+1, end);
			chmtop.c2wtopf.jstree.OpenTreeNode(filename);
			
		});

