function ShowPhoto(photoname, w, h) {
	url = "/showphoto.php?img="+photoname;
	h += 70;
	if (h > 600) {
		h = 600
	}
	w += 40;
	Win=window.open(url, 'viewPhoto',  'toolbar=0,scrollbars=1,location=0,directories=0,status=0,menubar=0,resizable=1,width='+w+',height='+h+',border=thin,top=50,left=50,help=0');
	Win.focus();
}

function CheckEmail(e){
	e = e.toLowerCase();
	var ch="@";
	var count=0;
	var error=false;
	
	for (var i=0; i<e.length; i++){
		if(e.charAt(i)==ch || e.charAt(i)=="."){
			error = (count==0) ? true : error;
			ch = (ch==".") ? 0 : ch;
			ch = (e.charAt(i)=="@") ? "." : ch;
			count=0;
			continue;
		}
		count++;
	
		if((e.charAt(i)<"a" || e.charAt(i)>"z") && (e.charAt(i)<"0" || e.charAt(i)>"9") && e.charAt(i)!="_" && e.charAt(i)!="-"){
			error = true;
			break;
		}
	}
	error = (count==0) ? true : error;
	error = (ch==0) ? error : true;
	return !error;
}

function loadFlash(f,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,29,0" width="'+w+'" height="'+h+'">');
document.write('<param name="movie" value="'+f+'">');
document.write('<param name="quality" value="high">');
document.write('<param name="wmode" value="opaque">');
document.write('<embed src="'+f+'" width="'+w+'" height="'+h+'" quality="high" wmode="opaque" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>');
document.write('</object>');
}

