// JavaScript Document

function roll(a) {
	a.style.cursor='pointer';
	if (a.className.substr((a.className.length-1),1) == 'n') {b='o';}
	else {b='n';}
	a.className=a.className.substr(0,(a.className.length-1))+b;
}

function rollId(a) {
	a.style.cursor='pointer';
	if (a.id.substr((a.id.length-1),1) == 'n') {b='o';}
	else {b='n';}
	a.id=a.id.substr(0,(a.id.length-1))+b;
}

function rollimg(a) {
	a.style.cursor='pointer';
	ext = a.src.substr((a.src.length-4),4);
	state = a.src.substr((a.src.length-6),2);
	if (state == '_o')
		a.src=a.src.substr(0,(a.src.length-6))+ext;
	else
		a.src=a.src.substr(0,(a.src.length-4))+'_o'+ext;
}

function popPic(){
}

function activate_objects(){
var strBrowser = navigator.userAgent.toLowerCase();
//if(strBrowser.indexOf("msie") > -1 && strBrowser.indexOf("mac") < 0){
  var theObjects = document.getElementsByTagName('object');
  var theObjectsLen = theObjects.length;
  var theFlashVars = new Array();

q=-1;

var theFlashVars = new Array();
var theParams = theObjects[0].getElementsByTagName("param");
var theParamsLength = theParams.length;
for (var j = 0; j < theParamsLength; j++) {
	if (theParams[j].name.toLowerCase() == 'movie'){q++}
	if(theParams[j].name.toLowerCase() == 'flashvars'){
		theFlashVars[q] = theParams[j].value;
		//document.getElementById('debug').innerHTML += 'object['+i+']: '+theParams[j].value + '<br>';
      }
    }
document.getElementById('debug').innerHTML += theFlashVars[0] + '<br><br>';
document.getElementById('debug').innerHTML += 'Objects: '+ theObjectsLen + '<br>';
  for (var i = 0; i < theObjectsLen; i++) {
  //for (var i in theObjects){
   if(theObjects[i].outerHTML){
    if(theObjects[i].data){
     theObjects[i].removeAttribute('data');
    }
/*
	var theParams = theObjects[i].getElementsByTagName("param");
    var theParamsLength = theParams.length;
document.getElementById('debug').innerHTML +=  '<br>'+theParams.length+'<br>';   
    for (var j = 0; j < theParamsLength; j++) {
      //document.getElementById('debug').innerHTML +=  '<br>--->'+theParams[j].name+'<br>';
      if(theParams[j].name.toLowerCase() == 'flashvars'){
        var theFlashVars = theParams[j].value;
document.getElementById('debug').innerHTML += 'object['+i+']: '+theParams[j].value + '<br>';
      }
    }
*/    
    var theOuterHTML = theObjects[i].outerHTML;
    var re = /<param name="FlashVars" value="">/ig;
    theOuterHTML = theOuterHTML.replace(re,"<param name='FlashVars' value='" + theFlashVars[i] + "'>");
    theObjects[i].outerHTML = theOuterHTML;
   }
  //}
}


window.onunload = function() {
 if (document.getElementsByTagName) {
  var objs = document.getElementsByTagName("object");
  for (i=0; i<objs.length; i++) {
   objs[i].outerHTML = "";
  }
 }
}


}

var picWin;
function showImg(a) {
	if (typeof(picWin) != 'undefined' && !(picWin.closed)) {picWin.close();}
	picWin = window.open('','picWin','scrollbars=1,menubar=0,left=0,top=0,width=300px,height=300px,dependent=1,resizable=0', replace=1);
	picWin.document.open();
	picWin.document.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>image popup</title>');
	picWin.document.write('<style type="text/css">body{background-color:#FFF8EA;background-image:url(images/background.gif);margin:0px;}.text{font-family: Arial, Helvetica, sans-serif;font-size:12px;color:#660000;text-align:center;}.load{font-family:Arial,Helvetica,sans-serif;font-size:12px;font-weight:bold;color:#CCCCCC;width:80px;text-align:left;}.hide{display:none;}.show{display:;}</style>');
	picWin.document.write('</head><body onLoad="checksize();"scroll=yes>');
	picWin.document.write('<script language=javascript>document.oncontextmenu=new Function("return false");function checksize(){if(document.images[0].complete){document.getElementById("load").className="hide";document.getElementById("show").className="show";h=document.images[0].width+40;v=document.images[0].height+110;if(h>(screen.availWidth-10)){h=screen.availWidth-10;document.body.scroll="yes";}if(v>(screen.availHeight-20)){v=screen.availHeight-20;document.body.scroll="yes";}window.resizeTo(h,v);window.focus();}else{setTimeout("checksize()",250)}}</script>');
	picWin.document.write('<table width="100%" height="100%"  border="0" cellpadding="0" cellspacing="0"><tr><td align="center" valign="middle"><div class="load" id="load">LOADING . . .</div><div class="hide" id="show"><img src="'+propImagesPop[a]+'"></div></td></tr></table></body></html>');
	picWin.document.close();
}


function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function popUpGallery(){
	imageList = new Array;
	current_image = 0;
	total_images = 0;
	for(var i=0; i<arguments.length; i++){
	  imageList[i] = arguments[i];
	  total_images++;
	  }
	document.getElementById('popUpGallery_Container_main').style.display = 'block';
	resizeDiv();

	document.getElementById('popUpGallery_Container').style.top = document.body.scrollTop;

	document.getElementById('image_holder').src=imageList[0];
	document.getElementById('current_total').innerHTML =1+' от '+total_images;
}
function prev_next (target){
	if ((target.id == 'next') && (current_image < total_images-1)){current_image++;}
	if ((target.id == 'prev') && (current_image > 0)){current_image--;}
	document.getElementById('image_holder').src=imageList[current_image];
	document.getElementById('current_total').innerHTML =(current_image+1)+' от '+total_images;
}
function resizeDiv() {
	if (navigator.appName == 'Netscape') {
		document.getElementById('popUpGallery_Container_main').style.height = document.height;
	}
	else {
		document.getElementById('popUpGallery_Container_main').style.height = document.body.scrollHeight;
	}
}
function closeDiv() {
	document.getElementById('image_holder').src='';
	document.getElementById('popUpGallery_Container_main').style.display = 'none';
}
