
var now = new Date();
var hours = now.getHours();
var psj=0;


if (hours > 17 && hours < 20){
document.write('<body bgcolor="#FFFFFF" background="./templates/eaglefonts/images/cloudsbd1.jpg" text="#FFFFFF">')
}


if (hours > 19 && hours < 22){
document.write('<body bgcolor="#FFFFFF" background="./templates/eaglefonts/images/cloudsbd2.jpg" text="#FFFFFF">')
}


if (hours > 21 || hours < 5){
document.write('<body bgcolor="#FFFFFF" background="./templates/eaglefonts/images/cloudsbd3.jpg" text="#FFFFFF" bgproperties="fixed" >')
}


if (hours > 8 && hours < 18){
document.write('<body bgcolor="#FFFFFF" background="./templates/eaglefonts/images/cloudsbd4.jpg" text="#FFFFFF">')
}


if (hours > 6 && hours < 9){
document.write('<body bgcolor="#FFFFFF" background="./templates/eaglefonts/images/cloudsbd5.jpg" text="#FFFFFF">')
}


if (hours > 4 && hours < 7){
document.write('<body bgcolor="#FFFFFF" background="./templates/eaglefonts/images/cloudsbd6.jpg" text="#FFFFFF">')
}




function highlight(field) {
        field.focus();
        field.select();
}






  var captcha_reload_count = 0;
	var captcha_image_url = "{url_captcha_image}";
  function new_captcha_image() {
    if (captcha_image_url.indexOf('?') == -1) {
		  document.getElementById('captcha_image').src= captcha_image_url+'?c='+captcha_reload_count;
		} else {
		  document.getElementById('captcha_image').src= captcha_image_url+'&c='+captcha_reload_count;
		}

    document.getElementById('captcha_input').value="";
    document.getElementById('captcha_input').focus();
    captcha_reload_count++;
  }

	function opendetailwindow() { 
    window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
  }
  
 



		
	var currentText = getRandomText();
	var currentCase = "normal";
	var negative = "";
	var currentImage = "charset";
	
	
	function getRandomText() {
		var sentenceArray = new Array('All men by nature desire to know - Aristotle', 
'I am not young enough to know everything - Oscar Wilde', 
'I have tried to know absolutely nothing about a great many things, and I have succeeded fairly well - Robert Benchley', 
'Little minds are interested in the extraordinary; great minds in the commonplace - Elbert Hubbard', 
'Our knowledge can only be finite, while our ignorance must necessarily be infinite - Karl Popper', 
'Pocket all your knowledge with your watch and never pull it out in company unless desired - Lord Chesterfield', 
'President Reagan didn\'t always know what he knew - Oliver North', 
'Ten lands are sooner known than one man - Old saying', 
'The public do not know enough to be experts, yet know enough to decide between them - Samuel Butler', 
'There are times I think I am not sure of something which I absolutely know - Mongkut, King of Siam', 
'There are two kinds of statistics, the kind you look up and the kind you make up - Rex Stout', 
'There was never an age in which useless knowledge was more important than in our own - Cyril Joad', 
'You never know what is enough unless you know what is more than enough - William Blake', 
'Zeal without knowledge is fire without light - Thomas Fuller', 
'Our knowledge is a receding mirage in an expanding desert of ignorance - Will Durant', 
'Knowledge is of two kinds; we know a subject ourselves, or we know where we can find information upon it - Samuel Johnson', 
'As we acquire more knowledge, things do not become more comprehensible, but more mysterious - Albert Schweitzer', 
'A man must carry knowledge with him, if he would bring home knowledge - Samuel Johnson', 
'Grace is given of God, but knowledge is bought in the market - Arthur Hugh Clough', 
'If a little knowledge is dangerous - where is the man who has so much as to be out of danger - Thomas Huxley', 
'We owe almost all our knowledge not to those who have agreed, but to those who have differed - Charles Caleb Colton', 
'Sit down before fact as a little child, be prepared to give up every preconceived notion, follow humbly wherever and to whatever abyss nature leads, or you shall learn nothing - Thomas Huxley', 
'The learned is happy, nature to explore, the fool is happy, that he knows no more - Alexander Pope', 
'One of the greatest joys known to man is to take a flight into ignorance in search of knowledge - Robert Lynd', 
'I do not pretend to know what many ignorant men are sure of - Clarence Darrow', 
'A man only understands what is akin to something already existing in himself - Henri Frederic Amiel', 
'Everybody gets so much common information all day long that they lose their common sense - Gertrude Stein', 
'Anyone who stops learning is old, whether at twenty or eighty. Anyone who keeps learning stays young. The greatest thing in life is to keep your mind young - Henry Ford', 
'The first problem for all of us, men and women, is not to learn, but to unlearn - Gloria Steinem', 
'We should live and learn; but by the time we\'ve learned, it\'s too late to live - Carolyn Wells', 
'The specialist is a man who fears the other subjects - Martin H. Fisher', 
'All that men really understand is confined to a very small compass; to their daily affairs and experience; to what they have an opportunity to know; and motives to study or practise. The rest is affectation and imposture - William Hazlitt', 
'There is much pleasure to be gained from useless knowledge - Bertrand Russell', 
'Every great advance in natural knowledge has involved the absolute rejection of authority - Thomas Huxley', 
'It isn\'t what we don\'t know that gives us trouble, it\'s what we know that ain\'t so - Will Rogers', 
'In all affairs, love, religion, politics or business, it\'s a healthy idea, now and then, to hang a question mark on things you have long taken for granted - Bertrand Russell', 
'Knowledge is power - Francis Bacon', 
'Man is not weak - knowledge is more than equivalent to force. The master of mechanics laughs at strength - Samuel Johnson', 
'To know that we know what we know, and that we do not know what we do not know, that is true knowledge - Henry David Thoreau', 
'The simplest questions are the hardest to answer - Northrop Frye', 
'They know enough who know how to learn - Henry Adams', 
'Strange how much you\'ve got to know Before you know how little you know - Anonymous', 
'I take all knowledge to be my province - Sir Francis Bacon', 
'To be conscious that you are ignorant is a great step to knowledge - Benjamin Disraeli', 
'For knowledge, too, is itself a power - Sir Francis Bacon', 
'The only good is knowledge, and the only evil ignorance - Diogenes', 
'He that increaseth knowledge increascth sorrow - Bible', 
'Our knowledge is the amassed thought and experience of innumerable minds - Ralph Waldo Emerson', 
'One cannot know everything - Horace', 
'Knowledge is of two kinds. We know a subject ourselves, or we know where we can find information upon it - Samuel Johnson', 
'He who knows others is learned; He who knows himself is wise - Lao-Tsze', 
'Better know nothing than half-know many things - Friedrich Nietzsche', 
'He that hath knowledge spareth his words - Proverbs', 
'Then I began to think, that it is very true which is commonly said, that the one-half of the world knoweth not how the other half liveth - Francois Rabelais', 
'We know what we are, but know not what we may be - William Shakespeare', 
'And seeing ignorance is the curse of God, Knowledge the wing wherewith we fly to heaven - William Shakespeare', 
'Know thyself - Socrates', 
'As for me, all I know is that I know nothing - Socrates', 'It is not the strongest of the species that survives, nor the most intelligent, but the one most responsive to change - Charles Darwin');
		
		
		var ran_number= Math.floor(Math.random()*sentenceArray.length);	
		var currentSentence = sentenceArray[ran_number];
		return currentSentence;	
	}
	
	function clearSearchText() {
		document.forms["searchForm"].searchfont.value = "";
	}
	
	function submitSearch() {
		document.forms["searchForm"].submit();
	}
	
	function reloadImage() {
		size = 12;
		
			var img1 = document.getElementById('charview1');
			var img2 = document.getElementById('charview2');
			var img3 = document.getElementById('charview3');
			img1.src='fontpreview/waterfall.php?font='+font+'&color='+document.fontsform.fontColor.value+'&bgcolor='+document.fontsform.fontBGColor.value;
			img2.src='fontpreview/waterfall.php?font='+font+'&color='+document.fontsform.fontColor.value+'&bgcolor='+document.fontsform.fontBGColor.value;
			img3.src='fontpreview/waterfall.php?font='+font+'&color='+document.fontsform.fontColor.value+'&bgcolor='+document.fontsform.fontBGColor.value;
		
			var img = document.getElementById('fontpreview');
			
			
			if (img) { 
			img.src='fontpreview/waterfall.php?text='+getCase(currentText)+'&font='+font+'&color='+document.fontsform.fontColor.value+'&bgcolor='+document.fontsform.fontBGColor.value;		
		}	
			
	}
	


	function reloadImageFont(font) {		
		currentImage = "";
		currentText = document.fontsform.customtextB.value.replace("&", "%26");
		img = document.getElementById('fontpreview');
		
		
		
		img.src='fontpreview/waterfall.php?text='+getCase(currentText)+'&font='+font+'&color='+document.fontsform.fontColor.value+'&bgcolor='+document.fontsform.fontBGColor.value;	
		
		if (document.getElementById)
		{
			
			var style2 = document.getElementById('charlayer').style;
			style2.display = "none";
			style2 = document.getElementById('textlayer').style;
			style2.display = "block";
		}
		else if (document.all)
		{
			
			var style2 = document.all['charlayer'].style;
			style2.display = "none";
			style2 = document.all('textlayer').style;
			style2.display = "block";
		}
		else if (document.layers)
		{
			
			var style2 = document.layers['charlayer'].style;			
			style2.display = "none";
			style2 = document.layers('textlayer').style;
			style2.display = "block";
		}
	}
	
	function clearText() {
		document.forms["fontsform"].customtextB.value = "";
	}
	
	function clearText2() {
		document.forms["myForm"].fontname.value = "";
	}
	
	function clearText3() {
		document.forms["userlogin"].user_name.value = "";
		document.forms["userlogin"].user_password.value = "";
	}
	
	function getCase(caseText) {
		if(currentCase == "upper")
			return caseText.toUpperCase();
		else if(currentCase == "lower")
			return caseText.toLowerCase();
		else return caseText;
	}
	
	function changeCase(letterCase) {
		currentCase = letterCase;		
		if(letterCase == 'upper') {
			img = document.getElementById('fontpreview');		
			
			img.src='fontpreview/waterfall.php?text='+currentText.toUpperCase()+'&font='+font+'&color='+document.fontsform.fontColor.value+'&bgcolor='+document.fontsform.fontBGColor.value	
		} else if(letterCase == 'lower') {
			img = document.getElementById('fontpreview');		
			img.src='fontpreview/waterfall.php?text='+currentText.toLowerCase()+'&font='+font+'&color='+document.fontsform.fontColor.value+'&bgcolor='+document.fontsform.fontBGColor.value	
		} else {
			img = document.getElementById('fontpreview');		
			img.src='fontpreview/waterfall.php?text='+currentText+'&font='+font+'&color='+document.fontsform.fontColor.value+'&bgcolor='+document.fontsform.fontBGColor.value	
		}
		if (document.getElementById)
		{
			
			var style2 = document.getElementById('charlayer').style;
			style2.display = "none";
			style2 = document.getElementById('textlayer').style;
			style2.display = "block";
		}
		else if (document.all)
		{
			
			var style2 = document.all['charlayer'].style;
			style2.display = "none";
			style2 = document.all('textlayer').style;
			style2.display = "block";
		}
		else if (document.layers)
		{
			
			var style2 = document.layers['charlayer'].style;			
			style2.display = "none";
			style2 = document.layers('textlayer').style;
			style2.display = "block";
		}
		
	}
	
	function viewcharset() {
		currentImage = "charset";
		document.fontsform.customtextB.value = "Type your text here";
		img = document.getElementById('fontpreview');
				if (document.getElementById)
		{
			
			var style2 = document.getElementById('charlayer').style;
			style2.display = "block";
			style2 = document.getElementById('textlayer').style;
			style2.display = "none";
		}
		else if (document.all)
		{

			
			var style2 = document.all['charlayer'].style;
			style2.display = "block";
			style2 = document.all('textlayer').style;
			style2.display = "none";
		}
		else if (document.layers)
		{
			
			var style2 = document.layers['charlayer'].style;			
			style2.display = "block";
			style2 = document.layers('textlayer').style;
			style2.display = "none";
		}	
		
		
	}
	

	function randomtext() {
		currentImage = "";
		document.fontsform.customtextB.value = "Type your text here";
		currentText = getRandomText();
		img = document.getElementById('fontpreview');
		
		img.src='fontpreview/waterfall.php?text='+getCase(currentText)+'&font='+font+'&color='+document.fontsform.fontColor.value+'&bgcolor='+document.fontsform.fontBGColor.value		
		if (document.getElementById)
		{
			
			var style2 = document.getElementById('charlayer').style;
			style2.display = "none";
			style2 = document.getElementById('textlayer').style;
			style2.display = "block";
		}
		else if (document.all)
		{
			
			var style2 = document.all['charlayer'].style;
			style2.display = "none";
			style2 = document.all('textlayer').style;
			style2.display = "block";
		}
		else if (document.layers)
		{
			
			var style2 = document.layers['charlayer'].style;			
			style2.display = "none";
			style2 = document.layers('textlayer').style;
			style2.display = "block";
		}	
		
	}
	


function formReset(){
    var x=document.forms.myForm
    x.reset()
}



  function getCookie(name) { 
    var re = new RegExp(name + "=([^;]+)");
    var value = re.exec(document.cookie);
    return (value != null) ? unescape(value[1]) : null;
  }

  var today = new Date();
  var expiry = new Date(today.getTime() + 180 * 24 * 3600 * 1000); 
  var expired = new Date(today.getTime() - 24 * 3600 * 1000); 

  function setCookie(name, value) { 
    document.cookie=name + "=" + escape(value) + "; path=/; expires=" + expiry.toGMTString();
  }

  function deleteCookie(name) { 
    document.cookie=name + "=null; path=/; expires=" + expired.toGMTString();
  }

  
   
  function storeValues(form)
  {
   
	setCookie("fontColor", form.fontColor.value);
    setCookie("fontBGColor", form.fontBGColor.value);
	setCookie("fontname", form.fontname.value);

    return true;
  }
  

  function clearCookies() { deleteCookie("fontColor"); deleteCookie("fontBGColor"); deleteCookie("fontname"); alert('Your settings have been deleted!'); javascript:location.reload(true); } 



function colorsdefault(hex)
{
      window.document.getElementById("logobase").style.backgroundColor = hex;
	  window.document.getElementById("dftextcolor").style.backgroundColor = hex;
	  
	  setCookie("fontColor", hex);
}



