// window opener function
function link2fr(pid,act) {
	document.write('<a href="mailto:e-mail?subject=' + pid + '&nbsp;-&nbsp;' + act + '&body='
    	+ location.href + '&nbsp;-&nbsp;' + pid + '&nbsp;' + act + '" '
        + 'onMouseOver="self.status=\'Отправить ссылку на эту страницу другу\'; return true;" '
        + 'onMouseOut="self.status=\'\'; return true;"><b>Отправить ссылку другу</b></a>');
}
function sh_img(pid,act) {
	did = "d" + pid;
	if (act == '1') {
       	document.all(pid).style.display = "none";
       	document.all(did).style.display = "block";
    }
    else {
       	document.all(did).style.display = "none";
       	document.all(pid).style.display = "block";
    }
}
function set_filter (text) {
	
    document.forms["zod_form"].elements["pid"].value=text;
    document.forms["zod_form"].submit();
}
function popwin(URL, name, w, h)
{
   var winl = (screen.width - w) / 2;
   var wint = (screen.height - h) / 2;
	window.open(URL, name, "width="+w+", height="+h+", status=yes, scrollbars=yes, resizable=no, menubar=no, toolbar=no, left="+winl+", top="+wint);
}
function bag_link(link) {
	document.location.href = link;
}
function winopen (popupURL,width,height) {
        var popup = window.open(popupURL,"popup",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=' + width + ',height=' + height );
        popup.focus();
        if( navigator.appName.substring(0,8) == "Netscape" ) {
                popup.location = popupURL;
        }
}
function winopen_mess (popupURL,width,height) {
        var popup = window.open(popupURL,"popup",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=' + width + ',height=' + height );
        popup.focus();
        if( navigator.appName.substring(0,8) == "Netscape" ) {
                popup.location = popupURL;
        }
}
function loadpage(urla,fram,pid,ses,brend,sex,collection,pnum){
    window.frames[fram].document.location = urla + "?pid=" + pid + "&SESSION=" + ses;
    document.all.bag.scrollTop = 0;
    takethat(brend,sex,collection,pnum);
}
function takethat(brend,sex,collection,pnum) {
        var popupURL = "/basket.php?brend=" + brend + "&sex=" + sex + "&collection=" + collection + "&pgnum=" + pnum;
        var popup = window.open(popupURL,"popup",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=200,height=60');
        popup.focus();
        if( navigator.appName.substring(0,8) == "Netscape" ) {
                popup.location = popupURL;
        }
}
function sub_zakaz(){
    document.forms["pre_zakaz"].ac.value=0;
    document.forms["pre_zakaz"].submit();
}
function sub_del(id){
    document.forms["pre_zakaz"].ac.value=1;
    document.forms["pre_zakaz"].itemid.value=id;
    document.forms["pre_zakaz"].submit();
}
function sub_ch(){
    document.forms["pre_zakaz"].ac.value=2;
    document.forms["pre_zakaz"].submit();
}

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