var isDHTML=0;
	var isID=0;
	var isALL=0;
	var isLAYER=0;
	
	if(document.getElementById){isID=1;isDHTML=1;}
	else
	{
		if(document.all){isALL=1;isDHTML=1;}
		else
			{
			browserVersion=parseInt(navigator.appVersion);
			if((navigator.appName.indexOf('Netscape') != -1) && (browserVersion==4)){isLAYER=1;isDHTML=1;}
			
			
			}
	}
	
	
	function findDOM (objectID,withStyle)
	{
	if(withStyle==1)
		{
		if(isID){return(document.getElementById(objectID).style);}
		else
			{
			if(isALL){return(document.all[objectID].style);}
			else
			{
			if(isLAYER){return(document.layers[objectID]);}
			}	
			}
		}
		
	else
		{
		if(isID){return(document.getElementById(objectID));}
		else
			{
			if(isALL){return(document.all[objectID]);}
			else
			{
			if(isLAYER){return(document.layers[objectID]);}
			}	
			}
		}	
	
	}
	
// exemplo function
function moveObject(objectID){
domStyle=findDOM(objectID,1);
//domStyle.left=150;
//domStyle.top=300;
//domStyle.visibility='hidden';
//domStyle.width="200 px";
//domStyle.color="red";
domStyle.background="red";
}
// exemplo function

//tamanho tela
var liveScreenHeight = screen.availHeight;
var liveScreenWidth = screen.availWidth;
//document.writeln('altura:'+liveScreenHeight);
//document.writeln('largura: '+liveScreenWidth);
//tamanho tela

//posiciona banner sky
function banner_sky_position(objectID)
{

if(liveScreenWidth > 900)
	{
domStyle=findDOM(objectID,1);
domStyle.position='absolute';
domStyle.float='left';
domStyle.left=780;
domStyle.top=10;
//domStyle.visibility='hidden';
domStyle.width="150 px";
//domStyle.color="red";
domStyle.background="red";
	}
else
{
domStyle=findDOM(objectID,1);
domStyle.position='relative';
domStyle.width="150 px";
domStyle.background="red";
}

}
//posiciona banner sky

//pega tamanho do objeto
function findWidth(objectID)
{
var dom = findDOM(objectID,0);
if(dom.offsetWidth){return dom.offsetWidth;}
if(dom.clip.width){return (null);}
}
function findHeight(objectID)
{
var dom = findDOM(objectID,0);
if(dom.offsetHeight){return dom.offsetHeight;}
if(dom.clip.height){return (null);}
}

function showDim(objectID){
widthObj = findWidth(objectID);
heightObj = findHeight(objectID);
alert('altura: '+heightObj+'\nlargura: '+widthObj);
}
//pega tamanho do objeto

//pega posição do objeto top,left
function findLeft(objectID)
{
var domStyle = findDOM(objectID,1);
var dom = findDOM(objectID,0);
if(domStyle.left){return domStyle.left;}
if(domStyle.pixelLeft){return domStyle.pixelLeft;}
if(dom.offsetLeft){return dom.offsetLeft; return (null);}
}

function findTop(objectID)
{
var domStyle = findDOM(objectID,1);
var dom = findDOM(objectID,0);
if(domStyle.top){return domStyle.top;}
if(domStyle.pixelTop){return domStyle.pixelTop;}
if(dom.offsetTop){return dom.offsetTop; return (null);}
}

function showPos(objectID){
leftPos = findLeft(objectID);
topPos = findTop(objectID);
//alert('left: '+leftPos+'\ntop: '+topPos);
}
//pega posição do objeto top,left


//pega posição do objeto bottom,right
function findRight(objectID)
{
var domStyle = findDOM(objectID,1);
var dom = findDOM(objectID,0);
if(dom.left){return (domStyle.left+domStyle.clip.width);}
if(domStyle.pixelLeft){return (domStyle.pixelLeft+dom.offsetWidth);}
if(dom.offsetLeft){return (dom.offsetLeft+dom.offsetWidth); return (null);}
}

function findBottom(objectID)
{
var domStyle = findDOM(objectID,1);
var dom = findDOM(objectID,0);
if(dom.top){return (domStyle.top+domStyle.clip.height);}
if(domStyle.pixelTop){return (domStyle.pixelTop+dom.offsetHeight);}
if(dom.offsetTop){return (dom.offsetTop+dom.offsetHeight); return (null);}
}

function showPos_1(objectID){
rightPos = findRight(objectID);
bottomPos = findBottom(objectID);
alert('right: '+rightPos+'\nbottom: '+bottomPos);
}
//pega posição do objeto  bottom,right

//pega ordem dos layers
function setLayer(objectID,layerNum){
var domStyle = findDOM(objectID,1);
domStyle.zIndex = layerNum;
}
function findLayer(objectID){
var domStyle = findDOM(objectID,1);
if(domStyle.zIndex != null){
return domStyle.zIndex;
return (null);
}
}
function wichLayer(objectID){
layerNum = findLayer(objectID);
alert('Layer: '+layerNum);
}
//pega ordem dos layers

//exibe apaga e sobe
function apaga(objectID){
var domStyle = findDOM(objectID,1);
return domStyle.visibility='hidden';
}
function mostra(objectID){
var domStyle = findDOM(objectID,1);
domStyle.visibility='visible';
}
function sobeLayer(objectID){
findLayer(objectID);
domStyle.zIndex=domStyle.zIndex + 3;
setLayer(objectID,domStyle.zIndex);
}
//exibe apaga e sobe

//visibilidade
function setVisibility(objectID,state){
var dom = findDOM(objectID,1);
dom.visibility = state;
}

function toggleVisibility(objectID){
var dom = findDOM(objectID,1);
state = dom.visibility;

if(state=='hidden' || state=='hide')
{dom.visibility='visible';}
else{
	if(state=='visible' || state=='show'){dom.visibility='hidden';}else{dom.visibility='visible';}
}

}
//visibilidade

//move
function moveObject(objectID,x,y){
var domStyle = findDOM(objectID,1);
domStyle.left = x;
domStyle.top = y;
}
//move

//swap
var prevObjectID = null;
var prevLayer = 0;

function swapLayer(objectID){
findLayer(objectID);
if(prevObjectID != null)
setLayer(prevObjectID,prevLayer);
prevLayer = findLayer(objectID);
prevObjectID = objectID;
setLayer(prevObjectID,1000);
 
}
//swap

//anima
animaDelay=5;
fx=null;
fy=null;
var domStyle;

function startAnimate(objectID,x,y){
fx=x;
fy=y;
var cx = findLeft(objectID);
var cy = findTop(objectID);
domStyle = findDOM(objectID,1);

animateObject(cx,cy);
}
function animateObject(cx,cy){
if(cx != fx){
if(cx > fx){cx -=1;}else{cx +=1;}
}
if(cy != fy){
if(cy > fy){cy -=1;}else{cy +=1;}
}
//alert('left: '+cx+'|'+fx+'\ntop: '+cy+'|'+fy);

if((cx != fx) || (cy != fy)){
if(domStyle.pixelLeft){domStyle.pixelLeft = cx;domStyle.pixelTop = cy;}
else{domStyle.left = cx;domStyle.top = cy;}
setTimeout('animateObject('+cx+','+cy+')',animaDelay);
}

}
//anima









