/*ver=parseInt(navigator.appVersion)
ie4=(ver>3  && navigator.appName!="Netscape")?1:0
ns4=(ver>3  && navigator.appName=="Netscape")?1:0
ns3=(ver==3 && navigator.appName=="Netscape")?1:0
*/

//music
function MM_controlSound(x, sndObj) { //v3.0
 if (ie4) document.all[sndObj+'_ie'].src='sound/'+sndObj+'.mp3';
 if ((ns4||ns3)
  && navigator.javaEnabled()
  && navigator.mimeTypes['audio/x-midi']
  && self.document.sndObj.IsReady()
 )
 {
  self.document.sndObj.play()
 }
}

       
//no resize window
function noMax(width, height, left, top) {
        window.moveTo(left, top);
        window.resizeTo(width, height);
}

function SaveVarAsFile(someVar){
  SaveFrame.document.open("text/html","replace")
  SaveFrame.document.write('someVar')
  SaveFrame.document.close()
  SaveFrame.focus()
  SaveFrame.document.execCommand('SaveAs',true,'opportunity.html')
}

//change images
function graphON(graphName) {      
        on=eval(graphName + ".src");
        document.images[graphName].src=on;
}

function graphOFF(graphName) {
        off=eval(graphName + "_.src");
        document.images[graphName].src=off;       
}
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'Denis', 'title=denis,location=no,directories=no,status=no,menubar=no,scrollbar=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
	var speed = 50; // in milliseconds
	var count = new Number(0); // ongoing count
	var resetCount = new Number(350); // reset the scroll
	if( document.layers ) { // netscape resets too early
		resetCount += 50;
	}
	
	function go() {
		scrollNow = window.setInterval("doScroll(1)",speed)
	}
	
	function doScroll(vertAmount) {
		count++;
		scrollBy(0,vertAmount);
		if( count == resetCount ) { // return to top, Need to play with the count number
			scrollTo(0,0);
			count = 0;
		}
	}
	
	function pause() {
		window.clearInterval(scrollNow);
	}
	var speed = 50; // in milliseconds
	var count = new Number(0); // ongoing count
	var resetCount = new Number(600); // reset the scroll
	if( document.layers ) { // netscape resets too early
		resetCount += 50;
	}
	
	function go() {
		scrollNow = window.setInterval("doScroll(1)",speed)
	}
	
	function doScroll(vertAmount) {
		count++;
		scrollBy(0,vertAmount);
		if( count == resetCount ) { // return to top, Need to play with the count number
			scrollTo(0,0);
			count = 0;
		}
	}
	
	function pause() {
		window.clearInterval(scrollNow);
	}
function eIn(o) {
if (document.all && document.all[o]!=null)  document.all[o].style.display = "block" ;

}
function eOut(o) {
if (document.all && document.all[o]!=null) document.all[o].style.display='none';
}
function printpreview(headstr) {
	if ( !document.all ) {
		alert("Ecaeieoa,\nii ae\y a?aoca?a Netscape yoa aicii?iinou iiea ia ?aaeeciaaia.");
	} else if (document.images) {
		var NW1=open("", "nw", "");
		NW1.document.open();
		NW1.document.write( "<html><head><title>"+ headstr + "</title><link href='styles.css' rel='stylesheet' type=\"text/css\"></head><body>" + headstr + "<br>\n" );
		NW1.document.write( document.all["cnt"].outerHTML );
		NW1.document.write( "<OBJECT ID=\"idWBPrint\" WIDTH=0 HEIGHT=0 CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"></OBJECT>" );
		NW1.document.write( headstr+"</body></html>" );
		NW1.document.close();
		NW1.focus();
		NW1.execScript("on error resume next: idWBPrint.ExecWB 6, 2", "VBScript");
		NW1.idWBPrint.outerHTML = "";
		//NW1.close();
	}
}
function addFavorite(URLStr,NamePage)
{
 if (navigator.appName=="Netscape") {
   alert("К сожалению ваш браузер не поддерживает эту функцию. Нажмите клавиши 'Ctrl+D'");
 } else {
   window.external.AddFavorite(URLStr,NamePage);
 }
}
