
function gotoprices(){
	markvalue = document.all("mark").value
	typepricesvalue = "";
	for (i=0; i<document.all("typeprices").length; i++) {
		if (document.all("typeprices")[i].checked){
			typepricesvalue = document.all("typeprices")[i].value;
			break
		}
		
	}
	if ((typepricesvalue != "") && (markvalue != "")){
		filename = "/prices" + typepricesvalue + markvalue
		if (typepricesvalue == "dealer") {
			filename += ".php"
		} else {
			filename += ".html"
		}
		location.href = filename;
	} else {
		//a("Пожалуйста, уточните Ваш выбор.")
	}
}


/*
 *** common functions *****************************************************
 */
function a(p){																/* global */
	if (p == null){															/* global */
		alert("* NULL *")													/* global */
	} else {																/* global */
		alert(p)															/* global */
	}																		/* global */
}																			/* global */



/* * * 
 *	functions "hlImageOn" and "hlImageOff"
 *		<div id="imgpanel" name="imgpanel" style="position: absolute; top: 10px; left: 10px; visibility: visible; z-index: 100;">
 *			<a href="" onMouseOver="hlImageOn('mImg', 'imgpanel')" onMouseOut="hlImageOff('mImg', 'imgpanel')"><img src="/img/mimgm.gif" name="mImg" id="mImg" border="0" width="10" height="10" alt=""></a> 
 *		</div>
 *		 - если картинка находится в отдельном слое, то для NC нужно указывать еще и название слоя
 *		 - если слоя нет, то передать "" (обязательно для nc  /  или опустить параметр)
 *			
 *			iName = (nc) ? eval("document.toolspanel.document." + iName + ".src") : eval(iName + ".src")
 *			iName = (nc) ? eval("document.toolspanel.document.images." + iName + ".src") : eval(iName + ".src")
 *			iName = (nc) ? document.toolspanel.document.eval(iName).src : eval(iName + ".src")
 *
 *			
 *				img01 = new Image();
 *				img01.src = "img/img01.jpg";
 *			imgOver = eval ("img" + num + ".src");
 *			document.images['imageonpage'].src = imgOver;
 *
 *		картинка подсветки обязательно должна быть такого же размера и назваться так же, только перед расширением должна стоять буква "a": mimg.gif -> mimga.gif
 *		расширение должно быть только из 3 символов: gif, jpg ...
 *	(Subbotin)
 * * */

function hlImageOn (iName, lName) {
	iName = getObject (iName, lName)
	iPath = iName.src
	iName.src = iPath.slice(0, iPath.length-4) + "a" + iPath.slice(iPath.length-4, iPath.length)
}
function hlImageOff (iName, lName) {
	iName = getObject (iName, lName)
	iPath = iName.src
	iName.src = iPath.slice(0, iPath.length-5) + iPath.slice(iPath.length-4, iPath.length)
}
function getObject (iName, lName) {
	if (nc) {
		if ((lName != "") || (lName != null)) {
			iName = document.eval(lName).document.eval(iName)
		} else {
			iName = document.eval(iName)
		}
	} else {
		iName = eval(iName)
	}
	return iName;
}



/* * *
 *	function openPopupWindow()
 *	Open new window 'popup'
 *  expparams - "scroll=yes|no" - esli prametr ne ukazan, to scroll = no
 *  expparams - "width=~num;height=~num;" 		- obyazatel'no d.b. ";" (po nemu opredelyaetsya konec chisla);			esli parametri ne ukazani - to znacheniya budut ravni popupWindowWidth i popupWindowHeight - min parametri okoshka;			esli ukazan parametr previshayushiy razmer ekrana, to razmer okna stanovitsya razmerom s okno i poyavl scroll
 *	Example: <a href="#" onClick="openPopupWindow('/about.html','scroll=no;')">
 *	Example: <a href="#" onClick="openPopupWindow('/about.html','scroll=no;width=400;height=300;')"> 
 *	last updated: 11/09/2002;  / /2002
 *	for navigators: IE 5.0, 
 *	bugs: pri ekrane 800*600 scroll nempnogo zahodit za predeli ekrana, okno ne centriruetsya (yavno vidno), i navernoe ne idet v krayniy leviy-verhn ugol esli bolshoe okno
 *	(Subbotin)
 * * */

function openPopupWindow(url,expparams){

	screenWidth = screen.width;
	screenHeight = screen.height;

	scrollvalue = "no"
	if (expparams!=null) {
		if (expparams.indexOf('scroll') != -1){
			scrollpos = expparams.indexOf('scroll')
			scrollvalue = expparams.substring(scrollpos+7,scrollpos+9)
			if (scrollvalue.indexOf('ye') != -1){
				scrollvalue = "yes"
			} else if (scrollvalue.indexOf('no') != -1){
				scrollvalue = "no"
			}
		}
	}

	popupWindowLeft = -1 															//dlya proverki potom
	popupWindowTop = -1
	if (expparams!=null) {
		widthPos = expparams.indexOf('width');
		heightPos = expparams.indexOf('height');
		if (widthPos != -1){
			strAfterWidth = expparams.substring(widthPos+6, expparams.length)			//'scroll=no;width=400;height=300;' -> '400;height=300;'
			popupWindowWidth = strAfterWidth.substring(0, strAfterWidth.indexOf(';'))	//'400;height=300;' -> '400'
			popupWindowWidth = parseInt(popupWindowWidth)								//'400' -> 400
			if (popupWindowWidth > screenWidth) {										//'10000' -> '2048'
				popupWindowWidth = screenWidth
				popupWindowWidth += -25													//tsifra vzyata naugad, zavisit ot shirini browser_bordera
				scrollvalue = "yes"
				popupWindowLeft = 0;
			}
		} else {
			popupWindowWidth = 608;														//(need screen size = 608)
		}
		if (heightPos != -1){
			strAfterHeight = expparams.substring(heightPos+7, expparams.length)				//'scroll=no;width=400;height=300;' -> '300;'
			popupWindowHeight = strAfterHeight.substring(0, strAfterHeight.indexOf(';'))	//'300;' -> '300'
			popupWindowHeight = parseInt(popupWindowHeight)									//'300' -> 300
			if (popupWindowHeight > screenHeight) {											//'10000' -> '1024'
				popupWindowHeight = screenHeight
				popupWindowHeight += -80													//tsifra vzyata naugad, zavisit ot visoti WinToolbara i browser_bordera
				scrollvalue = "yes"
				popupWindowTop = 0;
			}
		} else {
			popupWindowHeight = 501;													//(min screen size = 501)
		}
	} else {
		popupWindowWidth = 608;														//(need screen size = 608)
		popupWindowHeight = 501;													//(min screen size = 501)
	}

	if (popupWindowLeft == -1) {
		popupWindowLeft = screenWidth/2 - popupWindowWidth/2								//place window in center by X(!)
	}
	if (popupWindowTop == -1) {
		popupWindowTop = screenHeight/2 - popupWindowHeight/2								//place window in center by Y(!)
	}

	if (scrollvalue == "yes"){
		popupWindowWidth += 16
	}


	var wndName = "IsolonPopupWindow"
	var wndFeatures = "toolbar=no,location=no,directories=no,status=no,menubar=no,width=" + popupWindowWidth + ",height=" + popupWindowHeight + ",top=" + popupWindowTop + ",left=" + popupWindowLeft + ",resizable=no,scrollbars=" + scrollvalue;

	popupWindow = window.open('',wndName,wndFeatures);
	popupWindow.focus();
	popupWindow = window.open(url,wndName,wndFeatures);

	return;
}


/* * *
 *	function openPopupWithImage()
 *	Open new window 'popup' with image
 *
 *  use other function from rscc-Ilya
 *	(Subbotin)
 * * */

function openPopupWithImage(url, popupWindowWidth, popupWindowHeight){

	screenWidth = screen.width;
	screenHeight = screen.height;

	popupWindowTop = (screenWidth <= 800) ? 0 : (screenWidth/2 - popupWindowWidth/2)		//place window in center by X
	popupWindowLeft = (screenWidth <= 800) ? 0 : (screenHeight/2 - popupWindowHeight/2)		//place window in center by Y

	var wndName = "IsolonPopupWindow"
	var wndFeatures = "toolbar=no,location=no,directories=no,status=no,menubar=no,width=" + popupWindowWidth + ",height=" + popupWindowHeight + ",top=" + popupWindowTop + ",left=" + popupWindowLeft + ",resizable=no,scrollbars=no";
	
	//a(popupWindowTop+" - "+popupWindowLeft)

	popupWindow = window.open('',wndName,wndFeatures);
	popupWindow.focus();
	popupWindow = window.open(url,wndName,wndFeatures);

	return;
}


/* * *
 *	Show Tips
 *	from http://leechy.design.ru/tt2/
 *	(Leechy)
 * * */

lyr=null;
xOs=-12;
yOs=-74;
xOsFake=-2;
yOsFake=17;

function moveLyr(lyrObj,x,y) {
	lyrObj.top = y;
	lyrObj.left = x;
}

function mouseMove(e) {
	if (lyr) moveLyr(lyr,event.x + xOs + document.body.scrollLeft,event.y + yOs + document.body.scrollTop);
}
function mouseMoveFake(e) {
	if (lyr) moveLyr(lyr,event.x + xOsFake + document.body.scrollLeft,event.y + yOsFake + document.body.scrollTop);
}

function showTip(which,MPX,MPY) {
	lyr = document.all[which].style;
	moveLyr(lyr,MPX + xOs + document.body.scrollLeft,MPY + yOs + document.body.scrollTop);
	document.onmousemove = mouseMove;
	lyr.visibility = "visible";
}
function showTipFake(which,MPX,MPY) {
	lyr = document.all[which].style;
	moveLyr(lyr,MPX + xOsFake + document.body.scrollLeft,MPY + yOsFake + document.body.scrollTop);
	document.onmousemove = mouseMoveFake;
	lyr.visibility = "visible";
}

function hideTip(which) {
	document.all[which].style.visibility = "hidden";
	lyr=null;
}


/* * *
 *	(Nemo)
 * * */
function replaceSome(tt) {
	myRe0 = new RegExp('href="[a-z0-9/]+\.html"', 'g');
	myRe1 = new RegExp('<IMG height=118 alt="" src="/img/1x1.gif" width=1><BR>', '');
	
	midStr0 = tt.replace(myRe0, "href='#' onclick='return false;'");
	midStr1 = midStr0.replace(myRe1, " ");
	
	newStr = midStr1
	return newStr;
}

function prnWin() {
	if (!document.layers) {
		pageTitle = document.title;
		whatToPrint = document.getElementById("content");
		innerCon = whatToPrint.innerHTML;
		printCon = replaceSome(innerCon);
		
		s = 'resizable=no,menubar=yes,location=no,toolbar=yes,status=no,scrollbars=yes,width=' + 700 + ',height=' + 600;

	    var secWnd = window.open('', '', s);
		with (secWnd) {
			document.write("<HTML>\n<head>\n<title>" + pageTitle + "</title>\n<link href=\"/include/css/general.css\" rel=\"stylesheet\" type=\"text/css\">\n<link href=\"/include/css/general_ie.css\" rel=\"stylesheet\" type=\"text/css\">\n</head>\n");
			document.write("<body bgcolor=\"#DDEAF6\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n");
			document.write(printCon);
			document.write("\n</body>\n");
			document.write("</html>");
		}
	}
	return false;
}

 
 

/*
 *** initialization *******************************************************
 */
var isDocLoaded = false;													/* global */
ie = (document.all)? true : false;											/* global */
nc = (document.layers)? true : false;										/* global */
browser = (document.layers)? "nc" : "ie";									/* global */
function doWhenDocLoaded(){													/* global */
}																			/* global */
isDocLoaded = true;															/* global */
/* ********************************************************************* */


