function OpenWin(theURL,winName,w,h) { //v2.0
prop= "width="+w+",height="+h+",scrollbars=1,resizable=1";
NewWin = window.open(theURL,winName,prop);
NewWin.focus()
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function SwapImage(Imgname,ImgFile){
oldname=Imgname;
oldimg=document.images[Imgname].src;
document.images[Imgname].src=ImgFile
}

function SwapImgRestore() { //v3.0
document.images[oldname].src=oldimg;
}

function GoWeb(weblink){
var mess='Для открытия ссылки необходимо подключение к интернет.\n Желаете начать просмотр страницы?'
var is_confirmed = confirm(mess);
if (is_confirmed) {
	theURL='http://'+weblink
	if(theURL.indexOf('?')!=-1){
	theURL=theURL+'&cd='+cdinfotit
	}else{
	theURL=theURL+'?cd='+cdinfotit
	}
NewWin = window.open(theURL,'','');
}
}

function GoOrder(a1,a2){
id='5'+a2.substring(0,4)+a2.substring(5,a2.length);
GoWeb('www.homeplans.ru/myhomeplans/index.php?info=choice_compl&project_id='+id)
}

function Blink(idlink){
document.getElementById(idlink).href=document.getElementById(idlink).href+'?'+backlink;
}

function PicPrjOpen(w,h,pic){
n=pic.split("/");
namewin=n[3].replace(/-/g,'');
namewin=namewin.replace(/\./g,'');
prop="width="+w+",height="+h+",scrollbars=1,resizable=1,menubar=0,status=0,toolbar=0";
NewWin = window.open('pictures_prj.html?'+pic,namewin,prop);
}

function PicOpen(w,h,pic){
n=pic.split("/");
namewin=n[3].replace(/-/g,'');
namewin=namewin.replace(/\./g,'');
prop="width="+w+",height="+h+",scrollbars=1,resizable=1,menubar=0,status=0,toolbar=0";
NewWin = window.open('../pictures.html?'+pic,namewin,prop);
}


function PlanOpen(w,h,pic){
prop="width="+w+",height="+h+",scrollbars=1,resizable=1,menubar=0,status=0,toolbar=0";
NewWin = window.open('../plans.html?'+pic,'plans',prop);
}

function FasadOpen(w,h,pic){
prop="width="+w+",height="+h+",scrollbars=1,resizable=1,menubar=0,status=0,toolbar=0";
NewWin = window.open('../fasad.html?'+pic,'fasad',prop);
}
