Const Unvan="..:: SALON ANKARA ::.."
Function Parola_Olustur( nNoChars, sValidChars )
	Const szDefault = "abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVXYZ0123456789"
	Dim nCount
	Dim sRet
	Dim nNumber
	Dim nLength

	Randomize

	If sValidChars = "" Then
		sValidChars = szDefault		
	End If
	nLength = Len( sValidChars )
	
	For nCount = 1 To nNoChars
		nNumber = Int((nLength * Rnd) + 1)
		sRet = sRet & Mid( sValidChars, nNumber, 1 )
	Next
	Parola_Olustur = sRet	
End Function
'----------------------------------------------
Function MesajKontrolEt()
	Dim AForm
	Set AForm=Document.Form
	if Not Len(Trim(AForm.Kisi.Value))>0 Then
		Msgbox "Rumuz Alanını Boş Bırakmayınız!...",vbokonly+vbinformation,Unvan
		Exit Function
	End If
	if Not Len(Trim(AForm.Mesaj.Value))>0 Then
		Msgbox "Boş Mesaj Gönderilemez!...",vbokonly+vbinformation,Unvan
		Exit Function
	End If
	AForm.Submit
End Function
'--------------------------------------
Sub Yonlendir(URLs,fea)
	URLs= window.open(URLs,"Gecici")
End Sub
'------------------------------------------------
Function okEmail (emailaddress)
	Dim tmpEmail, i, x, y, z, bErr, tmpEmail2, objReg, objMatch

	bErr = False
	tmpEmail = Trim( emailaddress )
	tmpEmail = CStr( emailaddress )

	 ' --- minimum 8 characters in total...
	if len(tmpEmail) < 8 then
		okEmail = False
		Exit Function
	end if

	 ' --- check for illegal characters
	For i = 1 to Len(tmpEmail)
		tmpEmail2 = Mid( tmpEmail, i, 1 )
		Select Case tmpEmail2
			Case "(", ")", ";", ":", ",", "/", "'", chr(34), _
			     "~", "`", "!", "#", "$", "%", "^", "&", "*", _
			     "+", "=", "[", "]", "{", "}", "|", "\", "?", _
			     " ", "<", ">"
				okEmail = False
				Exit Function
			Case Else
		End Select
	Next

	 ' --- need an "@" in the email but only one is allowed
	If instr(tmpEmail, "@") then
		x = instr(tmpEmail, "@")
		y = instr(x + 1, tmpEmail, "@")
		On Error Resume Next
		y = CLng(y)
		If Err Then bErr = True Else bErr = False
		On Error GoTo 0
		If bErr Then
			okEmail = False
			Exit Function
		End If
		if y <> 0 then
			okEmail = False
			Exit Function
		end if
	Else
		okEmail = False
		Exit Function
	End If

	 ' --- at least one "." must come after the "@"
		tmpEmail2 = Right( tmpEmail, Len(tmpEmail) - CLng(x) )
		If InStr( tmpEmail2, "." ) > 0 Then

			 ' --- must have at least two character (letters and numbers) between "@" and "."
			Set objReg = New RegExp
			With objReg
				.Global = True
				.IgnoreCase = True
				.Pattern = "[A-Z]|[a-z]|[0-9]"
				Set objMatch = .Execute(left(tmpEmail2, InStr( tmpEmail2, "." ) - 1))
			End With
			If objMatch.Count < 2 then
				okEmail = False
				Exit Function
			End If
			Set objMatch = Nothing
			Set objReg = Nothing

		Else
			okEmail = False
			Exit Function
		End If

	 ' --- must have at least two characters (letters) after the "."
	z = InStr( tmpEmail2, "." )
	tmpEmail2 = Right( tmpEmail2, Len(tmpEmail2) - z )
	Set objReg = New RegExp
	With objReg
		.Global = True
		.IgnoreCase = True
		.Pattern = "[A-Z]|[a-z]"
		Set objMatch = .Execute(tmpEmail2)
	End With
	If objMatch.Count < 2 then
		okEmail = False
		Exit Function
	End If
	Set objMatch = Nothing
	Set objReg = Nothing

	 ' --- if an address makes it through, it's a valid email address
	okEmail = True
End Function
'--------------------------------------------------------------------------------
Function KodEkle(EKlenecek)
Dim AForm
Set AForm=document.Form
Select Case Eklenecek
	Case "URL":
		Yazi=inputbox("URL için, mesaj içinde görünmesini istediğiniz metini yazın.",Unvan)
		If Len(Trim(Yazi))>0 Then
			URL=inputbox("URL Adresi yazın.",Unvan,"http://")
			If Len(Trim(URL))>0 Then
				AForm.Mesaj.Value=AForm.Mesaj.Value & "<a href=""" & URL & """ target=""_blank"">" & Yazi & "</a>"
			End If
		End If
	Case "EMAIL":
		Yazi=inputbox("MAIL için, mesaj içinde görünmesini istediğiniz metini yazın.",Unvan)
		If Len(Trim(Yazi))>0 Then
			URL=inputbox("MAIL Adresi yazın.","..:: SALON ANKARA ::..")
			If Len(Trim(URL))>0 Then
				AForm.Mesaj.Value=AForm.Mesaj.Value & "<a href=""mailto:" & URL & """>" & Yazi & "</a>"
			End If
		End If
	Case "CENTER":
		Yazi=inputbox("Ortalanmış olarak yazılmasını istediğiniz metni yazın." & vbcrlf & "<CENTER>xxx</CENTER>",Unvan)
		If Len(Trim(Yazi))>0 Then
			AForm.Mesaj.Value=AForm.Mesaj.Value & "<center>" & Yazi & "</center>"
		End If
	Case "IMAGE":
		Yazi=inputbox("Resim adresi yazın." & vbcrlf & "ÖRNEK : http://www.xxx.com/xxx.jpg",Unvan,"http://")
		If Len(Trim(Yazi))>0 Then
			AForm.Mesaj.Value=AForm.Mesaj.Value & "<img src=""" & Yazi & """>"
		End If
	Case "UNDERLINE":
		Yazi=inputbox("Altı çizgili olarak yazılmasını istediğiniz metni yazın." & vbcrlf & "<U>xxx</U>",Unvan)
		If Len(Trim(Yazi))>0 Then
			AForm.Mesaj.Value=AForm.Mesaj.Value & "<u>" & Yazi & "</u>"
		End If
	Case "ITALIC":
		Yazi=inputbox("Yana yatık olarak yazılmasını istediğiniz metni yazın." & vbcrlf & "<I>xxx</I>",Unvan)
		If Len(Trim(Yazi))>0 Then
			AForm.Mesaj.Value=AForm.Mesaj.Value & "<i>" & Yazi & "</i>"
		End If
	Case "KALIN":
		Yazi=inputbox("Kalın olarak yazılmasını istediğiniz metni yazın." & vbcrlf & "<B>xxx</B>",Unvan)
		If Len(Trim(Yazi))>0 Then
			AForm.Mesaj.Value=AForm.Mesaj.Value & "<b>" & Yazi & "</b>"
		End If
	Case "LISTE":
		Sekil=inputbox("Buraya Dikkat; Liste Şekli Seçimi :" & vbcrlf & "Sayısal Sıralama : [ 1 ]'e ve sonra [ Tamam ]'a basın." & vbcrlf & _
		"Noktalı Sıralama : [ 2 ]'e ve sonra [ Tamam ]'a basın.",Unvan)
		If Trim(Sekil)="1" Then 'Sayısal Sıralama yap kardeş
			Basla="<ol>"
			Do
				Yazi=inputbox("Sırayla liste metnini yazıp [ Tamam ]'a basın." & vbcrlf & "Listeniz bittiyse, boşken [ Tamam ]'a basın.",Unvan)
				If Len(Trim(Yazi))>0 Then Metin=Metin & "<li>" & Yazi & "</li>"
			Loop Until Not Len(Trim(Yazi))>0
			AForm.Mesaj.Value=AForm.Mesaj.Value & Basla & Metin & "</ol>"
		ElseIf Trim(Sekil)="2" Then 'Noktalı Sıralama
			Basla="<ul>"
			Do
				Yazi=inputbox("Sırayla liste metnini yazıp [ Tamam ]'a basın." & vbcrlf & "Listeniz bittiyse, boşken [ Tamam ]'a basın.",Unvan)
				If Len(Trim(Yazi))>0 Then Metin=Metin & "<li>" & Yazi & "</li>"
			Loop Until Not Len(Trim(Yazi))>0
			AForm.Mesaj.Value=AForm.Mesaj.Value & Basla & Metin & "</ul>"
		End If
	case Else
		Yazi=inputbox("Renkli metni yazın.",Unvan)
		If Len(Trim(Yazi))>0 Then
			AForm.Mesaj.Value=AForm.Mesaj.Value & "<font color=""" & Eklenecek & """>" & Yazi & "</font>"
		End If
		AForm.selectColour.Options(0).Selected=True
End Select
AForm.Mesaj.Focus
End Function
'----------------------------------------------------------------------------
