/**************************************************
 * arm.js
 * 15.03.2010
 * armes.ru
 *  **************************************************

 **************************************************/


var count= 1;
var collapse = 0;
var screen;
//=====================================LOADERS


function setUp() {
	var screen;
var myWidth = 0, myHeight = 0;

  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
if (myWidth <= 1024) {
 // window.alert( "1" );
 screen = 1;
 
} else if (myWidth > 1024 && myWidth<=1280) {
 //  window.alert( "2" );
 screen = 2;
} else if (myWidth > 1280) {
 // window.alert( "3" );
 screen = 3;
} else {
 
}
  
  
 

}


function start() {
	
//document.body.style.backgroundImage.src="pics/1.jpg";
var randomnumber=Math.floor(Math.random()*31)+1

var func = function() {
	var count= randomnumber;
}
var count= randomnumber;
document.body.style.backgroundImage =  'url("pics/1600x'+randomnumber+'.jpg")';
document.getElementById("num").innerHTML = count;
var al = document.getElementById("num").innerHTML;


var isFaceShowed=1;


return func
			
			
	




window.alert( count );
	}
	
	function outer() {
		
    var outerVar=1

   
	
}

//=====================================TIMER




	
//==========================================================MAIN BG SWITCH

function page_adjust(w)
      {
	  var count = parseInt(document.getElementById("num").innerHTML);
	 
	
	  
	  var current = count;
          var previous = current;
		  
		  	if  (w==2 ) {
				 if (count>=31){count=0;}
				count=count+1;
				
			}  else {
				
			}
			
				if  (w==1) {
					  if (count<=1){count=32;}
				count=count-1;
				
				} else {
					
				}
		  
		  current = count;
		  
		//  window.alert( current , w );

		 
         var bgGo = 'url("pics/1600x'+count+'.jpg")';
		 // window.alert(bgGo);
		  document.body.style.backgroundImage = bgGo;
          document.getElementById("num").innerHTML = count;
      } 




//================================================COLLAPSE

function collapseTxt() {

if( collapse==0 ){

document.getElementById("txt").style.visibility='hidden';
newHeight = 45;
newBottom = 0;
var siteKeep = document.getElementById('root'), noPx = document.childNodes ? 'px' : 0;
if( siteKeep.style ) { siteKeep = siteKeep.style; }
if( siteKeep.resizeTo ) { siteKeep.resizeTo( newHeight ); }
if( siteKeep.moveTo ) { siteKeep.moveTo( newBottom );}

	siteKeep.height = newHeight + noPx; siteKeep.pixelHeight = newHeight;
	siteKeep.bottom = newBottom + noPx; siteKeep.pixelBottom = newBottom;
document.getElementById("root").style.height=45;
document.getElementById("root").style.bottom=0;
var toggleBtn = document.getElementById('toggle');
var btnReplace = "<img src='restore.gif' border='0' alt='prev'>";
toggleBtn.innerHTML = btnReplace;
tg = 1;

} else {

}



if (collapse==1){

document.getElementById("txt").style.visibility='visible';
newHeight = 356;
var siteKeep = document.getElementById('root'), noPx = document.childNodes ? 'px' : 0;
if( siteKeep.style ) { siteKeep = siteKeep.style; }
if( siteKeep.resizeTo ) { siteKeep.resizeTo( newHeight ); }
	siteKeep.height = newHeight + noPx; siteKeep.pixelHeight = newHeight;

document.getElementById("root").style.height=356;

var toggleBtn = document.getElementById('toggle');
var btnReplace = "<img src='collapse.gif' border='0' alt='prev'>";
toggleBtn.innerHTML = btnReplace;
tg = 0;

}  else {

}

collapse = tg;

     
}


//==================================================================== DRAG & MINOR
function up() {
this.style.color='red';
}


function killInfo() {
document.getElementById("root1").style.visibility='hidden';
}

function killFace() {
	
	
document.getElementById("root3").style.visibility='hidden';
isFaceShowed=0;
}

function readyFace() {
	isFaceShowed=1;
	
	
		newLeft = 500;
		newTop = 450;
		var siteKeep = document.getElementById('root3'), noPx = document.childNodes ? 'px' : 0;
		if( siteKeep.style ) { siteKeep = siteKeep.style; }
		if( siteKeep.resizeTo ) { siteKeep.resizeTo( newHeight ); }
			siteKeep.left = newLeft + noPx; siteKeep.pixelLeft = newLeft;
			siteKeep.top = newTop + noPx; siteKeep.pixelTop = newTop;
			siteKeep.visibility='visible';
		document.getElementById("root3").style.left=156;
		document.getElementById("root3").style.visibility='visible';
		}

function showFace() {
	
	
	
document.getElementById("root3").style.visibility='visible';
newLeft = 600;
newTop = 450;
var siteKeep = document.getElementById('root3'), noPx = document.childNodes ? 'px' : 0;
if( siteKeep.style ) { siteKeep = siteKeep.style; }
if( siteKeep.resizeTo ) { siteKeep.resizeTo( newHeight ); }
	siteKeep.left = newLeft + noPx; siteKeep.pixelLeft = newLeft;
	siteKeep.top = newTop + noPx; siteKeep.pixelTop = newTop;
document.getElementById("root3").style.leftt=156;
	

}

function killMap() {
document.getElementById("root_map").style.visibility='hidden';
}

function showMap() {
document.getElementById("root_map").style.visibility='visible';
}

function showInfo() {
document.getElementById("root1").style.visibility='visible';
document.getElementById("root1").style.borderStyle='outset';
document.getElementById("root1").style.borderColor='#e60f74';
document.getElementById("root1").style.borderWidth='5px';
t=setTimeout("glowInfo()",500);


}

function glowInfo() {
document.getElementById("root1").style.borderStyle='none';
}

function showMenu() {
document.getElementById("other_menu").style.visibility='visible';

}

function killMenu() {
document.getElementById("other_menu").style.visibility='hidden';
}

function showRoof() {
document.getElementById("roof_menu").style.visibility='visible';

}

function killRoof() {
document.getElementById("roof_menu").style.visibility='hidden';
}

function infoDr() {
var theHandle1 = document.getElementById("handle1");
	var theRoot1   = document.getElementById("root1");
Drag.init(theHandle1, theRoot1);
}

function mapDr() {
var theHandle1 = document.getElementById("handle_map");
	var theRoot1   = document.getElementById("root_map");
Drag.init(theHandle1, theRoot1);
}

function txtDr() {
var theHandle = document.getElementById("handle");
var theRoot   = document.getElementById("root");
Drag.init(theHandle, theRoot);
}

function faceDr() {
var theHandle = document.getElementById("handle3");
var theRoot   = document.getElementById("root3");
Drag.init(theHandle, theRoot);
}

