﻿
/* MouseOver sound */
		// Preload and play audio files with event handler (MouseOver sound)
		// designed by JavaScript Archive, (c)1999
		// Get more free javascripts at http://jsarchive.8m.com
		
		var aySound = new Array();
		// Below: source for sound files to be preloaded
		aySound[0] = "snd/click.wav";
		aySound[1]="snd/start.wav";
		aySound[2]="AnotherSoundFile.wav";
		aySound[3]="EvenAnotherOne.wav";
		
		// DO NOT edit below this line
		document.write('<BGSOUND ID="auIEContainer">')
		IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
		NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
		ver4 = IE||NS? 1:0;
		onload=auPreload;
		
		function auPreload() {
		if (!ver4) return;
		if (NS) auEmb = new Layer(0,window);
		else {
		Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
		document.body.insertAdjacentHTML("BeforeEnd",Str);
		}
		var Str = '';
		for (i=0;i<aySound.length;i++)
		Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
		if (IE) auEmb.innerHTML = Str;
		else {
		auEmb.document.open();
		auEmb.document.write(Str);
		auEmb.document.close();
		}
		auCon = IE? document.all.auIEContainer:auEmb;
		auCon.control = auCtrl;
		}
		function auCtrl(whSound,play) {
		if (IE) this.src = play? aySound[whSound]:'';
		else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
		}
		function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
		function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }
		//-->

		
/* Background Music Play */

function EvalSound() {
		//By George Chiang (http://www.abstract.simplenet.com) More JavaScripts here!
		var sound1="snd/deepspace9.mid"
		var sound2="snd/adam.mid"
		var sound3="snd/apollo13.mid"
		var x=Math.random()*10
		if (x<=3) x=sound1
		else if (x<=6) x=sound2
		else 
		x=sound3
		if (navigator.appName=="Microsoft Internet Explorer")
		document.write('<bgsound src='+'"'+x+'"'+' loop="infinite">')
		else 
		document.write('<embed src='+'"'+x+'"'+'hidden="true" border="0" width="20" height="20" autostart="true" loop="true">')
		//-->
	}
		
// -------------------------------------------------------------------
		

//Chrome Drop Down Menu v2.01- Author: Dynamic Drive (http://www.dynamicdrive.com)
//Last updated: November 14th 06- added iframe shim technique

var cssdropdown={
disappeardelay: 250, //set delay in miliseconds before menu disappears onmouseout
disablemenuclick: false, //when user clicks on a menu item with a drop down menu, disable menu item's link?
enableswipe: 1, //enable swipe effect? 1 for yes, 0 for no
enableiframeshim: 1, //enable "iframe shim" technique to get drop down menus to correctly appear on top of controls such as form objects in IE5.5/IE6? 1 for yes, 0 for no

//No need to edit beyond here////////////////////////
dropmenuobj: null, ie: document.all, firefox: document.getElementById&&!document.all, swipetimer: undefined, bottomclip:0,

getposOffset:function(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
},

swipeeffect:function(){
if (this.bottomclip<parseInt(this.dropmenuobj.offsetHeight)){
this.bottomclip+=10+(this.bottomclip/10) //unclip drop down menu visibility gradually
this.dropmenuobj.style.clip="rect(0 auto "+this.bottomclip+"px 0)"
}
else
return
this.swipetimer=setTimeout("cssdropdown.swipeeffect()", 10)
},

showhide:function(obj, e){
if (this.ie || this.firefox)
this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px"
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover"){
if (this.enableswipe==1){
if (typeof this.swipetimer!="undefined")
clearTimeout(this.swipetimer)
obj.clip="rect(0 auto 0 0)" //hide menu via clipping
this.bottomclip=0
this.swipeeffect()
}
obj.visibility="visible"
}
else if (e.type=="click")
obj.visibility="hidden"
},

iecompattest:function(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
},

clearbrowseredge:function(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=this.ie && !window.opera? this.iecompattest().scrollLeft+this.iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth
if (windowedge-this.dropmenuobj.x < this.dropmenuobj.contentmeasure)  //move menu to the left?
edgeoffset=this.dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=this.ie && !window.opera? this.iecompattest().scrollTop : window.pageYOffset
var windowedge=this.ie && !window.opera? this.iecompattest().scrollTop+this.iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight
if (windowedge-this.dropmenuobj.y < this.dropmenuobj.contentmeasure){ //move up?
edgeoffset=this.dropmenuobj.contentmeasure+obj.offsetHeight
if ((this.dropmenuobj.y-topedge)<this.dropmenuobj.contentmeasure) //up no good either?
edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
},

dropit:function(obj, e, dropmenuID){
if (this.dropmenuobj!=null) //hide previous menu
this.dropmenuobj.style.visibility="hidden" //hide menu
this.clearhidemenu()
if (this.ie||this.firefox){
obj.onmouseout=function(){cssdropdown.delayhidemenu()}
obj.onclick=function(){return !cssdropdown.disablemenuclick} //disable main menu item link onclick?
this.dropmenuobj=document.getElementById(dropmenuID)
this.dropmenuobj.onmouseover=function(){cssdropdown.clearhidemenu()}
this.dropmenuobj.onmouseout=function(e){cssdropdown.dynamichide(e)}
this.dropmenuobj.onclick=function(){cssdropdown.delayhidemenu()}
this.showhide(this.dropmenuobj.style, e)
this.dropmenuobj.x=this.getposOffset(obj, "left")
this.dropmenuobj.y=this.getposOffset(obj, "top")
this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1+"px"
this.positionshim() //call iframe shim function
}
},

positionshim:function(){ //display iframe shim function
if (this.enableiframeshim && typeof this.shimobject!="undefined"){
if (this.dropmenuobj.style.visibility=="visible"){
this.shimobject.style.width=this.dropmenuobj.offsetWidth+"px"
this.shimobject.style.height=this.dropmenuobj.offsetHeight+"px"
this.shimobject.style.left=this.dropmenuobj.style.left
this.shimobject.style.top=this.dropmenuobj.style.top
}
this.shimobject.style.display=(this.dropmenuobj.style.visibility=="visible")? "block" : "none"
}
},

hideshim:function(){
if (this.enableiframeshim && typeof this.shimobject!="undefined")
this.shimobject.style.display='none'
},

contains_firefox:function(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
},

dynamichide:function(e){
var evtobj=window.event? window.event : e
if (this.ie&&!this.dropmenuobj.contains(evtobj.toElement))
this.delayhidemenu()
else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefox(evtobj.currentTarget, evtobj.relatedTarget))
this.delayhidemenu()
},

delayhidemenu:function(){
this.delayhide=setTimeout("cssdropdown.dropmenuobj.style.visibility='hidden'; cssdropdown.hideshim()",this.disappeardelay) //hide menu
},

clearhidemenu:function(){
if (this.delayhide!="undefined")
clearTimeout(this.delayhide)
},

startchrome:function(){
for (var ids=0; ids<arguments.length; ids++){
var menuitems=document.getElementById(arguments[ids]).getElementsByTagName("a")
for (var i=0; i<menuitems.length; i++){
if (menuitems[i].getAttribute("rel")){
var relvalue=menuitems[i].getAttribute("rel")
menuitems[i].onmouseover=function(e){
var event=typeof e!="undefined"? e : window.event
cssdropdown.dropit(this,event,this.getAttribute("rel"))
}
}
}
}
if (window.createPopup && !window.XmlHttpRequest){ //if IE5.5 to IE6, create iframe for iframe shim technique
document.write('<IFRAME id="iframeshim"  src="" style="display: none; left: 0; top: 0; z-index: 90; position: absolute; filter: progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)" frameBorder="0" scrolling="no"></IFRAME>')
this.shimobject=document.getElementById("iframeshim") //reference iframe object
}
}

}


// -------------------------------------------------------------------


// ---------- script properties ----------


var results_location = "results.html";


// ---------- end of script properties ----------


function search_form(jse_Form) {
	if (jse_Form.d.value.length > 0) {
		document.cookie = "d=" + escape(jse_Form.d.value);
		window.location = results_location;
	}
}





// ---------- script properties ----------

var include_num = 1;
var bold = 1;

// ---------- sites ----------


var s = new Array();

s[0] = "Personal Website of Asaad Abdollahzadeh^index.html^Asaad Abdollahzadeh ...^personal website, reservoir simulation, RIPI, PRS";
s[1] = "Personal photo gallary of Asaad Abdollahzadeh^photo.html^Asaad Abdollahzadeh ...^personal photo, gallary, RIPI, PRS";


// ---------- end of script properties and sites ----------


var cookies = document.cookie;
var p = cookies.indexOf("d=");

if (p != -1) {
	var st = p + 2;
	var en = cookies.indexOf(";", st);
	if (en == -1) {
		en = cookies.length;
	}
	var d = cookies.substring(st, en);
	d = unescape(d);
}
var od = d;
var m = 0;
if (d.charAt(0) == '"' && d.charAt(d.length - 1) == '"') {
	m = 1;
}

var r = new Array();
var co = 0;

if (m == 0) {
	var woin = new Array();
	var w = d.split(" ");
	for (var a = 0; a < w.length; a++) {
		woin[a] = 0;
		if (w[a].charAt(0) == '-') {
			woin[a] = 1;
		}
	}
	for (var a = 0; a < w.length; a++) {
		w[a] = w[a].replace(/^\-|^\+/gi, "");
	}
	a = 0;
	for (var c = 0; c < s.length; c++) {
		pa = 0;
		nh = 0;
		for (var i = 0; i < woin.length; i++) {
			if (woin[i] == 0) {
				nh++;
				var pat = new RegExp(w[i], "i");
				var rn = s[c].search(pat);
				if (rn >= 0) {
					pa++;
				} else {
					pa = 0;
				}
			}
			if (woin[i] == 1) {
				var pat = new RegExp(w[i], "i");
				var rn = s[c].search(pat);
				if (rn >= 0) {
					pa = 0;
				}
			}
		}
		if (pa == nh) {
			r[a] = s[c];
			a++;
		}
	}
	co = a;
}

if (m == 1) {
	d = d.replace(/"/gi, "");
	var a = 0;
	var pat = new RegExp(d, "i");
	for (var c = 0; c < s.length; c++) {
		var rn = s[c].search(pat);
		if (rn >= 0) {
			r[a] = s[c];
			a++;
		}
	}
	co = a;

}


function return_query() {
	document.jse_Form.d.value = od;
}

function num_jse() {
	document.write(co);
}

function out_jse() {
	if (co == 0) {
		document.write('Your search did not match any documents.<p>Make sure all keywords are spelt correctly.<br>Try different or more general keywords.');
		return;
	}
	for (var a = 0; a < r.length; a++) {
		var os = r[a].split("^");
		if (bold == 1 && m == 1) {
			var br = "<b>" + d + "</b>";
			os[2] = os[2].replace(pat, br);
		}
		if (include_num == 1) {
			document.write(a + 1, '. <a href="', os[1], '">', os[0], '</a><br>', os[2], '<p>');
		} else {
			document.write('<a href="', os[1], '">', os[0], '</a><br>', os[2], '<p>');
		}
	}

}

// ---------- end of Search script

function Encrypt_email(email_address) {
					/*<![CDATA[*/
					<!-- Encrypted version of: as1ad [at] *****.*** //-->
					var emailriddlerarray=[97,115,49,97,100,64,121,97,104,111,111,46,99,111,109]
					var encryptedemail_id78='' //variable to contain encrypted email 
					for (var i=0; i<emailriddlerarray.length; i++)
					 encryptedemail_id78+=String.fromCharCode(emailriddlerarray[i])
					document.write('<a href="mailto:'+encryptedemail_id78+'?subject=Contact me via e-mail"><img src="img/emailButton.gif"  alt="Email Me" /></a>')	
					/*]]>*/
	}
	
	
	
	
	
	
	
	/*Example message arrays for the two demo scrollers*/

var pausecontent=new Array()
pausecontent[0]='<a href="news_and_events.html"><b>PRS Beta is released!</b></a><br />Beta 1 version of PRS is officialy  released!'
pausecontent[1]='<a href="index.html"><b>PRS Website is ready!</b></a><br />Pars Reservoir Simulator (PRS) is now ready!'
pausecontent[2]='<a href="news_and_events.html"><b>PRS "Beta to  Release" is started!</b></a><br />Project Phase 2 of PRS Development is started!'

var pausecontent2=new Array()
pausecontent2[0]='<a href="news_and_events.html">PRS Beta is released!</a><br />Beta 1 version of PRS is officialy  released!'
pausecontent2[1]='<a href="news_and_events.html">PRS Beta is released!</a><br />Beta 1 version of PRS is officialy  released!'
pausecontent2[2]='<a href="news_and_events.html">PRS Beta is released!</a><br />Beta 1 version of PRS is officialy  released!'


/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}
// -------------------------------------------------------------------
//Disable Selection
//Sample usages
//disableSelection(document.body) //Disable text selection on entire body
//disableSelection(document.getElementById("mydiv")) //Disable text selection on element with id="mydiv"

function disableselection(target){
if (typeof target.onselectstart!="undefined") //IE route
	target.onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
	target.style.MozUserSelect="none"
else //All other route (ie: Opera)
	target.onmousedown=function(){return false}
target.style.cursor = "default"
}

// -------------------------------------------------------------------

//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

var message="";
///////////////////////////////////
function clickIE(target) {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
// -------------------------------------------------------------------

/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}
// -------------------------------------------------------------------

var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")

function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
if (hours>12){
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here
var cdate="<small><font color='000000' face='Arial'><b>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" "+hours+":"+minutes+":"+seconds+" "+dn
+"</b></font></small>"
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdate
else
document.write(cdate)
}
if (!document.all&&!document.getElementById)
getthedate()
function goforit(){
if (document.all||document.getElementById)
setInterval("getthedate()",1000)
}

/*
*/
// -------------------------------------------------------------------
// This array holds the "friendly" day names

function date() {
var day_names = new Array(7)
day_names[0] = "Sunday"
day_names[1] = "Monday"
day_names[2] = "Tuesday"
day_names[3] = "Wednesday"
day_names[4] = "Thursday"
day_names[5] = "Friday"
day_names[6] = "Saturday"

// This array holds the "friendly" month names
var month_names = new Array(12)
month_names[0] = "January"
month_names[1] = "February"
month_names[2] = "March"
month_names[3] = "April"
month_names[4] = "May"
month_names[5] = "June"
month_names[6] = "July"
month_names[7] = "August"
month_names[8] = "September"
month_names[9] = "October"
month_names[10] = "November"
month_names[11] = "December"

// Get the current date
date_now = new Date()

// Figure out the friendly day name
day_value = date_now.getDay()
date_text = day_names[day_value]

// Figure out the friendly month name
month_value = date_now.getMonth()
date_text += " " + month_names[month_value]

// Add the day of the month
date_text += " " + date_now.getDate()

// Add the year
date_text += ", " + date_now.getFullYear()

// Get the minutes in the hour
minute_value = date_now.getMinutes()
if (minute_value < 10) {
    minute_value = "0" + minute_value
}

// Get the hour value and use it to customize the greeting
hour_value = date_now.getHours()
if (hour_value == 0) {
   greeting = "Good morning, "
   time_text = ";  <b>" + (hour_value + 12) + ":" + minute_value + " AM </b>"
}
else if (hour_value < 12) {
    greeting = "Good morning!"
    time_text = "; <b>" + hour_value + ":" + minute_value + " AM </b>"
}
else if (hour_value == 12) {
    greeting = "Good afternoon!"
    time_text = " at  <b>" + hour_value + ":" + minute_value + " PM </b>"
}
else if (hour_value < 17) {
    greeting = "Good afternoon!"
    time_text = " at  <b>" + (hour_value - 12) + ":" + minute_value + " PM"
}
else {
    greeting = "Good evening!"
    time_text = " - <b>" + (hour_value - 12) + ":" + minute_value + " PM </b>"
}

document.write(greeting + "<br />"+ date_text + time_text)

}
// -------------------------------------------------------------------
function date_fa(){
dayName = new Array ("يكشنبه","دوشنبه", "سه شنبه", "چهارشنبه","پنج شنبه" , "جمعه","شنبه" )
monName = new Array ( "دي","بهمن","اسفند","فروردين","ارديبهشت","خرداد","تير","مرداد","شهريور","مهر","آبان","آذر")
now = new Date
hn = now.getHours()
mn = now.getMinutes()
rr=dayName[now.getDay()]

if (now.getMonth() <= 1 ) { ii=now.getFullYear()-622 } else { if ( now.getDate() <= 21 && now.getMonth() == 2) { ii=now.getFullYear()-622 } else { ii=now.getFullYear()-621 }}

if ( now.getMonth() == 6 || now.getMonth() == 7 || now.getMonth() == 8 || now.getMonth() == 9) { if ( now.getDate() <=22 ) { mm=monName[now.getMonth()] } else {mm=monName[now.getMonth()+1]}}
if ( now.getMonth() == 4 || now.getMonth() == 5 || now.getMonth() == 10 ) { if ( now.getDate() <=21 ) { mm=monName[now.getMonth()] } else {mm=monName[now.getMonth()+1] }}
if ( now.getMonth() == 0 || now.getMonth() == 2 || now.getMonth() == 3 ) { if ( now.getDate() <=20 ) { mm=monName[now.getMonth()] } else { mm=monName[now.getMonth()+1] }}
if ( now.getMonth() == 1) { if ( now.getDate() <=19 ) { mm=monName[now.getMonth()] } else { mm=monName[now.getMonth()+1] }}
if ( now.getMonth() == 11) { if ( now.getDate() <=21 ) { mm=monName[now.getMonth()] } else { mm=monName[now.getMonth()-11] }}
if ( now.getMonth() == 2 || now.getMonth() == 3 || now.getMonth() == 0 ){if ( now.getDate() <=20 ) {mr=now.getDate()+10 } else {  mr=now.getDate()+10-30 }}
if ( now.getMonth() == 4 || now.getMonth() == 5 ){ if ( now.getDate() <=21 ) { mr=now.getDate()+10 } else { mr=now.getDate()+10-31 }}
if ( now.getMonth() == 6 || now.getMonth() == 7 || now.getMonth() == 8 ){ if ( now.getDate() <=21 ) { mr=now.getDate()+9 } else { mr=now.getDate()+9-31 }}
if ( now.getMonth() == 10 || now.getMonth() == 11){ if ( now.getDate() <=21 ) { mr=now.getDate()+9 } else { mr=now.getDate()+9-30 }}
if ( now.getMonth() == 9){ if ( now.getDate() <=22 ) { mr=now.getDate()+8 } else { mr=now.getDate()+8-30} }
if ( now.getMonth() == 1 ){ if ( now.getDate() <=20 ) { mr=now.getDate()+11 } else { mr=now.getDate()+11-30  }}

// Get the minutes in the hour
minute_value = now.getMinutes()
if (minute_value < 10) {
    minute_value = "0" + minute_value
}

// Get the hour value and use it to customize the greeting
hour_value = now.getHours()
if (hour_value == 0) {
   greeting = "صبح به خير, "
   time_text = "<b>" + + (hour_value + 12) + ":" + minute_value + " ق.ظ </b>"
}
else if (hour_value < 12) {
    greeting = "صبح به خير!"
    time_text = "<b>" + + hour_value + ":" + minute_value + " ق.ظ </b>"
}
else if (hour_value == 12) {
    greeting = "بعد از ظهر به خير!"
    time_text = "<b>" + hour_value + ":" + minute_value + " ب.ظ </b>"
}
else if (hour_value < 17) {
    greeting = "بعد از ظهر به خير!"
    time_text = "<b>" + (hour_value - 12) + ":" + minute_value + " ب.ظ </b>"
}
else {
    greeting = "عصر به خير!"
    time_text = "<b>" + (hour_value - 12) + ":" + minute_value + " ب.ظ </b>"
}

document.write(greeting +" <br /> " + rr + "، " +mr+" "+ mm + " " + ii+" - "+ time_text)
}
// -------------------------------------------------------------------
function date_ku(){
dayName = new Array (" یه كشه مه"," دووشه مه"," سێ شه مه"," چوارشه مه "," پێنج شه مه"," هه ینی"," شه مه")
monName = new Array ("رێبه ندان","ره شه مه" ,"خاكه لێوه","گوڵان","جۆزه ردان","ره زبه ر","پووشپه ر","گه لاوێژ","خه رمانان","گه لارێزان","سه رماوه ز","به فرانبار")
now = new Date
hn = now.getHours()
mn = now.getMinutes()
rr=dayName[now.getDay()]

if (now.getMonth() <= 1 ) { ii=now.getFullYear()-622 } else { if ( now.getDate() <= 21 && now.getMonth() == 2) { ii=now.getFullYear()-622 } else { ii=now.getFullYear()-621 }}

if ( now.getMonth() == 6 || now.getMonth() == 7 || now.getMonth() == 8 || now.getMonth() == 9) { if ( now.getDate() <=22 ) { mm=monName[now.getMonth()] } else {mm=monName[now.getMonth()+1]}}
if ( now.getMonth() == 4 || now.getMonth() == 5 || now.getMonth() == 10 ) { if ( now.getDate() <=21 ) { mm=monName[now.getMonth()] } else {mm=monName[now.getMonth()+1] }}
if ( now.getMonth() == 0 || now.getMonth() == 2 || now.getMonth() == 3 ) { if ( now.getDate() <=20 ) { mm=monName[now.getMonth()] } else { mm=monName[now.getMonth()+1] }}
if ( now.getMonth() == 1) { if ( now.getDate() <=19 ) { mm=monName[now.getMonth()] } else { mm=monName[now.getMonth()+1] }}
if ( now.getMonth() == 11) { if ( now.getDate() <=21 ) { mm=monName[now.getMonth()] } else { mm=monName[now.getMonth()-11] }}
if ( now.getMonth() == 2 || now.getMonth() == 3 || now.getMonth() == 0 ){if ( now.getDate() <=20 ) {mr=now.getDate()+10 } else {  mr=now.getDate()+10-30 }}
if ( now.getMonth() == 4 || now.getMonth() == 5 ){ if ( now.getDate() <=21 ) { mr=now.getDate()+10 } else { mr=now.getDate()+10-31 }}
if ( now.getMonth() == 6 || now.getMonth() == 7 || now.getMonth() == 8 ){ if ( now.getDate() <=21 ) { mr=now.getDate()+9 } else { mr=now.getDate()+9-31 }}
if ( now.getMonth() == 10 || now.getMonth() == 11){ if ( now.getDate() <=21 ) { mr=now.getDate()+9 } else { mr=now.getDate()+9-30 }}
if ( now.getMonth() == 9){ if ( now.getDate() <=22 ) { mr=now.getDate()+8 } else { mr=now.getDate()+8-30} }
if ( now.getMonth() == 1 ){ if ( now.getDate() <=20 ) { mr=now.getDate()+11 } else { mr=now.getDate()+11-30  }}

// Get the minutes in the hour
minute_value = now.getMinutes()
if (minute_value < 10) {
    minute_value = "0" + minute_value
}

// Get the hour value and use it to customize the greeting
hour_value = now.getHours()
if (hour_value == 0) {
   greeting = "به یانی باش! "
   time_text = "<b>" + + (hour_value + 12) + ":" + minute_value + " پ.ن </b>"
}
else if (hour_value < 12) {
    greeting = "به یانی باش! "
    time_text = "<b>" + + hour_value + ":" + minute_value + " پ.ن </b>"
}
else if (hour_value == 12) {
    greeting = "ئیوه رۆ باش!"
    time_text = "<b>" + hour_value + ":" + minute_value + " د.ن </b>"
}
else if (hour_value < 17) {
    greeting = "ئیواره باش!"
    time_text = "<b>" + (hour_value - 12) + ":" + minute_value + " د.ن </b>"
}
else {
    greeting = "ئیواره باش!"
    time_text = "<b>" + (hour_value - 12) + ":" + minute_value + " د.ن </b>"
}

document.write(greeting +" <br /> " + rr + "، " +mr+" "+ mm + " " + ii+" - "+ time_text)
}
// -------------------------------------------------------------------
	function checkForm(myForm) {
 		if !(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.emaile.value)){
		alert("Invalid E-mail Address! Please re-enter.")
		return (false)
		}
		if (myForm.name.value.lenght==0){
		alert("Name is Empty! Please enter your name.")
		return (false)
		}
		if (myForm.comments.value=""){
		alert("Comment is Empty! Please enter your Comments.")
		return (false)
		}
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.emaile.value)){
		return (true)
		}
		alert("Invalid E-mail Address! Please re-enter.")
		return (false)
		}
// -------------------------------------------------------------------
		function clearFields(myForm){
			document.myForm.reset();
		}
// -------------------------------------------------------------------
