/*//
## Jan-2007
=================================================================================================
=================================================================================================*/

//# Manage cookie
//=================================================================================================

	//=============================================================================================
	function getCookie(c_name)
	{
			if (document.cookie.length>0)
			{ 
					c_start=document.cookie.indexOf(c_name + "=");

					if (c_start!=-1)
					{ 
							c_start=c_start + c_name.length+1; 
							c_end=document.cookie.indexOf(";",c_start);

							if (c_end==-1) 
							{
								c_end=document.cookie.length;
							}

							return unescape(document.cookie.substring(c_start,c_end));
					} 
			}
	return null;
	}//function getCookie(c_name)

	//=============================================================================================

	//=============================================================================================
	function setCookie(c_name,value,expiredays)
	{
		var exdate=new Date();
		exdate.setDate(exdate.getDate()+expiredays);
		document.cookie=c_name+ "=" +escape(value) +	((expiredays==null) ? "" : "; expires="+exdate);
	}//function setCookie(c_name,value,expiredays)

	//=============================================================================================

	//=============================================================================================
	function unSetCookie(c_name)
	{
		var value = null;
		var expiredays = 365;
		var exdate=new Date()
		exdate.setDate(exdate.getDate()+expiredays);
		document.cookie=c_name+ "=" +escape(value) +	((expiredays==null) ? "" : "; expires="+exdate);
	}//function unSetCookie(c_name)

	//=============================================================================================

//=============================================================================================

	//=============================================================================================
	function putValue(myId,myValue)
	{
			document.getElementById(myId).value = myValue ;
	}//function putValue(myId,myValue)
	//=============================================================================================

	//=============================================================================================
	function insertInToTable(tblId, varRow, varCell, varData)
	{
			try{
					var x=document.getElementById(tblId).rows[varRow].cells;
					x[varCell].innerHTML=varData;
					return false;
			}
			catch(Err){
					return false;
			}
	}//function insertInToTable(tblId, varRow, varCell, varData)
	//=============================================================================================

	//=============================================================================================
	function insertInToDIV(divId, varData)
	{
			var x=document.getElementById(divId);
			x.innerHTML=varData;
			return false;
	}//function insertInToDIV(tblId, varData)

	//=============================================================================================

	//=============================================================================================
	function getValueFromDIV(divId)
	{
			var x=document.getElementById(divId).innerHTML;
			return x;
			
	}//function insertInToDIV(tblId, varData)

	//=============================================================================================


	//=============================================================================================
	function getValue(myId)	{
			return document.getElementById(myId).value;
	}//function getValue(myId)

	//=============================================================================================

	//=============================================================================================
	function putValue(myId,myValue)
	{
			document.getElementById(myId).value = myValue ;
	}//function putValue(myId,myValue)

	//=============================================================================================

	//=============================================================================================
	function txtBoxValidation(myId,defaultColor,errColor)
	{
        
			me=document.getElementById(myId);

			if(me.value==""){        
					me.style.background=errColor;
					me.focus();
					return false;
			}
			else{
					me.style.background=defaultColor;
					me.focus();
					return true;
			}
	}//function txtBoxValidation(myId,defaultColor,errColor)

	//=============================================================================================
	
	//=============================================================================================
	function checkEmail(email_address) 
	{

			if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email_address))
			{
					return (true)
			}
			return (false)
	}//function checkEmail(email_address)

	//=============================================================================================

	
	//=============================================================================================
	function check_phone_number(phone_no) 
	{

			if (phone_no.length<10)
			{	
				return(false);
			}
			else if (phone_no.lentgh>10)
			{
				return(false);
			}
			else 
			{
				return (true);
			}

	

	}//	function check_phone_number(phone_no) 

	//=============================================================================================


	//=============================================================================================
	function hideMe(myId)
	{
			document.getElementById(myId).style.display="none";
			
	}//function hideMe(myId)

	//=============================================================================================

	//=============================================================================================
	function showMe(myId)
	{
			document.getElementById(myId).style.display="block";
	}//function showMe(myId)

	//=============================================================================================

	//=============================================================================================
	function directMyvalueto(myValue,thatId)
	{
			document.getElementById(thatId).value=myValue;
	}//function directMyvalueto(myValue,thatId)

	//=============================================================================================


	//=============================================================================================
	function changeImage(myId,img1,img2)
	{
			if(img1==document.getElementById(myId).src){
					document.getElementById(myId).src=img2;
			}
			else{
					document.getElementById(myId).src=img1;
			}
	}//function changeImage(myId,img1,img2)

	//=============================================================================================

	//=============================================================================================
	function xyLocation(myId,x,y)
	{
			document.getElementById(myId).style.left =x; 
			document.getElementById(myId).style.top =y;
	}//function xyLocation(myId,x,y)

	//=============================================================================================

	//=============================================================================================
	function get_resolution( action )
	{
			var browser_name = get_browser( 'name' );

			if ( action == 'width')
			{
					if ( browser_name == 'netscape')
					{
									return window.innerWidth;
					}
					else if ('ie')
					{
									return screen.width;
					}
			}
	}//function get_resolution( action )

	//=============================================================================================

	//=============================================================================================
	function get_browser( action )
	{

			if( action == 'name' )
			{
					if ( navigator.appName == 'Netscape')
					{
							return 'netscape';
					}
					else if ( navigator.appName =='Microsoft Internet Explorer')
					{
							return 'ie';
					}
			}
	}//function get_browser( action )

	//=============================================================================================

	//=============================================================================================
	function decode64(input) 
	{
			var output = "";
			var chr1, chr2, chr3;
			var enc1, enc2, enc3, enc4;
			var i = 0;
			var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

			input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

			do {
					enc1 = keyStr.indexOf(input.charAt(i++));
					enc2 = keyStr.indexOf(input.charAt(i++));
					enc3 = keyStr.indexOf(input.charAt(i++));
					enc4 = keyStr.indexOf(input.charAt(i++));

					chr1 = (enc1 << 2) | (enc2 >> 4);
					chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
					chr3 = ((enc3 & 3) << 6) | enc4;

					output = output + String.fromCharCode(chr1);

					if (enc3 != 64) 
					{
							output = output + String.fromCharCode(chr2);
					}
					
					if (enc4 != 64) 
					{
							output = output + String.fromCharCode(chr3);
					}

		   } while (i < input.length);
		   return output;
	}//function decode64(input) 
	//=============================================================================================
	
	
	//## To make a object move able 
	//################################################################################################

	/*document.onmousemove = mouseMove;
	document.onmouseup   = mouseUp;
	var dragObject  = null;
	var mouseOffset = null;*/

	//=============================================================================================
	function makeDraggable(item){
		
		if(!item) return;
		item.onmousedown = function(ev){
			dragObject  = this;
			mouseOffset = getMouseOffset(this, ev);
			return false;
		}
	}//function makeDraggable(item)

	//=============================================================================================

	//=============================================================================================
	function getMouseOffset(target, ev){
		ev = ev || window.event;							
		var docPos    = getPosition(target);
		var mousePos  = mouseCoords(ev);
		return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y};
	}//function getMouseOffset(target, ev)

	//=============================================================================================

	//=============================================================================================
	function getPosition(e)
	{
		var left = 0;
		var top  = 0;
		while (e.offsetParent)
		{
			left += e.offsetLeft;
			top  += e.offsetTop;
			e     = e.offsetParent;
		}
		
		left += e.offsetLeft;
		top  += e.offsetTop;
		return {x:left, y:top};
	}//function getPosition(e)
	
	//=============================================================================================

	//=============================================================================================
	/*function mouseMove(ev){
		ev           = ev || window.event;
		var mousePos = mouseCoords(ev);
		
		if(dragObject){

			dragObject.style.position = 'absolute';
			dragObject.style.border ='1px #3C49F7 solid'; 
			dragObject.style.top      = mousePos.y - mouseOffset.y;
			dragObject.style.left     = mousePos.x - mouseOffset.x;

			return false;
		}
	}//function mouseMove(ev)*/

	//=============================================================================================
	
	//=============================================================================================
	function mouseUp(){
		//dragObject.style.border ='0px #3C49F7 solid'; 
		dragObject = null;
	}//function mouseUp()

	//=============================================================================================
	
	//=============================================================================================
	/*function mouseCoords(ev){
		if(ev.pageX || ev.pageY){
			return {x:ev.pageX, y:ev.pageY};
		}
		return {
			x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
			y:ev.clientY + document.body.scrollTop  - document.body.clientTop
		};
	}//function mouseUp()*/

	//=============================================================================================
	//# End move able section


	function chnage_border_stlyes_to(me, property, size, color )
	{
		me.style.border = size + 'px ' + color + ' solid'; 
	}


	//=============================================================================================
	function get_resolution( action )
	{
			var browser_name = get_browser( 'name' );

			if ( action == 'width')
			{
					if ( browser_name == 'netscape')
					{
									return window.innerWidth;
					}
					else if ('ie')
					{
									return screen.width;
					}
			}
	}//function get_resolution( action )

	//=============================================================================================

	//=============================================================================================
	function get_browser( action )
	{

			if( action == 'name' )
			{
					if ( navigator.appName == 'Netscape')
					{
							return 'netscape';
					}
					else if ( navigator.appName =='Microsoft Internet Explorer')
					{
							return 'ie';
					}
			}
	}//function get_browser( action )

	//=============================================================================================
	//=============================================================================================
	function show2()
	{
		if (!document.all&&!document.getElementById)
		return
		thelement=document.getElementById? document.getElementById("tick2"): document.all.tick2
		var Digital=new Date()
		var hours=Digital.getHours()
		var minutes=Digital.getMinutes()
		var seconds=Digital.getSeconds()
		var dn="P.M"
		if (hours<12)
		dn="A.M"
		if (hours>12)
		hours=hours-12
		if (hours==0)
		hours=12
		if (minutes<=9)
		minutes="0"+minutes
		if (seconds<=9)
		seconds="0"+seconds
		var ctime=hours+":"+minutes+":"+seconds+" "+dn
		thelement.innerHTML=" "+ctime+""
		setTimeout("show2()",1000)
	}
	window.onload=show2
	//===============================================================================================
	//===============================================================================================
	var d = new Date();
	var month = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
	var day = new Array("Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri");
	var date = d.getDate();
	
	var tick1 = day[d.getDay()+1] + " " + date + " " + month[d.getMonth()+1]+ " " + d.getFullYear();
	//===============================================================================================
	//===============================================================================================
	var a = Math.random() + ""
	var rand1 = a.charAt(5)
	quotes = new Array
	quotes[1] = "God is kind - Nag Mahashay"
	quotes[2] = "The disordered can not follow the religion - Nag Mahashay"
	quotes[3] = "You will meditate in forest corner and heart - Nag Mahashay"
	quotes[4] = "God is real and alls are unsubstantial - Nag Mahashay"
	quotes[5] = "Crime in my every step, pardon me, God! - Nag Mahashay"
	quotes[6] = "Hatred Shame & Fear these three have not kept - Nag Mahashay"
	quotes[7] = "The meaning of the word man is 'Honour + Consciousness' - Nag Mahashay"
	quotes[8] = "There is no end of the kindness of God - Nag Mahashay"
	quotes[9] = "No leaves of the tree move without His will - Nag Mahashay"
	quotes[0] = "Who will wish Him he will get Him - Nag Mahashay"
	//  quotes from www.tmbg.com
	var quote = quotes[rand1]
	//==============================================================================================
	//==============================================================================================
	