function wind(w,h)
	{
	window.open("send.php", "window","location=0,toolbar=0,menubar=0,top=10,left=10,width="+w+",height="+h);
	}
	
	function out_popup(page,did,w,h,param)
	{
	var window_name ="window"+Math.floor(Math.random()*100)+1;
	window.open(page+"?version=popup&did="+did+"&"+param, window_name,"location=0,scrollbars=1,toolbar=0,menubar=0,top=10,left=10,width="+w+",height="+h);
	}
	
	function photos(id,w,h)
	{
	var width = 800;
	var left = parseInt( (document.body.clientWidth/2) - width/2 );
	
	window.open("popup_photos.php?idreport="+id, "window","width="+width+",height=600,top=50%,left="+left+",resizable=no,location=no,scrollbars=no,status=no,toolbar=no,directories=no");
	}
	
	function vote_result(id,w,h)
	{
	window.open("/modules/vote.php?vote_result="+id, "window","location=0,toolbar=0,menubar=0,top=10,left=10,width="+w+",height="+h);
	}
	
	function ch_checkbox_count(form_name,ch_name)
{
var count = 0;
t=document.forms[form_name].elements.length;
	for(i=0;i<t;i++)
		{
str=new RegExp(ch_name,"i");
regexp=str.test(document.forms[form_name].elements[i].name);
	if(regexp==true)
	{
		if(document.forms[form_name].elements[i].checked == true)
		{
		count++;
		}
	
	}
		}
		if(count == 1)
			return true;
		else
			return false
}

function img(image,url) 
{
var width = 800;
var left = parseInt( (document.body.clientWidth/2) - width/2 );

window.open("/show_img.php?did="+image+"&url="+url,"show_img","width="+width+",height=600,top=50%,left="+left+",resizable=no,location=no,scrollbars=no,status=no,toolbar=no,directories=no");
}

function video(video) 
{
var width = 496;
var left = parseInt( (document.body.clientWidth/2) - width/2 );
window.open("/show_video.php?did="+video,"show_img","width="+width+",height=500,top=50%,left="+left+",resizable=no,location=no,scrollbars=no,status=no,toolbar=no,directories=no");
}

function ch_checkbox_zero(form_name,ch_name)
{
var count = 0;
t=document.forms[form_name].elements.length;
	for(i=0;i<t;i++)
		{
str=new RegExp(ch_name,"i");
regexp=str.test(document.forms[form_name].elements[i].name);
	if(regexp==true)
	{
		if(document.forms[form_name].elements[i].checked == true)
		{
		count++;
		}
	
	}
		}
		if(count > 0)
			return true;
		else
			return false
}



function activateFlash(name, width, height, background, style, src, wmode) {

	var code = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" standby="Loading..." type="application/x-shockwave-flash" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" width="' + width + '" height="' + height + '"' + style + ' id="' + name + '">'+
	'<param name="movie" value="' + src + '"/>'+
	'<param name="quality" value="high"/>'+
	'<param name="allowScriptAccess" value="sameDomain"/>'+
	'<param name="scale" value="noscale" />'+
	'<param name="swliveconnect" value="true"/>'+
	'<param name="wmode" value="' + wmode + '">'+
	'<param name="bgcolor" value="' + background + '"/>'+
	'<embed src="' + src + '" width="' + width + '" height="' + height + '" quality="high" swLiveConnect="true" wmode="' + wmode + '" bgcolor="' + background + '" scale="noscale" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="sameDomain" name="' + name + '" />'+
	'</embed></object>';

	document.write(code);

}




function get_image(digit)
{
s_text = '';
	for(i=0; i < digit.length; i++)
	{
	s_text += '<img src="img/digits2/'+digit.substring(i,i+1)+'.gif" alt="'+digit.substring(i,i+1)+'">';
	}
return s_text;
}

