$(document).ready(function() {
	var GalleryArray = new Array();
	$("a.popup_image").each(function(i) {
		var im = new Image();
		im.src = this.href;
		GalleryArray[i] = im;
		}).
	fancybox({
		hideOnContentClick: true,
		overlayShow: true,
		overlayOpacity: 0.5,
		zoomSpeedIn: 500,
		zoomSpeedOut:600,
		padding: 0,
		zoomSpeedChange: 0
		});
	});

function Enlarge(what)
	{
	var splitted=what.split("_");
	//alert(splitted[0]);
	var win=window.open("","oUrl","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=600,height=450");
	win.document.write("<title>WATER DOCTOR</title><body style='margin:0'><table width=100% height=100% border=0 cellspacing=0 cellpadding=0><tr align=center><td><img width=600 height=450 src="+splitted[0]+".jpg border=0></tr></table></body>");

	}
	
function CheckForm () { 
	var What=new Array("name","phone","address");
	var Whatname=new Array("Ваше имя","телефон","адрес");
	var i=0;
	for(i=0;i<What.length;i++)
		{
		if (document.all[What[i]].value==""){
				alert("Пожалуйста введите "+Whatname[i]);
				document.all[What[i]].focus();
				return false;}
		}



/*
		 if(document.all[What[2]].value.length>0&&(document.all[What[2]].value.indexOf("@",0)==-1||document.all[What[2]].value.indexOf(".",0)==-1)) { 
				alert("Пожалуйста введите правильный "+Whatname[2]); 
				document.zakaz.email.focus();
				return false;
			}

*/

		 
		 document.zakaz.submit();
		 return true;
	 }
function LoadImg(event)
	{
	/*
	// Internet Explorer
	if (event.srcElement)
		{
		el = event.srcElement;
		}
	// Netscape and Firefox
	else if (event.target)
		{
		el = event.target;
		}
	if ("IMG" == el.tagName && ( el.className == 'popup_image' || el.src.indexOf('popup_image') != -1 ))
		{
		oUrl=el.src;
		Alt=el.alt;
		var what=oUrl.split("/");
		var wh="";

		for(i=0;i<what.length-1;i++)
			wh+=what[i]+'/';
		wh+='large/'+what[i];
	
		var win=window.open("/image.php?image="+wh+"&alt="+Alt,"oUrl","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=1,height=1");
	
		}
	while(el.tagName != "BODY" && el.tagName != "A")
		{
		el = el.parentNode;
		}
	
	if ( "A" == el.tagName && el.className == 'pods' )
		{
		event.returnValue=false;
		if (!event.srcElement)
			{
			event.preventDefault();
			}
		var win=window.open("http://admin.elplast.ru/pods.php?id="+el.type,"_blank","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=550,height=500");
		}
	*/
	}

function ChangeCursor(event)
	{
	// Internet Explorer
	if (event.srcElement)
		{
		el = event.srcElement;
		}
	// Netscape and Firefox
	else if (event.target)
		{
		el = event.target;
		}
	
	if ("IMG" == el.tagName )
		{
		if(el.src.indexOf('popup_image') != -1)
			el.style.cursor = 'pointer';
		}
	
	}
function Print()
	{
	var win=window.open("","_blank","toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=760,height=500");
	win.document.write("<html><head><link rel='stylesheet' type='text/css' href='/style.css'><link rel='stylesheet' type='text/css' href='http://admin.elplast.ru/common.css'><style>#h1_print{display:block;}</style></head><body style='padding:10px;'>"+document.getElementById("td_print").innerHTML+"</body></html>");
	}

function run_movie(arg,w,h) 
{ 
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="'+w+'" HEIGHT="'+h+'" id="'+arg+'" ALIGN=""><PARAM NAME=movie VALUE="'+arg+'.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent> <EMBED src="'+arg+'.swf"  quality=high wmode=transparent  WIDTH="'+w+'" HEIGHT="'+h+'" NAME="'+arg+'" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>'); 
} 

function LoadPods(event)
	{
	/*
	// Internet Explorer
	if (event.srcElement)
		{
		el = event.srcElement;
		}
	// Netscape and Firefox
	else if (event.target)
		{
		el = event.target;
		}
	
	if ( "A" == el.tagName && el.className == 'pods' )
		{
		event.returnValue=false;
		var win=window.open("http://admin.elplast.ru/pods.php?id="+el.type,"_blank","toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=550,height=500");
		}
	*/
	}
