//c1=new Image(); c1.src="portfolio/n1.jpg";
c2=new Image(); c2.src="portfolio/n2.jpg";
c3=new Image(); c3.src="portfolio/n3.jpg";
c4=new Image(); c4.src="portfolio/n4.jpg";
c5=new Image(); c5.src="portfolio/n5.jpg";
//c6=new Image(); c6.src="portfolio/p1.jpg";
c7=new Image(); c7.src="portfolio/p2.jpg";
c8=new Image(); c8.src="portfolio/p3.jpg";

image_a=new Array("n1.jpg", "n2.jpg", "n3.jpg", "n4.jpg", "n5.jpg", "p1.jpg", "p2.jpg", "p3.jpg");
image_na=new Array("goldentele_na.jpg", "obolon_sm_na.jpg");
var port=new Array("48", "8", "4", "26", "36", "42", "5", "10", "39", "1", "13", "6", "38", "17", "11", "16", "18", "22", "20", "32", "37", "12", "14", "19", "2", "25", "27", "28", "23", "24", "3", "41", "45", "21", "46", "9", "43", "33", "30", "7", "34", "35", "40", "44", "47", "29", "31", "15");

function onc(i,f){
document.images[f].src= "portfolio/" + image_a[i];
}


function guestform(){
var yes=1;

  if (document.forms[0].surname.value == "") 
     { alert ("Введите свое имя!"); yes=0;
     } 
  if (document.forms[0].firm.value == "") 
      { alert ("Введите название компании  заказчика!");  yes=0;
      }
  if (document.forms[0].tel.value == "") 
      { alert ("Введите телефон/факс!");  yes=0;
      }
  if (document.forms[0].subject.value == "") 
      { alert ("Введите краткое описание сюжета!");  yes=0;
      }
  if (yes)
      { document.forms[0].action="mailto:photo@gaidai.kiev.ua?subject=Message from Gaidai's web site (in Russian)";     
        return true;
      }
  alert ("Пожалуйста, заполните форму заново!"); 
  return true;  
}

function guestforme(){
var yes=1;

  if (document.forms[0].surname.value == "") 
     { alert ("Enter your name!"); yes=0;
     } 
  if (document.forms[0].firm.value == "") 
      { alert ("Enter the name of customer company!");  yes=0;
      }
  if (document.forms[0].tel.value == "") 
      { alert ("Enter telephone/fax!");  yes=0;
      }
  if (document.forms[0].subject.value == "") 
      { alert ("Enter subject brief description!");  yes=0;
      }
  if (yes)
      { document.forms[0].action="mailto:photo@gaidai.kiev.ua?subject=Message from Gaidai's web site (in English)";     
        return true;
      }
  alert ("Please, fill in the form again!"); 
  return true;  
}


function portnp(n,v,l){
var por;
var zad;
var per;
var fir;
if (l==0){
zad="_p.html";
per="portfolio_";
fir="portfolio.html";
}
else {
zad="_ep.html";
per="e_portfolio_";
fir="e_portfolio.html";
}
if (n==48 && v==0){
document.location="15"+zad;
return;
}
if (n==15 && v==1){
document.location="48"+zad;
return;
}
for (var p=0; p<port.length; p++){
if (port[p]==n){
por=p;
break;
} 
}
if (v==2) {
if (por>33){
document.location =per+(Math.floor((por+1)/7)+1)+".shtm";
}
else
{
document.location = (por < 7) ? fir : (per+(Math.floor(por/7)+1)+".shtm");
}
}
else
{
document.location = (v ? port[por+1] : port[por-1])+zad;
}
}

if (typeof width == 'undefined') { var width = "270";}
if (typeof border == 'undefined') { var border = "10";}	
if (typeof offsetx == 'undefined') { var offsetx = 10;}	
if (typeof offsety == 'undefined') { var offsety = 20;}

ns4 = (document.layers)? true:false;
ie4 = (document.all)? true:false;

if (ie4) {
	if (navigator.userAgent.indexOf('MSIE 5')>0) {
		ie5 = true;
	} else {
		ie5 = false; }
} else {
	ie5 = false;
}
textar=new Array("О студии", "Портфолио");
var x = 0;
var y = 0;
var snow = 0;
var sw = 0;
var cnt = 0;
var dir = 1;
var lay;
var over;
if (ns4) {doc = "document.";sty = "";}
if (ie4) {doc = "document.all.";sty = ".style";}
function tabl(d,t) {
//	txt = "<table border='1' cellpadding='3' cellspacing='0' width='175'><tr><td bgcolor='#FFFFFF' class='txtl'>"+textar[t]+"<br></td></tr></table>"
//	layerWrite(txt);
	lay=t;
if ( (ns4) || (ie4) ) {
	if (ns4) over = eval(doc+lay);
	if (ie4) over = eval(lay+sty);
dir = d;
	disp();
	
}
}
document.onmousemove = mouseMove
	if (ns4) document.captureEvents(Event.MOUSEMOVE)
function nd() {
	if ( cnt >= 1 ) { sw = 0 };
	if ( (ns4) || (ie4) ) {
		if ( sw == 0 ) {
			snow = 0;
			hideObject(over);
		} else {
			cnt++;
		}
	}
}

function disp() {
	if ( (ns4) || (ie4) ) {
		if (snow == 0) 	{
			if (dir == 1) { // Right
				moveTo(over,x+offsetx,y+offsety);
			}
			if (dir == 0) { // Left
				moveTo(over,x-offsetx-width,y+offsety);
			}
			showObject(over);
			snow = 1;
		}
	}
}
function mouseMove(e) {
	if (ns4) {x=e.pageX; y=e.pageY;}
	if (ie4) {x=event.x; y=event.y;}
	if (ie5) {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;}
	if (snow) {
		if (dir == 1) { // Right
			moveTo(over,x+offsetx,y+offsety);
		}
		if (dir == 0) { // Left
			moveTo(over,x-offsetx-width,y+offsety);
		}
	}
}

function layerWrite(txt) {
        if (ns4) {
                var lyr = document.lay.document
                lyr.write(txt)
                lyr.close()
        }
        else if (ie4) document.all["lay"].innerHTML = txt
}
function showObject(obj) {
        if (ns4) obj.visibility = "show"
        else if (ie4) obj.visibility = "visible"
}
function hideObject(obj) {
        if (ns4) obj.visibility = "hide"
        else if (ie4) obj.visibility = "hidden"
}
function moveTo(obj,xL,yL) {
        obj.left = xL
        obj.top = yL
}

var nohid=false; 
var off=10; 
var num=5; 
var tit=470; 
var wtab=754;
var nam="new"; 

if(ns4) {doc = "document.";sty = "";vis="show";hid="hide";pos="pageYOffset";witd="innerWidth";cent=311;lft=82;} 
else if(ie4) {doc = "document.all.";sty = ".style";vis="visible";hid="hidden";pos="document.body.scrollTop";witd="document.body.clientWidth";cent=303;lft=82;}  

function show(ll)  
{   
document.images['h1'].src="images/white1.gif";
if(nohid) {nohid=!nohid;    
for(i=1;i<=num;i++)  
{fH = eval(doc + nam + i + sty);  
fH.visibility=hid;}}  
fH = eval(doc + ll + sty);
//if(eval(pos)<=tit-off)
fH.top=tit;   
//else fH.top=eval(pos)+off; 
if(eval(witd)<=wtab) fH.left=lft;
else fH.left=(eval(witd)/2)-cent;
fH.visibility=vis;

} 

function nohide(ll)  
{ nohid=!nohid;  } 

var nohid2=false; 
var off2=10; 
var num2=2; 
var tit2=906; 
var wtab2=754;
var nam2="pro"; 

if(ns4) {doc = "document.";sty = "";vis="show";hid="hide";pos="pageYOffset";witd="innerWidth";cent=311;lft=82;} 
else if(ie4) {doc = "document.all.";sty = ".style";vis="visible";hid="hidden";pos="document.body.scrollTop";witd="document.body.clientWidth";cent=303;lft=82;}  

function show2(ll)  
{
 if (ie4){ 
document.images['h2'].src="images/white1.gif";
//visota=document.layers.z.name;
//alert(visota);
if(nohid2) {nohid2=!nohid2;    
for(i=1;i<=num2;i++)  
{fH = eval(doc + nam2 + i + sty);  
fH.visibility=hid;}}  
fH = eval(doc + ll + sty);
//if(eval(pos)<=tit-off)
if (ns4){
fH.top=934;
fH.left=200;
}
//fH.top=eval(pos)+off; 
//if(eval(witd)<=wtab2) fH.left=lft;
//else fH.left=(eval(witd)/2)-cent;
fH.visibility=vis;}

} 

function nohide2(ll)  
{ nohid2=!nohid2;  } 