function del_confirm(page_url)
{
	if(confirm('Are you sure?'))
	{
		document.location.href = page_url;
	}
}
window.name = "main_wnd";
var wnd;
/*	function openWindow(url, wid, hei)
	{
		var lef = (screen.width - wid)/2;
		var to = (screen.height - hei)/2;
		window.open(url, 'new_window', 'scrollbar=yes,width='+wid+',height='+hei+',top='+to+',left='+lef+'');
		return false;		
	}
*/
function open_preview_window(pimg, wid, hei)
{
	var wnd_height = ((hei) ? hei : 600)+120;
	var wnd_width = ((wid) ? wid : 500)+60;
	var wnd_left = (screen.width - wid)/2;
	var wnd_top = (screen.height - hei)/2;

	var vphoto = window.open("","Bigphoto","location=no,menubar=no,personalbar=no,scrollbars=no,status=no,toolbar=no,width="+wnd_width+",height="+wnd_height+",left="+wnd_left+",top="+wnd_top);
	vphoto.document.write('<link rel="stylesheet" type="text/css" href="css/style.css">');
	vphoto.document.write('<body style="padding: 0 0 0 0;margin: 0 0 0 0;">');
	vphoto.document.write('<table cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor="#E5E5E5" style="border-collapse:collapse;height:100%">');
	vphoto.document.write('<tr><td align="center"><table cellpadding="5" cellspacing="5" border="0" class="picture_table"><tr><td>');
	vphoto.document.write("<img src=\""+pimg+"\" border='0'>");
	vphoto.document.write("</td></tr></table><br><a href='javascript:window.close();'><img src='/images/photo_close_icon.gif' border=0></a></td></tr></table></body>");
	vphoto.resizeTo(wnd_width, wnd_height);
	vphoto.document.close();
	vphoto.focus();
	return false;
	
}

function opew_window(page_url, wid, hei)
{
	var wnd_height = (hei) ? hei : 600;
	var wnd_width = (wid) ? wid : 500;
	var wnd_left = (screen.width - wid)/2;
	var wnd_top = (screen.height - hei)/2;
	if(wnd)
	{
		wnd = window.open(page_url, "preview_wnd", "location=no,menubar=no,personalbar=no,scrollbars=yes,status=no,toolbar=no,width="+wnd_width+",height="+wnd_height+",left="+wnd_left+",top="+wnd_top);
		wnd.focus();
	}
	else
	{
		wnd = window.open(page_url, "preview_wnd", "location=no,menubar=no,personalbar=no,scrollbars=yes,status=no,toolbar=no,width="+wnd_width+",height="+wnd_height+",left="+wnd_left+",top="+wnd_top);
	}
	return wnd;
}
function setSelectOptions(the_form, the_select, do_check)
{
    var selectObject = document.forms[the_form].elements[the_select];
    var selectCount  = selectObject.length;

    for (var i = 0; i < selectCount; i++) {
        selectObject.options[i].selected = do_check;
    } // end for

    return true;
}

function showerror() { 
	alert("Адрес электронной почты введен неправильно. "); 
}
 
function checkmail(elem) 
{ 
	txt=elem.value; 
	if (txt == "") { 
		//alert("Введите Адрес электронной почты."); 
		showerror();
		return(false) 
	} 
	if (txt.indexOf(".") == -1) { 
		//alert("Нет символа\".\""); 
		showerror();
		return(false) 
	} 
	dog = txt.indexOf("@"); 
	if (dog == -1) { 
		//alert("Нет символа\"@\"."); 
		showerror();
		return(false) 
	} 
	if ((dog < 1) || (dog > txt.length - 5)) { 
		showerror(); 
		return(false) 
	} 
	if ((txt.charAt(dog - 1) == '.') || (txt.charAt(dog + 1) == '.')) { 
		showerror(); 
		return(false) 
	} 
} 

// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 3000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var SlideShowPic = new Array(); // don't touch this
var ClubSlideShowPic = new Array(); // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

// =======================================
// do not edit anything below this line
// =======================================

var t;
var j_ClubSlideShow = 0;
var j_SlideShow = 0;
var preLoad;
var p;
function preload(img_id)
{
//	var Pic = SlideShowPic.length;
	var Pic = eval(img_id+"Pic");
	p = Pic.length;
	preLoad = new Array();
	for (i = 0; i < p; i++){
		if(Pic[i] == "" || Pic[i] == undefined)
			continue;
	   preLoad[i] = new Image();
	   preLoad[i].src = Pic[i];
	}
}

function runSlideShow(img_id)
{
	if(img_id == undefined)
		return;
	var j = eval("j_"+img_id);
	if(document.getElementById(img_id) == undefined)
	{
		return;
	}
	preload(img_id);
	if (preLoad.length == 0)
	{
		return;
	}
   if (document.all){
      document.getElementById(img_id).style.filter="blendTrans(duration=2)";
      document.getElementById(img_id).style.filter="blendTrans(duration=crossFadeDuration)";
      document.getElementById(img_id).filters.blendTrans.Apply();
   }
   while(preLoad[j] == undefined || preLoad[j].src == "")
   {
	   j = j + 1;
	   if (j > (p-1)) j=0;
   }
   document.getElementById(img_id).src = preLoad[j].src;
   if (document.all){
      document.getElementById(img_id).filters.blendTrans.Play();
   }
   j = j + 1;
   if (j > (p-1)) j=0;
	eval("j_"+img_id+" = "+j);
   t = setTimeout('runSlideShow("'+img_id+'")', slideShowSpeed);
}

function setBrand(cb)
{
	var str = new String(window.location.href);
	if(str.indexOf('&brand=') > 0)
	{
		str = str.substr(0, str.indexOf('&brand='));
	}
	window.location.href = str + '&brand=' + cb.options[cb.selectedIndex].value;
}
