ddaccordion.init({
	headerclass: "expandable", //Shared CSS class name of headers group that are expandable
	contentclass: "categoryitems", //Shared CSS class name of contents group
	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
	onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: true, //persist state of opened contents within browser session?
	toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "normal", //speed of animation: "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
})


function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
	theDoc = parent.frames[theObj.substring(p+1)].document;
	theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
	foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
	foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

function gotoURL(url){
	document.location.href = url;
}

function openPop(url) { 
	newWindow=window.open(url); 
}
function openPopSized(url,h,w) { 
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	newWindow=window.open(url, 'popup','height='+h+',width='+w+',toolbar=no,scrollbars=no,resizable=no,status=no,top='+TopPosition+',left='+LeftPosition+';');
	newWindow.resizeTo(w,h);
	newWindow.focus(); 
	return false;
}

function change(objNum){
	var objName = "tablink";
	for (i = 1; i <= 3; i++)
	{
		if (objNum == i) 
		{
			obj = findObj(objName+i);
			if (objNum == 1){
				obj.className = "tabup1";
			}else{
				obj.className = "tabup2";
			}
		}
		else 
		{
			obj = findObj(objName+i);
			obj.className = "tabdown";
		}
	}
}

function validarFormulario(f){
	if(f.comentario.value!="" && f.nombreTxt.value!="" && f.idprod.value!="")
	{
		return true;
	}else{
		alert('Debe ingresar todos los campos');
	}
	return false;
}

function openWindow(url) {
   var opt = 'dialogWidth:500px; dialogHeight:500px; center:yes; scroll:yes; status:yes;';
   window.showModalDialog(url, '', opt); 
}