// JavaScript Document
var activelink = "";


var changeImg = function(id, source, idactive){
	var img = new Image;
	var path = $(id).src;
	
	
	var pathArray = path.split("/"); 
	var src = "";
	
	for(i=0; i<pathArray.length-1; i++){
		src += pathArray[i]+"/";
	}
	
	$(idactive).className = 'reddark';
	$(activelink).className = 'series-num-links';
	
	
	activelink = idactive;
	
	$(id).src=src+source;
}


var resetform = function(idform,idresponse, type){
	
	idresponse = idresponse || 'form-response';
	type = type || 1;
	
	$(idform).reset();
	$(idresponse).innerHTML = "";
	
	if(type==1)
		$('request-edo').innerHTML = "";
}


var validasearch = function(){
	
	
	if(document.search.q.value == ""){
		return false;
	}
	else
		return true;
}



var regselectedmultiple = function(obj){
	
	var bool = false;
	
	for(i=0; i<obj.length; i++){
		if(i == obj.length-1 && obj[i].selected){
			bool = true;
			LoadData('link=Registro&SubMethod=NewFormI&Type=2', 'subform-level');
		}
			
	}
	
	if(!bool)
		$("subform-level").set("html", "");
}


var openWindow = function(obj){
	window.open(obj.href, 'Macmillan', 'menubar=0, scrollbars=1, resizable=0,width=750,height=450');
	return null;
}
