﻿// JavaScript Document

// подсветка
function hiLite(iName,iSrc) {
  iName.src = iSrc;
}

function openWindow(url) {
        newWindow = window.open(url,"newWind","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=660,height=520");
}


function openpict(pict) 
{ 
window.open(pict,"none","top=100, left=100, width=100, height=100, resizable=0","replace=yes") 
} 
 

 
function wopen(url,w,h){ 
eval('opened=window.open("","none","top=100, left=100, width="+w+", height="+h+", resizable=0","replace=yes")'); 
opened.document.open(); 
opened.document.write('<body leftmargin=0 topmargin=0><img src="'+url+'"></body>'); 
opened.document.close(); 
} 

function cls(){
window.close()
}
function dsc(){
document.add.submit()
window.close()
}


// замена картинок

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		id1_Layer_1_over = newImage("images/1_Layer-1-over.gif");
		preloadFlag = true;
	}
}


// Anti-Spam Email Displayer

var contacts=new Array()
//Specify text and corresponding email address.
//Use [at] and [dot] in place of "@" and "." for anti spam purpose:
contacts[0]=["написать письмо", "bcad_krasnodar[at]mail[dot]ru"]
contacts[1]=["mail", "bcad[at]propro[dot]ru"]
contacts[2]=["mail", "bcad[at]polysoft[dot]ru"]

//Specify caption text to display within SELECT menu. Only applicable if you're using the form option:
var dropmenucaption="CONTACT US FORM "

function displaycontact(emailarray, cssclass, displaymethod, extrainfo){
if (displaymethod=="text"){
document.write('<span class="' + cssclass + '">\n')
if (typeof emailarray[0]=="object"){ //if array passed consists of multiple elements
for (i=0; i<emailarray.length; i++){
var seperator=(i<emailarray.length-1)? extrainfo : ""
document.write('<a href="mailto:' + modifyemail(emailarray[i][1])+ '">'+ emailarray[i][0] + '</a>' + seperator)
}
}
else //else if it is a single array element
document.write('<a href="mailto:' + modifyemail(emailarray[1])+ '">'+ emailarray[0] + '</a>')
document.write('</span>')
}
else if (displaymethod=="form"){
document.write('<form>\n')
document.write('<select size="' + extrainfo + '" onChange="jumptooption(this)" class="' + cssclass + '">\n')
document.write('<option value="caption">' + dropmenucaption + '</option>\n')
for (i=0; i<emailarray.length; i++)
document.write('<option value="mailto:' + modifyemail(emailarray[i][1]) +'">' + emailarray[i][0] + ' </option>\n')
document.write('</select></form>\n')
}
}

function modifyemail(emailitem){
var modified=emailitem.replace(/\[at]/gi, "@")
modified=modified.replace(/\[dot]/gi, ".")
return modified
}

function jumptooption(themenu){
if (themenu.options[themenu.selectedIndex].value !="caption")
location=themenu.options[themenu.selectedIndex].value
}



