function changeImage(sImageObjName,sImageName,sCase){
	if(sCase=="_off") document.images[sImageObjName].src = sImageName+"_on.jpg";
	else document.images[sImageObjName].src = sImageName+"_off.jpg";
}	
	
function showTip(tipText, bcolor, wwidth){
	tipspace.style.visibility = '';
	tipspace.innerHTML = tipText;
	tipspace.style.backgroundColor = bcolor;
	tipspace.style.width = wwidth;
}	
function hideTip(){
	tipspace.style.visibility = 'hidden';
}
function currentPosition(){
	posY = event.y + 15
	posX = event.x - 30
	tipspace.style.top = posY+'px'
	tipspace.style.left = posX+'px'
}


function setOutClass(thisObj){
	if(currentObjID!=thisObj) {
		oTD = document.getElementById('oTD'+thisObj)
		if(oTD){
			if(oTD.className == "sysItemHover") oTD.className = "sysItem";
			if(oTD.className == "sysItemHoverDisabled") oTD.className = "sysItemDisabled";															}
	}
}

function setOverClass(thisObj){
	if(currentObjID!=thisObj) {
		oTD = document.getElementById('oTD'+thisObj)
		if(oTD){
			//alert(oTD.className)
			if(oTD.className == "sysItem") oTD.className = "sysItemHover";
			if(oTD.className == "sysItemDisabled") oTD.className = "sysItemHoverDisabled";
		}
	}
}

function clickFolder(thisObj,extraArg){
	setCurrentElements(thisObj);
}

function setCurrentElements(thisObj){
	oObj = document.getElementById(thisObj)
	oTDObj = document.getElementById('oTD'+thisObj)
	oUnderTDObj = document.getElementById('oUnderTD'+thisObj)
	if(oTDObj){
		if(oTDObj.className == "sysItem"||oTDObj.className == "sysItemHover"){
			oTDObj.className = "sysItemClicked";
		}
		if(oTDObj.className == "sysItemDisabled"||oTDObj.className == "sysItemHoverDisabled"){
			oTDObj.className = "sysItemClickedDisabled";
		}																
		if(oUnderTDObj.style.display == "block") oUnderTDObj.style.display = "none"
		else oUnderTDObj.style.display = "block";
	}
	if(currentObjID!='' && currentObjID!=thisObj){
		oCurrentTDObj = document.getElementById('oTD'+currentObjID)
		oCurrentUnderTDObj = document.getElementById('oUnderTD'+currentObjID)
		if(oCurrentTDObj){
			if(oCurrentTDObj.className == "sysItemClicked"){
				oCurrentTDObj.className = "sysItem";
			}
			if(oCurrentTDObj.className == "sysItemClickedDisabled"){
				oCurrentTDObj.className = "sysItemDisabled";
			}	
			oCurrentUnderTDObj.style.display = "none";															
		}
	}			
	currentObjID = thisObj;
}
function checkUserForm(iUserID){
	oForm = document.forms["userForm"]
	oForm.UserID.value = iUserID;
	oForm.UserName.value = eval('document.forms["usersForm"].UserName'+iUserID).value
	oForm.UserSecondName.value = eval('document.forms["usersForm"].UserSecondName'+iUserID).value
	oForm.UserLastName.value = eval('document.forms["usersForm"].UserLastName'+iUserID).value
	oForm.Company.value = eval('document.forms["usersForm"].Company'+iUserID).value
	oForm.Branch.value = eval('document.forms["usersForm"].Branch'+iUserID).value;
	oForm.Homepage.value = eval('document.forms["usersForm"].Homepage'+iUserID).value;
	oForm.UserEmail.value = eval('document.forms["usersForm"].UserEmail'+iUserID).value;
	oForm.UserAdress.value = eval('document.forms["usersForm"].UserAdress'+iUserID).value;
	oForm.UserZoneCode.value = eval('document.forms["usersForm"].UserZoneCode'+iUserID).value;
	oForm.UserZone.value = eval('document.forms["usersForm"].UserZone'+iUserID).value;
	oForm.User.value = eval('document.forms["usersForm"].User'+iUserID).value;
	oForm.Password.value = eval('document.forms["usersForm"].Password'+iUserID).value;
	if(eval('document.forms["usersForm"].UserAccess'+iUserID).checked) oForm.UserAccess.value = 5;
	else oForm.UserAccess.value = 0;
	if(oForm.User.value!=""&&oForm.Password.value!=""){
		oForm.Mode.value = "Change";
		oForm.submit();
	}
	else{
		alert("Empty Field!")
		oForm.User.focus();
	}
}
function deleteUserForm(iUserID){
	oForm = document.forms["userForm"]
	if(confirm("Du You want to delete this user?")){
		oForm.Mode.value = "Delete";
		oForm.UserID.value = iUserID;
		oForm.submit();
	}
	else{
		
	}
}	

function imgAnimation(sCase, iImg){
	cDiv = document.getElementById("topImg"+sCase);
	//alert(cDiv)
	if(!is.ie5&&!is.ie6){
		cDiv.style.backgroundImage= "url(media/site/startImg"+iImg+".jpg)";
	}
	else{
		cDiv.filters[0].Apply();                   
		//cDiv.filters.item("DXImageTransform.Microsoft.GradientWipe").Motion = "forward";
		//cDiv.filters.item("DXImageTransform.Microsoft.Fade").duration = 2;
   		cDiv.style.backgroundImage= "url(media/site/startImg"+iImg+".jpg)";
    	cDiv.filters[0].Play();
	}
	oImg = (iImg==1)? 2:1; 
	setTimeout('imgAnimation("'+sCase+'", '+oImg+')',8000);			
}

function fundDataEmptyAnimation(){
	if(!is.ie5&&!is.ie6){
		if(cFundDataCase == 0){
			fundDiv1.style.display = "block";
			fundDiv0.style.display = "none";
		}
		else{
			fundDiv1.style.display = "none";
			fundDiv0.style.display = "block";
		}	
	}
	else{
		ofundDataContainer.filters[0].Apply();                   
   		fundDivEmpty.style.display = "block";
		fundDiv1.style.display = "none";
		fundDiv0.style.display = "none";
    	ofundDataContainer.filters[0].Play();
	}
	setTimeout('fundDataAnimation()',2000);			
}
function fundDataAnimation(){
	if(is.ie5||is.ie6) ofundDataContainer.filters[0].Apply();                   
	if(cFundDataCase == 0){
		fundDiv1.style.display = "block";
		fundDiv0.style.display = "none";
		cFundDataCase = 1;
	}
	else{
		fundDiv1.style.display = "none";
		fundDiv0.style.display = "block";
		cFundDataCase = 0;
	}
	setTimeout('fundDataEmptyAnimation()',6000);			
}


