ccom=0;

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='?customlanguage=1&language="+selObj.options[[selObj.selectedIndex]].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[[n.substring(p+1)]].document; n=n.substring(0,p);}
  if(!(x=d[[n]])&&d.all) x=d.all[[n]]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[[i]][[n]];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[[i]].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}

function addbookmark(bookmarkurl, bookmarktitle){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function confirmRate(id) {
	type = confirm("<{language id=\"1\" default=\"Please press Ok if the article was helpful else press Cancel\"}>");
	if (type) {
		window.location = "?_a=knowledgebase&_j=rate&type=yes&_i="+id;
	} else {
		window.location = "?_a=knowledgebase&_j=rate&type=no&_i="+id;		
	}
}

function addcomment() {
if (ccom == 0) {
	document.all.compact2.style.display = "inline";
	ccom=1;
} else {
	document.all.compact2.style.display = "none";
	ccom=0;
}
}

function closeTicket(ticketid) {
	var input = prompt("<{language id=\"2\" default=\"Please enter your reason for closing this ticket in the textbox below:\"}>","");
	if (input == null || input == "") {
		//alert("Unable to close the ticket, you need to specify a valid reason");
	} else {
		window.location = "index.php?_a=tickets&_m=close&_i="+ticketid+"&reason="+escape(input);
	}
}


function openTicket(ticketid) {
	var input = prompt("<{language id=\"3\" default=\"Please enter your reason for opening this ticket in the textbox below:\"}>","");
	if (input == null || input == "") {
		//alert("Unable to open the ticket, you need to specify a valid reason");
	} else {
		window.location = "index.php?_a=tickets&_m=open&_i="+ticketid+"&reason="+escape(input);
	}
}
