function switchProprietaryAttributes(artType) {
	
	//switchObjID = 'kind'+artType;
	
	formElemsArr = new Array("input","select","textarea");
	
	inputArr = document.getElementsByTagName('input');
	
	var chkdNo = 0;
	
	for (i = 0; i < inputArr.length; i++) {
		
		if (inputArr[i].className == 'switchers' && inputArr[i].checked) {
			chkdNo++;
			if (chkdNo == 1) {
				tempId = 'kind'+inputArr[i].id.substring(2,inputArr[i].id.length);
			}
		}
		
	}
	
	if (chkdNo == 1) {
		var tempContainer = document.getElementById(tempId);
		tempContainer.style.display = 'block';
		elems = tempContainer.childNodes;
		
		for (j = 0; j < elems.length; j++) {
			
			tempCounter = 0;
			for (k = 0; k < formElemsArr.length; k++) {
				
				if (elems[j].tagName.toLowerCase() == formElemsArr[k]) {
					tempCounter++;
				}
			}
			
			
			
			// verific daca tagname e in formElemsArr daca da il enable-uiesc
			if (tempCounter > 0) {
				elems[j].disabled = false;
			}
			
		}
		
		return;
	}
	else {
		
		fieldsets = document.getElementsByTagName('fieldset');
		
		for (i = 0; i < fieldsets.length; i++) {
			
			if (fieldsets[i].className == 'propAttribs') {
				fieldsets[i].style.display = 'none';
			}
			
		}
		
		
		for (j = 0; j < elems.length; j++) {
			
			tempCounter = 0;
			for (k = 0; k < formElemsArr.length; k++) {
				if (elems[j].tagName.toLowerCase() == formElemsArr[k]) {
					tempCounter++;
				}
			}
			
			
			
			// verific daca tagname e in formElemsArr daca da il enable-uiesc
			if (tempCounter > 0) {
				elems[j].disabled = 'disabled';
			}
			
		}
		
		
	}
}


function showSearchForm(tObj) {
	document.getElementById('programSearchForm').style.display = 'block';
	tObj.parentNode.style.display = 'none';
}

function setBgElemHeight(elemID) {
	return;
	textLength = document.getElementById(elemID).textContent.length;
	
	if (textLength <= 27) {
		document.getElementById(elemID).style.height = '40px';
	}
	
	else if (textLength > 27 && textLength <= 70) {
		document.getElementById(elemID).style.height = '60px';
	}
	
	
	if (textLength > 70) {
		document.getElementById(elemID).style.height = '90px';
	}
	
	
}



function showObj(objname){
	document.getElementById(objname).style.display="block";
	return;
}

function hideObj(objname){
	document.getElementById(objname).style.display="none";
	return;
}


function showPic(picture,link){
		document.getElementById("picture").src=picture;
		document.getElementById("link").href=link;
	}

function showPicOnPlace(picture,link,place){
		showObj(place);
		document.getElementById(place).src=picture;
		document.getElementById(place).href=link;
	}


var ifCN = 'focused';
function focusableInput() {
	for(var i=0, j=arguments.length; i<j; i++) {
		var obj = document.getElementById(arguments[i]);
		obj.onfocus = inputFocus;
		obj.onblur = inputBlur;
	}
}
function inputFocus() {
	if (this.value == this.defaultValue) this.value = '';
	if (this.className.length > 0) this.className += ' ' + ifCN;
	else this.className = ifCN;
}
function inputBlur() {
	if (this.value == '') this.value = this.defaultValue;
	var reCN = this.className.match(new RegExp(' ?' + ifCN + ' ?'));
	if (reCN) this.className = this.className.replace(reCN, '');
}


function registerFocus(objId) {
	var theLinks = document.getElementById(objId).getElementsByTagName('a');
	for (var i=0; i<theLinks.length; i++) {
		theLinks[i].onclick = function() {
			var linkHref;
			if (linkHref = this.getAttribute('href').match(uriRE)) {
				document.getElementById(linkHref[1]).scrollIntoView();
				document.getElementById(linkHref[1]).focus();
				return false;
			}
		}
	}
}

function showPromo(promo){
clearTimeout(wait);

if(!promo){
	var i = 1+ Math.round((totalpromos-1) * Math.random());
	promo=i;
	promoname="promo"+i;
	promonavname="promonav"+promo;
} else {
	promoname="promo"+promo;
	promonavname="promonav"+promo;
}
currentpromoname='promo'+currentpromo;
document.getElementById(currentpromoname).style.top=-1000+'px';
if(totalpromos > 1){
	currentpromonavname='promonav'+currentpromo;
	document.getElementById(currentpromonavname).className="";
}
document.getElementById(promoname).style.top=0+'px';
if(totalpromos > 1) { document.getElementById(promonavname).className='selected'; }

currentpromo=promo;
wait=setTimeout("nextPromo()",10000);
}

currentpromoname="promo1";
currentpromonavname="promonav1";
currentpromo=1;
totalpromos=1;
wait=0;


function nextPromo(){
if(currentpromo < totalpromos) {
		showPromo(currentpromo+1);
} else {
		showPromo(1);
}
}

slideshow=0;
wait2=0;
nexturl="";

function showSubBanners(){
document.getElementById("hotbox").style.display="block";
}

function toggleSlideshow(){
	if(slideshow == 1){
//			alert("stop show");
			clearTimeout(wait);
			document.getElementById("slideInfo").style.display="none";
			slideshow=0;
	} else {
//			alert("start show");
			slideshow=1;
			wait=setTimeout("nextSlideshow()",10000);
			document.getElementById("slideInfo").style.display="block";
	}
}

function nextSlideshow(){
clearTimeout(wait);
clearTimeout(wait2);
nexturl=nexturl.replace(/&amp;/g,"&");
//alert("nextPic:"+nexturl);
location.href=nexturl;
}


var savedClass='';

function doRollOver(objectname){
	savedClass=document.getElementById(objectname).className;
	document.getElementById(objectname).className= document.getElementById(objectname).className + ' rollOver';
	return;
}
function doRollOut(objectname){
	document.getElementById(objectname).className=savedClass;
	return;
}

 function CreateBookmarkLink(title,url) {

	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
 }
