function zoom(id,pnum)
{
var CWIN=window.open("top.php?id="+id+"&pnum="+pnum,"wpictures","top=250,left=450,width=1,height=1,titlebar=1,toolbars=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,border=1");
//CWIN.document.open()
//CWIN.document.write(mhtml)
//CWIN.document.close();
CWIN.focus();
}// function zoom();

function zoomcontest(cid,uid)
{
var CWIN=window.open("topcontest.php?cid="+cid+"&uid="+uid,"wpictures","top=250,left=450,width=1,height=1,titlebar=1,toolbars=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,border=1");
//CWIN.document.open()
//CWIN.document.write(mhtml)
//CWIN.document.close();
CWIN.focus();
}// function zoom();

function zoomURL(url,MYtitle)
{
t=url;
var CWIN=window.open("","wpictures","top=250,left=450,width=1,height=1,titlebar=1,toolbars=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,border=1")
mhtml="<HTML><HEAD>\n";
mhtml+="<TITLE>"+MYtitle+"</TITLE>\n";
mhtml+="<SCRIPT LANGUAGE=\"JavaScript\">\n";
mhtml+="function resy()\n{\n";
mhtml+="w=parseInt(document.images['myimg1'].width)+30;\n";
mhtml+="h=parseInt(document.images['myimg1'].height)+200;\n";
mhtml+="mydiv=document.getElementById('holder');\n";
mhtml+="mydiv.style.width='100%';\n";
mhtml+="mydiv.style.height='100%';\n";
mhtml+="mydiv.style.overflow='auto';\n";
mhtml+="if (w>1024) w=1024;\n";
mhtml+="if (h>768) h=768;\n";
mhtml+="window.resizeTo(w,h);\n";
mhtml+="}\n";
mhtml+="</SCRIPT>\n</HEAD>\n";
mhtml+="<body bgcolor='#ffffff' topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 border=0 onload='resy();'>";
mhtml+="<div id='holder' style='padding:10px;'><a href='javascript:window.close()' title='"+MYtitle+"'><img name='myimg1' id='myimg1' src='"+t+"' border=0 alt='Close window'></a><hr><p style='font-family:Tahoma,Verdana,Arial;font-size:12px;color:green;text-align:justify;'>"+MYtitle+"</p></div>\n";
mhtml+="</body>\n</HTML>";
CWIN.document.open()
CWIN.document.write(mhtml)
CWIN.document.close();
CWIN.focus();
}// function zoom();

//--------------------------------------------------------
function zoomIn(o)
{
	url=o.src;
	MYtitle=o.alt;
	if (MYtitle=="")
	{
		MYtitle=o.title;
	}
	zoom(url.replace("thumb/",""),MYtitle);
}//function zoomIn(o)
//---------------------------------------------------------


//--------------------------------------------------------
function zoomObj(o)
{
	url=o.src;
	MYtitle=o.alt;
	if (MYtitle=="")
	{
		MYtitle=o.title;
	}
	if (strpos(url,"thumb/",0)!==false)
	{
		url=url.replace("thumb/","");
	}
	//alert(url);
	zoomURL(url,MYtitle);
}//function zoomIn(o)
//---------------------------------------------------------

function strpos (haystack, needle, offset) 
{
    // Finds position of first occurrence of a string within another  
    // 
    // version: 909.322
    // discuss at: http://phpjs.org/functions/strpos    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Onno Marsman    
    // +   bugfixed by: Daniel Esteban
    // *     example 1: strpos('Kevin van Zonneveld', 'e', 5);
    // *     returns 1: 14    
	var i = (haystack+'').indexOf(needle, (offset ? offset : 0));
    return i === -1 ? false : i;
}