<!--
function exchange(n,m)
{
	document.getElementById('menu'+n).style.backgroundColor = "#fff";
	document.getElementById('menu'+n).style.backgroundImage = "url(/i/podm_bg.gif)";
	eval("document.getElementById('img1'+n).src = img7"+n+".src;");
	document.getElementById('img2'+n).src = img1.src;
	document.getElementById('img4'+n).src = img1.src;
	document.getElementById('img5'+n).src = img1.src;
	document.getElementById('img6'+n).style.visibility = "hidden";
	if (m==0) {document.getElementById('img3'+n).src = img5.src;
	document.getElementById('str7'+n).className = "nact";}
}

function exchange2(n,m)
{
	document.getElementById('menu'+n).style.backgroundColor = "#003775";
	document.getElementById('menu'+n).style.backgroundImage = "url(/i/rama1_r_b.gif)";
	eval("document.getElementById('img1'+n).src = img8"+n+".src;");
	document.getElementById('img2'+n).src = img2.src;
	document.getElementById('img4'+n).src = img3.src;
	document.getElementById('img5'+n).src = img4.src;
	document.getElementById('img6'+n).style.visibility = "visible";
	if (m==0) {document.getElementById('img3'+n).src = img6.src;
	document.getElementById('str7'+n).className = "act";}
}

function displayB(id){
	document.getElementById(id).style.visibility="visible"
}
function closeB(id){
	document.getElementById(id).style.visibility="hidden"
}

function showB(id){
	document.getElementById(id).style.display="block"
}

function hideB(id){
	document.getElementById(id).style.display="none";
}


function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);

if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

function FixCookieDate (date) {
  var base = new Date(0);
  var skew = base.getTime(); // dawn of (Unix) time - should be 0
  if (skew > 0)  // Except on the Mac - ahead of its time
    date.setTime (date.getTime() - skew);
}

function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
return null;
}

function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=.kancport.m5.com.ua" : "") +
    ((secure) ? "; secure" : "");
}

function DeleteCookie (name,path,domain) {
  var dd = document.domain

  if (GetCookie(name)) {
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=.kancport.m5.com.ua"  : "") +
      "; expires=Thu, 01-Jan-1970 00:00:01 GMT";
  }
}

function ShowPhoto(str,x,y,name,url){
	if (str=='') {
		newWindow = window.open(url,'mywindow','width=800,height=600');
	} else{
		if(y < (screen.availHeight - 20) )str3="scrollbars=no,status=no,resizable=yes,width="+x+",height="+y+",left="+(screen.availWidth-x)/2+",top="+(screen.availHeight-y)/2;
		else str3="scrollbars= yes,width="+x+",height="+ (screen.availHeight - 50)  +",left="+(screen.availWidth-x)/2+",top= 10";	
		newWindow = window.open("","newWindow",str3);
		newWindow.document.open();
		newWindow.resizeTo( (x/1+20), (y/1+110) );
		newWindow.document.write('<html><title> '+name+'</title><head><meta http-equiv="content-type" content="text/html; charset=UTF-8" /><link rel="stylesheet" href="/css/popup_img.css" type="text/css"></head> <body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" >');  
		newWindow.document.write('<table border="0" cellspacing="0" cellpadding="0" align="center" height="100%"><tr><td align="center">');
		if (url=='') {		
			newWindow.document.write('<img src="'+str+'" width="'+x+'" height="'+y+'" alt="'+name+'" ></td></tr><tr><td align="center"><i>'+name+'</i>'); 
		} else {
			newWindow.document.write('<img border=0 src="'+str+'" width="'+x+'" height="'+y+'" alt="'+name+'" > </td></tr><tr><td align="center">'+name+''); 
		}
		newWindow.document.write('');
		newWindow.document.write('</td></tr></table></body></html>');
		newWindow.document.close();
		newWindow.focus();
	}
}

function ShowForm(title,email_id,lang_link){
	var x = 400;
	var y = 300;
	
		if(y < (screen.availHeight - 20) )str3="scrollbars=no,status=no,resizable=yes,width="+x+",height="+y+",left="+(screen.availWidth-x)/2+",top="+(screen.availHeight-y)/2;
		else str3="scrollbars= yes,width="+x+",height="+ (screen.availHeight - 50)  +",left="+(screen.availWidth-x)/2+",top= 10";	
		newWindow = window.open("","newWindow",str3);
		newWindow.document.open();
		newWindow.resizeTo( (x/1+20), (y/1+110) );
		newWindow.document.write('<html><title> '+name+'</title><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="stylesheet" href="/css/popup_style.css" type="text/css"></head> <body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" class="content">');  


		newWindow.document.write('<form action="/sendMail.php?lang_link='+lang_link+'&email_id='+email_id+'" method="POST" enctype="multipart/form-data"  style="margin:20px;">');
		newWindow.document.write('<h1>'+title+'</h1>');
		newWindow.document.write('<strong>e-mail:</strong><br>');
		newWindow.document.write('<input type="text" name="email" class="form">');
		newWindow.document.write('<br>');
		newWindow.document.write('<strong>имя:</strong><br>');
		newWindow.document.write('<input type="text" name="name" class="form">');
		newWindow.document.write('<br>');
		newWindow.document.write('<strong>вопрос:</strong><br>');
		newWindow.document.write('<textarea name="text" rows="10" class="form" style="overflow:auto"></textarea>');
		newWindow.document.write('<br>');
		newWindow.document.write('<input type="reset" value="очистить" class="button"><input type="submit" onclik="document.close();" value="отправить" class="button">');
		newWindow.document.write('</form>');
		newWindow.document.write('</body></html>');
		newWindow.document.close();
		newWindow.focus();
}

function show_img(src)
  {
   Img = new Image();
   Img.src = src;
   w = Img.width + 50;
   h = Img.height + 70;
   Img.align = 'top';
   popup = window.open(src, "popup", "top=60, left=60, width=" + w + ", height=" + h + ",toolbar=no,status=no,scrollbars=no,menubar=no,resizable=yes");
   popup.document.body.style.padding = 0;
   popup.document.body.style.margin = 0;
   popup.resizeTo(w,h);
   popup.focus();
   return false;
  }

function ShowPhoto(str,x,y,name,url){
	if (str=='') {
		newWindow = window.open(url,'mywindow','width=800,height=600');
	} else{
		if(y < (screen.availHeight - 20) )str3="scrollbars=no,status=no,resizable=yes,width="+x+",height="+y+",left="+(screen.availWidth-x)/2+",top="+(screen.availHeight-y)/2;
		else str3="scrollbars= yes,width="+x+",height="+ (screen.availHeight - 50)  +",left="+(screen.availWidth-x)/2+",top= 10";	
		newWindow = window.open("","newWindow",str3);
		newWindow.document.open();
		newWindow.resizeTo( (x/1+20), (y/1+110) );
		newWindow.document.write('<html><title> '+name+'</title><head><meta http-equiv="content-type" content="text/html; charset=UTF-8" /><link rel="stylesheet" href="/css/popup_img.css" type="text/css"></head> <body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" >');  
		newWindow.document.write('<table border="0" cellspacing="0" cellpadding="0" align="center" height="100%"><tr><td align="center">');
		if (url=='') {		
			newWindow.document.write('<img src="'+str+'" width="'+x+'" height="'+y+'" alt="'+name+'" ></td></tr><tr><td align="center"><i>'+name+'</i>'); 
		} else {
			newWindow.document.write('<img border=0 src="'+str+'" width="'+x+'" height="'+y+'" alt="'+name+'" > </td></tr><tr><td align="center">'+name+''); 
		}
		newWindow.document.write('');
		newWindow.document.write('</td></tr></table></body></html>');
		newWindow.document.close();
		newWindow.focus();
	}
}

function setCookie(name, value)
         {
         //If name is the empty string, it places a ; at the beginning
         //of document.cookie, causing clearCookies() to malfunction.
         if(name != '')
            document.cookie = name + '=' + value;
         }

function getCookie(name)
         {
         //Without this, it will return the first value 
         //in document.cookie when name is the empty string.
         if(name == '')
            return('');
         
         name_index = document.cookie.indexOf(name + '=');
         
         if(name_index == -1)
            return('');
         
         cookie_value =  document.cookie.substr(name_index + name.length + 1, 
                                                document.cookie.length);
         
         //All cookie name-value pairs end with a semi-colon, except the last one.
         end_of_cookie = cookie_value.indexOf(';');
         if(end_of_cookie != -1)
            cookie_value = cookie_value.substr(0, end_of_cookie);

         //Restores all the blank spaces.
         space = cookie_value.indexOf('+');
         while(space != -1)
              { 
              cookie_value = cookie_value.substr(0, space) + ' ' + 
              cookie_value.substr(space + 1, cookie_value.length);
							 
              space = cookie_value.indexOf('+');
              }

         return(cookie_value);
         }

function clearCookie(name)
         {                  
         expires = new Date();
         expires.setYear(expires.getYear() - 1);

         document.cookie = name + '=null' + '; expires=' + expires; 		 
         }
         
function clearCookies()
         {
         Cookies = document.cookie;
         Cookie = Cookies;
         expires = new Date();
         expires.setYear(expires.getYear() - 1);

         while(Cookie.length > 0)
              {
              //All cookie name-value pairs end with a semi-colon, except the last one.
              Cookie = Cookies.substr(0, Cookies.indexOf(';'));
              Cookies = Cookies.substr(Cookies.indexOf(';') + 1, Cookies.length);

              if(Cookie != '')
                 document.cookie = Cookie + '; expires=' + expires;
              else
                 document.cookie = Cookies + '; expires=' + expires;			  			  	  
              }		 		 
         }
         
function setBASKET(name){  /* goods */
	var expdate = new Date ();
	FixCookieDate (expdate); // Correct for Mac date bug - call only once for given Date object!
	expdate.setTime (expdate.getTime() + (3 * 60 * 60 * 1000)); // 2 hrs from now 
	    
	if (document.getElementById('i'+name).checked == true)
   {
	  	SetCookie('basket['+name+']', 1, expdate, '/');
	} else {
   	DeleteCookie('basket['+name+']', '/');
 	}
}

-->
