defaultStatus='Официальный сайт художника Волкова Сергея Васильевича';

function checkBrowser(brawser)
{
var skobka =')';
var starTT=0;
var resulTT = "";
var res=4;

starTT = brawser.indexOf(skobka) + 2;
resulTT = brawser.substr(starTT,5);

if(resulTT == ""){res=1;}
if(resulTT == "Opera"){res=2;}
if(navigator.appName == "Netscape"){res=3;}
return res;
}

function menu(curObject, state)
{

if(state=='menu1'){
curObject.className=state;
if(curObject.id=="menuTD1"){
defaultStatus='Вернутся на главную страницу';
}
if(curObject.id=="menuTD2"){
defaultStatus='Оставить сообщения в гостевой книге';
}
if(curObject.id=="menuTD3"){
defaultStatus='svvolkov2004@mail.ru';
}
if(curObject.id=="menuTD"){
defaultStatus='Добро пожаловать в галерею';
}}

if(state=='menu'){
curObject.className=state;
defaultStatus='Официальный сайт художника Волкова Сергея Васильевича';}

if(state=='newsArchive'){
curObject.className=state;
defaultStatus='Официальный сайт художника Волкова Сергея Васильевича';}
if(state=='newsArchive1'){
curObject.className=state;
defaultStatus='Перейти в архив новостей';
}

if(state=='odering1'){
curObject.className=state;
status='Здесь Вы можете узнать о том, как заказать картину';}
if(state=='odering'){
curObject.className=state;}

if(state=='MenuCoveredText'){
curObject.className=state;}
if(state=='MenuCoverText'){
curObject.className=state;}

if(state==12)
{
status='Посмотреть в новом окне';
}

return true;}

function loadLayers()
{
document.all['l1'].style.display='block';
document.all['l2'].style.display='block';
document.all['l3'].style.display='block';
document.all['l4'].style.display='block';
document.all['l5'].style.display='block';
document.all['l6'].style.display='block';
}

function effectSwitcher(currObject,state,nameStyleChange)
{
object  =  currObject;
if(state){

if(checkBrowser(navigator.userAgent) <= 1){
setIntr=setInterval("effectHandler(object)",45 );}

if(nameStyleChange==1){
document.all['name1'].className='nameSelected';}

if(nameStyleChange==2){
document.all['name2'].className='nameSelected';}

if(nameStyleChange==3){
document.all['name3'].className='nameSelected';}

if(nameStyleChange==4){
document.all['name4'].className='nameSelected';}

if(nameStyleChange==5){
document.all['name5'].className='nameSelected';}

if(nameStyleChange==6){
document.all['name6'].className='nameSelected';}}

else{
if(checkBrowser(navigator.userAgent) <= 1){
object.firstChild.children[0].filters.alpha.opacity=40;
clearInterval(setIntr);}

if(nameStyleChange==1){
document.all['name1'].className='gallery';}

if(nameStyleChange==2){
document.all['name2'].className='gallery';}

if(nameStyleChange==3){
document.all['name3'].className='gallery';}

if(nameStyleChange==4){
document.all['name4'].className='gallery';}

if(nameStyleChange==5){
document.all['name5'].className='gallery';}

if(nameStyleChange==6){
document.all['name6'].className='gallery';}
}
return true;
}

function effectHandler(object)
{

if(object.firstChild.children[0].filters.alpha.opacity>0) {
object.firstChild.children[0].filters.alpha.opacity=object.firstChild.children[0].filters.alpha.opacity-4;}
}

function previewSelection(idpic,state)
{
if(state==1){
document.all[idpic].className='gallerySelected';}

else{
document.all[idpic].className='gallery1';}
}

function preload()
{
if(checkBrowser(navigator.userAgent) != 3){
document.all['l1'].style.left  = '17';
document.all['l1'].style.top =  '121';
document.all['l2'].style.left  = '147';
document.all['l2'].style.top = '121';
document.all['l3'].style.left  = '277';
document.all['l3'].style.top = '121';
document.all['l4'].style.left  = '17';
document.all['l4'].style.top = '259';
document.all['l5'].style.top = '259';
document.all['l5'].style.left  = '147';
document.all['l6'].style.top = '259';
document.all['l6'].style.left = '277';}

if(checkBrowser(navigator.userAgent) <= 4){
document.all['l1'].style.display='none';
//document.all['l2'].style.display='none';
document.all['l3'].style.display='none';
document.all['l4'].style.display='none';
document.all['l5'].style.display='none';
document.all['l6'].style.display='none';}

else{
document.layers['l1'].visibility='hidden';
document.layers['l2'].visibility='hidden';
document.layers['l3'].visibility='hidden';
document.layers['l4'].visibility='hidden';
document.layers['l5'].visibility='hidden';
document.layers['l6'].visibility='hidden';
}

if(screen.width>1024)
{layersCorrectionX();}

if(screen.height>768)
{layersCorrectionY();}

if(checkBrowser(navigator.userAgent) <= 1){
loadLayers();}
}

function layersCorrectionX()
{
var x=0, baseX=1000, curResolitionX=screen.width;
if(checkBrowser(navigator.userAgent)!=3){
if(document.body.clientWidth>1000){
x = (document.body.clientWidth - baseX)/2; 
//x = (x + 17);
document.all['l1'].style.left = 17 + x;
document.all['l2'].style.left = 147 + x;  //x  + 132;
document.all['l3'].style.left = 277 + x; //x+261;
document.all['l4'].style.left = 17 + x;//x;
document.all['l5'].style.left = 147 + x; //x+132;
document.all['l6'].style.left = 277 + x; //x + 261;
}
else{
document.all['l1'].style.left  = '17';
document.all['l2'].style.left =  '147';
document.all['l3'].style.left  = '277';
document.all['l4'].style.left  = '17';
document.all['l5'].style.left  = '147';
document.all['l6'].style.left = '277';
}}}


function layersCorrectionY()
{
var y=0, baseY=650, curResolitionY=screen.height;
if(checkBrowser(navigator.userAgent)!=3){
if(document.body.clientHeight>650){
y = (document.body.clientHeight -  baseY)/2; 

document.all['l1'].style.top =  121 + y;  
document.all['l2'].style.top =  121 + y; 
document.all['l3'].style.top =  121 + y;
document.all['l4'].style.top =  259 + y;
document.all['l5'].style.top =  259 + y;
document.all['l6'].style.top =  259 + y;

}
else{
document.all['l1'].style.top =  '121';
document.all['l2'].style.top =  '121'; 
document.all['l3'].style.top = '121';
document.all['l4'].style.top = '259';
document.all['l5'].style.top = '259';
document.all['l6'].style.top = '259';
}}}

function alignmentDoc()
{
var  x=0, y=0;
var baseX=1000, baseY=650, deltaX=0, deltaY=0;

if(document.body.clientHeight>baseY)
{
deltaY  =  document.body.clientHeight - baseY;
document.all['b1'].height = deltaY/2;
document.all['b12'].height = deltaY/2;
document.all['b2'].height = deltaY/2;
document.all['bl'].height = 650;
document.all['br'].height = 650;
document.all['b3'].height = deltaY/2;
document.all['b34'].height = deltaY/2;
document.all['b4'].height = deltaY/2;
}
else
{
document.all['b1'].height = 1;
document.all['b12'].height = 1;
document.all['b2'].height = 1;
document.all['bl'].height = 650;
document.all['br'].height = 650;
document.all['b3'].height = 1;
document.all['b34'].height = 1;
document.all['b4'].height = 1;
}

if(document.body.clientWidth>baseX)
{
deltaX  =  document.body.clientWidth - baseX;
document.all['b1'].width = deltaX/2;
document.all['b12'].width = 1000;
document.all['b2'].width = deltaX/2;
document.all['bl'].width = deltaX/2;
document.all['br'].width = deltaX/2;
document.all['b3'].width = deltaX/2;
document.all['b34'].width = 1000;
document.all['b4'].width = deltaX/2;
}
else
{
document.all['b1'].width = 1;
document.all['b12'].width = 1000;
document.all['b34'].width = 1000;
document.all['b2'].width = 1;
document.all['bl'].width = 1;
document.all['br'].width = 1;
document.all['b3'].width = 1;
document.all['b4'].width = 1;
}}




