﻿// JScript File


function scroll(obj1,obj2) 
{
if(obj2!=null){
	if (document.getElementById(obj1).style.display == "none")
    {
		document.getElementById(obj1).style.display = "";
	    document.getElementById(obj2).style.display = "none";
	}
	else
	{
	    document.getElementById(obj1).style.display = "none";
	    document.getElementById(obj2).style.display="";
	}	
	
}
else 
{
    document.getElementById(obj1).style.display = "";
}	
}
 
function ShowRandom()
{
  setInterval("scroll('dv_1','dv_2')",10000);
}

function getSearch(pagepath)
{   
    var searchstring=document.getElementById('txtsearch').value;
    if(searchstring=='')
    {
        return;
    }
    document.location.href= pagepath +'?search='+ searchstring ;
}

function PollVote()
{

var opt=0;
for (var i=0; i < document.form1.rad.length; i++)
   {
   
   
   if (document.form1.rad[i].checked)
      {
      
      var opt = document.form1.rad[i].value;
      }
      
    
 }
 
 
  if (opt!=0)
   {
    
    var cID=document.form1.txtCid.value;
    document.location.href = 'default.aspx?id=17&stat=poll&opt=' + opt + '&cID=' + cID;
   }
   
  else{
        alert('Please select any option');
    }
}


function PollNewVote(cID)
{

var opt=0;
for (var i=0; i < document.form1.rad.length; i++)
   {
   
   
   if (document.form1.rad[i].checked)
      {
      
      var opt = document.form1.rad[i].value;
      }
      
    
 }
 
 
  if (opt!=0)
   {
    
    
    document.location.href = 'PollResult.aspx?stat=poll&opt=' + opt + '&cID=' + cID;
   }
   
  else{
        alert('Please select any option');
    }
}

function PollNavigate()
{
document.location.href = 'PollResult.aspx';
}

function PollResults(cID)
{
    document.location.href = 'PollResult.aspx?stat=result&cid=' + cID;
}

function OpenPopUp(theURL,winName,features) {
	window.open(theURL,winName,features);
}


function subscribe(id)
{
    if (document.form1.txtemail.value == '')
        {
            alert('Please enter EmailID');
            document.form1.txtemail.focus();
            return;
         }
         var email = document.form1.txtemail.value;
         document.location.href = 'default.aspx?id='+ id +'&stat=save&e=' + email;
         
}


function RequiredEmail()
		{
			if (document.form1.txtemail.value == '')
			{
				alert('Please enter EmailID');
				document.form1.txtemail.focus();
				return;
			}		
						
			Navigate();	
			
}

function Navigate()
		{
		var type;
		for( i = 0; i < document.form1.rad.length; i++ )
{
if( document.form1.rad[i].checked == true )
type = document.form1.rad[i].value;
}

		    var name = document.form1.txtname.value;		    
			var city = document.form1.txtcity.value;
			var country = document.form1.ctl06_dropCountryList.options[document.form1.ctl06_dropCountryList.selectedIndex].text;
		    var email = document.form1.txtemail.value;
		    var phone = document.form1.txtPhone.value;
		    var desc=document.form1.txtDesc.value;					
			document.location.href = 'default.aspx?id=6&stat=save&n=' + name + '&c=' + city + '&cc=' + country + '&e=' + email + '&p=' + phone + '&d=' + desc +'&t=' + type;					
		}
		
function SaveEmpArticle()
{
		
    if (document.form1.txtemail.value == '')
		{
	    	alert('Please enter EmailID');
			document.form1.txtemail.focus();
			return;
		}
		
			var name = document.form1.txtname.value;
			var title = document.form1.txtcity.value;
		    var email = document.form1.txtemail.value;
		    var desc=document.form1.txtDesc.value;					
			document.location.href = 'default.aspx?id=19&stat=save&n=' + name + '&title=' + title + '&desc=' + desc + '&Email=' + email;					

		
}
	
	
	function SaveApplicationForm()
		{
			if (document.form1.txtemail.value == '')
			{
				alert('Please enter EmailID');
				document.form1.txtemail.focus();
				return;
			}		
						
		    var name = document.form1.txtname.value;			
		    var email = document.form1.txtemail.value;
		    var desc=document.form1.txtDesc.value;					
			document.location.href = 'default.aspx?id=20&stat=save&n=' + name + '&e=' + email + '&d=' + desc;					

			
}	
		
// Blending Image Slide Show Script- 


//specify interval between slide (in mili seconds)
var slidespeed=3000

//specify images
var slideimages=new Array("image1.gif","image2.gif","image3.gif")

//specify corresponding links
var slidelinks=new Array("http://www.dynamicdrive.com","http://javascriptkit.com","http://www.geocities.com")

var newwindow=1 //open links in new window? 1=yes, 0=no

var imageholder=new Array()
var ie=document.all
for (i=0;i<slideimages.length;i++){
imageholder[i]=new Image()
imageholder[i].src=slideimages[i]
}

function gotoshow(){
if (newwindow)
window.open(slidelinks[whichlink])
else
window.location=slidelinks[whichlink]
}




var divs=new Array();

function LoadPoll(n)
{

if(n==0)
{}else{
for (var i=0; i<n; i++){

divs[i]='dv_'+(i+1);

}
showDiv();
}
}

function hideDivs() {
for (var i=0; i<divs.length; i++)
document.getElementById(divs[i]).style.display = 'none';
}

function showDiv() {
//alert(divs);
hideDivs(); //hide them all before we show the next one.
var randomDiv = divs[Math.floor(Math.random()*divs.length)];
var div = document.getElementById(randomDiv).style.display =
'block';

setTimeout(showDiv,3000); //set a delay before showing the next div
}



//////////Status Bar Effects/////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
var text  = "General Authority of Youth & Sports Welfare"
var speed = 200

var x = 0

function bb() {

var a = text.substring(0,x)
var b = text.substring(x,x+1).toUpperCase()
var c = text.substring(x+1,text.length)

window.status = a + b + c

if (x == text.length) {
x = 0
}

else {
x++
}

setTimeout("bb()",speed)
}


var init_msg = "General Authority of Youth & Sports Welfare." 

var str = "" 
var msg = "" 
var leftmsg = "" 


function setMessage()
{
    if (msg == "") 
    {
        str = " "         
        msg = init_msg    
        leftmsg = ""      
    }
    
    if (str.length == 1) 
    {
        
        while (msg.substring(0, 1) == " ")
        {
            leftmsg = leftmsg + str            
            str = msg.substring(0, 1)           
            msg = msg.substring(1, msg.length) 
        }
        leftmsg = leftmsg + str            
        str = msg.substring(0, 1)           
        msg = msg.substring(1, msg.length) 
        for (var ii = 0; ii < 120; ii++) 
            {str = " " + str}           
			}
    else
    {
        str = str.substring(10, str.length) // decrease str little by little
    }


    window.status = leftmsg + str
    JSCTimeOutID = window.setTimeout('setMessage()',5)
}


timeID = 5;
stcnt = 11;
msg = "General Authority of Youth & Sports Welfare.";
wmsg = new Array(33);
wmsg[0] = msg;
blnk = "                                                               ";
for (i = 1; i < 32; i++) {
b = blnk.substring(0, i);
wmsg[i] = "";
for (j = 0; j < msg.length; j++) wmsg[i] = wmsg[i] + msg.charAt(j) + b;
}
function packit() {
if (stcnt > -1) str = wmsg[stcnt];
else str = wmsg[0];
if (stcnt-- < -40) stcnt = 31;
status = str;
clearTimeout(timeID);
timeID = setTimeout("packit()", 150);
}

objects = document.getElementsByTagName("object");
//alert(objects.length);
for (var i = 0; i < objects.length; i++)
{
    objects[i].outerHTML = objects[i].outerHTML;
}

//////////Status Bar Effects/////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////


////////Prayer Timings/////////////////////////////////////////////

/////dubai//////////

function DubaiPrayerTime(t)
{

 var today = new Date(t); 
    var J = 0;                                  // Day of year
    var H = 4;                                  // The height above sea level in meters
    var D = 0;                                  // Solar Declination (Degrees)
    var T = 0;                                  // Equation of Time (Minutes)
    var Gd = 18.20;                                // Dawn’s Twilight Angle (15°-19°)
    var Gn = 18.40;                                // Night’s Twilight Angle (15°-19°)
    var B = 24.27;                               // Latitude (Degrees)
    var L = 54.23;                              // Longitude (Degrees)
    var TZ = 4;                                 // Time Zone (Hours)
    var R = 0;                                  // Reference Longitude (Degrees)  
    var Sh = 1;                                 // Sh=1 (Shafii) - Sh=2 (Hanafi)
    var firstYear =new Date(t);   
    firstYear.setMonth(0);    
    firstYear.setDate(1);    
    J = (today - firstYear) / 86400000;    
     
	var beta = 2 * Math.PI * J / 365            // Year angle
	D = (180/Math.PI) * (0.006918 - (0.399912 * Math.cos(beta)) + (0.070257 * Math.sin(beta)) - (0.006758 * Math.cos(2 * beta)) + (0.000907 * Math.sin(2 * beta)) - (0.002697 * Math.cos(3 * beta)) + (0.001480 * Math.sin(3 * beta)));
	T = 229.18 * (0.000075 + (0.001868 * Math.cos(beta)) - (0.032077 * Math.sin(beta)) - (0.014615 * Math.cos(2 * beta)) - (0.040849 * Math.sin(2 * beta)));
    R = 15 * TZ;
    var G = 18;
    var Z = 12 + ((R - L) / 15) - (T / 60);
    var U =  (180 / (15 * Math.PI)) * Math.acos((Math.sin((-0.8333 - 0.0347 * (H / Math.abs(H)) * Math.sqrt(Math.abs(H))) * (Math.PI / 180)) - Math.sin(D * (Math.PI / 180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI / 180)) * Math.cos(B * (Math.PI/180))));
    var Vd = (180 / (15 * Math.PI)) * Math.acos((-Math.sin(Gd * (Math.PI / 180)) - Math.sin(D * (Math.PI/180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI/180)) * Math.cos(B * (Math.PI/180))));
    var Vn = (180 / (15 * Math.PI)) * Math.acos((-Math.sin(Gn * (Math.PI / 180)) - Math.sin(D * (Math.PI/180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI/180)) * Math.cos(B * (Math.PI/180))));
    var W =  (180 / (15 * Math.PI)) * Math.acos((Math.sin(Math.atan(1/(Sh+Math.tan(Math.abs(B - D)*Math.PI/180))))-Math.sin(D*Math.PI/180)*Math.sin(B*Math.PI/180))/(Math.cos(D*Math.PI/180)*Math.cos(B*Math.PI/180)));
    
        
    document.getElementById('11').innerHTML = FormatTime(Z-Vd);
    document.getElementById('12').innerHTML = FormatTime(Z-U);
    document.getElementById('13').innerHTML = FormatTime(Z);
    document.getElementById('14').innerHTML = FormatTime(Z+W);
    document.getElementById('15').innerHTML = FormatTime(Z+U);
    document.getElementById('16').innerHTML = FormatTime(Z+Vn);
       
        
    }
    
    function FormatTime(x) {
        var hour =  Math.floor(x);
        var minute = Math.floor((x - hour) * 60);
        var second = Math.floor((((x - hour) * 60) - minute) * 60);
        return (hour + ':' + minute + ':' + second);
    }
///////dubai prayer ends///

function Dubaiprayer(t)
{

 var today = new Date(t); 
    var J = 0;                                  // Day of year
    var H = 4;                                  // The height above sea level in meters
    var D = 0;                                  // Solar Declination (Degrees)
    var T = 0;                                  // Equation of Time (Minutes)
    var Gd = 18.20;                                // Dawn’s Twilight Angle (15°-19°)
    var Gn = 18.40;                                // Night’s Twilight Angle (15°-19°)
    var B = 24.27;                               // Latitude (Degrees)
    var L = 54.23;                              // Longitude (Degrees)
    var TZ = 4;                                 // Time Zone (Hours)
    var R = 0;                                  // Reference Longitude (Degrees)  
    var Sh = 1;                                 // Sh=1 (Shafii) - Sh=2 (Hanafi)
    var firstYear =new Date(t);   
    firstYear.setMonth(0);    
    firstYear.setDate(1);    
    J = (today - firstYear) / 86400000;    
     
	var beta = 2 * Math.PI * J / 365            // Year angle
	D = (180/Math.PI) * (0.006918 - (0.399912 * Math.cos(beta)) + (0.070257 * Math.sin(beta)) - (0.006758 * Math.cos(2 * beta)) + (0.000907 * Math.sin(2 * beta)) - (0.002697 * Math.cos(3 * beta)) + (0.001480 * Math.sin(3 * beta)));
	T = 229.18 * (0.000075 + (0.001868 * Math.cos(beta)) - (0.032077 * Math.sin(beta)) - (0.014615 * Math.cos(2 * beta)) - (0.040849 * Math.sin(2 * beta)));
    R = 15 * TZ;
    var G = 18;
    var Z = 12 + ((R - L) / 15) - (T / 60);
    var U =  (180 / (15 * Math.PI)) * Math.acos((Math.sin((-0.8333 - 0.0347 * (H / Math.abs(H)) * Math.sqrt(Math.abs(H))) * (Math.PI / 180)) - Math.sin(D * (Math.PI / 180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI / 180)) * Math.cos(B * (Math.PI/180))));
    var Vd = (180 / (15 * Math.PI)) * Math.acos((-Math.sin(Gd * (Math.PI / 180)) - Math.sin(D * (Math.PI/180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI/180)) * Math.cos(B * (Math.PI/180))));
    var Vn = (180 / (15 * Math.PI)) * Math.acos((-Math.sin(Gn * (Math.PI / 180)) - Math.sin(D * (Math.PI/180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI/180)) * Math.cos(B * (Math.PI/180))));
    var W =  (180 / (15 * Math.PI)) * Math.acos((Math.sin(Math.atan(1/(Sh+Math.tan(Math.abs(B - D)*Math.PI/180))))-Math.sin(D*Math.PI/180)*Math.sin(B*Math.PI/180))/(Math.cos(D*Math.PI/180)*Math.cos(B*Math.PI/180)));
    
        
    document.getElementById('11').innerHTML = FormatTime(Z-Vd);
    document.getElementById('12').innerHTML = FormatTime(Z-U);
    document.getElementById('13').innerHTML = FormatTime(Z);
    document.getElementById('14').innerHTML = FormatTime(Z+W);
    document.getElementById('15').innerHTML = FormatTime(Z+U);
    document.getElementById('16').innerHTML = FormatTime(Z+Vn);
       
        
    }
    
    function FormatTime(x) {
        var hour =  Math.floor(x);
        var minute = Math.floor((x - hour) * 60);
        var second = Math.floor((((x - hour) * 60) - minute) * 60);
        return (hour + ':' + minute + ':' + second);
    }
    
    
    function AbuDhabiprayer(t)
{

 var today = new Date(t);
    var J = 0;                                  // Day of year
    var H = 4;                                  // The height above sea level in meters
    var D = 0;                                  // Solar Declination (Degrees)
    var T = 0;                                  // Equation of Time (Minutes)
    var Gd = 19;                                // Dawn’s Twilight Angle (15°-19°)
    var Gn = 19;                                // Night’s Twilight Angle (15°-19°)
    var B = 24.28;                               // Latitude (Degrees)
    var L = 54.22;                              // Longitude (Degrees)
    var TZ = 4;                                 // Time Zone (Hours)
    var R = 0;                                  // Reference Longitude (Degrees)  
    var Sh = 1;                                 // Sh=1 (Shafii) - Sh=2 (Hanafi)
    var firstYear = new Date(t);
    
    firstYear.setMonth(0);
    firstYear.setDate(1);
    J = (today - firstYear) / 86400000;
	var beta = 2 * Math.PI * J / 365            // Year angle
	D = (180/Math.PI) * (0.006918 - (0.399912 * Math.cos(beta)) + (0.070257 * Math.sin(beta)) - (0.006758 * Math.cos(2 * beta)) + (0.000907 * Math.sin(2 * beta)) - (0.002697 * Math.cos(3 * beta)) + (0.001480 * Math.sin(3 * beta)));
	T = 229.18 * (0.000075 + (0.001868 * Math.cos(beta)) - (0.032077 * Math.sin(beta)) - (0.014615 * Math.cos(2 * beta)) - (0.040849 * Math.sin(2 * beta)));
    R = 15 * TZ;
    var G = 18;
    var Z = 12 + ((R - L) / 15) - (T / 60);
    var U =  (180 / (15 * Math.PI)) * Math.acos((Math.sin((-0.8333 - 0.0347 * (H / Math.abs(H)) * Math.sqrt(Math.abs(H))) * (Math.PI / 180)) - Math.sin(D * (Math.PI / 180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI / 180)) * Math.cos(B * (Math.PI/180))));
    var Vd = (180 / (15 * Math.PI)) * Math.acos((-Math.sin(Gd * (Math.PI / 180)) - Math.sin(D * (Math.PI/180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI/180)) * Math.cos(B * (Math.PI/180))));
    var Vn = (180 / (15 * Math.PI)) * Math.acos((-Math.sin(Gn * (Math.PI / 180)) - Math.sin(D * (Math.PI/180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI/180)) * Math.cos(B * (Math.PI/180))));
    var W =  (180 / (15 * Math.PI)) * Math.acos((Math.sin(Math.atan(1/(Sh+Math.tan(Math.abs(B - D)*Math.PI/180))))-Math.sin(D*Math.PI/180)*Math.sin(B*Math.PI/180))/(Math.cos(D*Math.PI/180)*Math.cos(B*Math.PI/180)));
    
        
    document.getElementById('21').innerHTML = FormatTime(Z-Vd);
    document.getElementById('22').innerHTML = FormatTime(Z-U);
    document.getElementById('23').innerHTML = FormatTime(Z);
    document.getElementById('24').innerHTML = FormatTime(Z+W);
    document.getElementById('25').innerHTML = FormatTime(Z+U);
    document.getElementById('26').innerHTML = FormatTime(Z+Vn);
       
        
    }
    
    function FormatTime(x) {
        var hour =  Math.floor(x);
        var minute = Math.floor((x - hour) * 60);
        var second = Math.floor((((x - hour) * 60) - minute) * 60);
        return (hour + ':' + minute + ':' + second);
    }
    
    function Sharjaprayer(t)
{

 var today = new Date(t);
    var J = 0;                                  // Day of year
    var H = 4;                                  // The height above sea level in meters
    var D = 0;                                  // Solar Declination (Degrees)
    var T = 0;                                  // Equation of Time (Minutes)
    var Gd = 19;                                // Dawn’s Twilight Angle (15°-19°)
    var Gn = 19;                                // Night’s Twilight Angle (15°-19°)
    var B = 25.37;                               // Latitude (Degrees)
    var L = 55.41;                              // Longitude (Degrees)
    var TZ = 4;                                 // Time Zone (Hours)
    var R = 0;                                  // Reference Longitude (Degrees)  
    var Sh = 1;                                 // Sh=1 (Shafii) - Sh=2 (Hanafi)
    var firstYear = new Date(t);
    
    firstYear.setMonth(0);
    firstYear.setDate(1);
    J = (today - firstYear) / 86400000;
	var beta = 2 * Math.PI * J / 365            // Year angle
	D = (180/Math.PI) * (0.006918 - (0.399912 * Math.cos(beta)) + (0.070257 * Math.sin(beta)) - (0.006758 * Math.cos(2 * beta)) + (0.000907 * Math.sin(2 * beta)) - (0.002697 * Math.cos(3 * beta)) + (0.001480 * Math.sin(3 * beta)));
	T = 229.18 * (0.000075 + (0.001868 * Math.cos(beta)) - (0.032077 * Math.sin(beta)) - (0.014615 * Math.cos(2 * beta)) - (0.040849 * Math.sin(2 * beta)));
    R = 15 * TZ;
    var G = 18;
    var Z = 12 + ((R - L) / 15) - (T / 60);
    var U =  (180 / (15 * Math.PI)) * Math.acos((Math.sin((-0.8333 - 0.0347 * (H / Math.abs(H)) * Math.sqrt(Math.abs(H))) * (Math.PI / 180)) - Math.sin(D * (Math.PI / 180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI / 180)) * Math.cos(B * (Math.PI/180))));
    var Vd = (180 / (15 * Math.PI)) * Math.acos((-Math.sin(Gd * (Math.PI / 180)) - Math.sin(D * (Math.PI/180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI/180)) * Math.cos(B * (Math.PI/180))));
    var Vn = (180 / (15 * Math.PI)) * Math.acos((-Math.sin(Gn * (Math.PI / 180)) - Math.sin(D * (Math.PI/180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI/180)) * Math.cos(B * (Math.PI/180))));
    var W =  (180 / (15 * Math.PI)) * Math.acos((Math.sin(Math.atan(1/(Sh+Math.tan(Math.abs(B - D)*Math.PI/180))))-Math.sin(D*Math.PI/180)*Math.sin(B*Math.PI/180))/(Math.cos(D*Math.PI/180)*Math.cos(B*Math.PI/180)));
    
    
    
    document.getElementById('31').innerHTML = FormatTime(Z-Vd);
    document.getElementById('32').innerHTML = FormatTime(Z-U);
    document.getElementById('33').innerHTML = FormatTime(Z);
    document.getElementById('34').innerHTML = FormatTime(Z+W);
    document.getElementById('35').innerHTML = FormatTime(Z+U);
    document.getElementById('36').innerHTML = FormatTime(Z+Vn);
       
        
    }
    
    function FormatTime(x) {
        var hour =  Math.floor(x);
        var minute = Math.floor((x - hour) * 60);
        var second = Math.floor((((x - hour) * 60) - minute) * 60);
        return (hour + ':' + minute + ':' + second);
    }
    
    function Ajmanprayer(t)
{

 var today = new Date(t);
    var J = 0;                                  // Day of year
    var H = 4;                                  // The height above sea level in meters
    var D = 0;                                  // Solar Declination (Degrees)
    var T = 0;                                  // Equation of Time (Minutes)
    var Gd = 19;                                // Dawn’s Twilight Angle (15°-19°)
    var Gn = 19;                                // Night’s Twilight Angle (15°-19°)
    var B = 25.25;                               // Latitude (Degrees)
    var L = 55.30;                              // Longitude (Degrees)
    var TZ = 4;                                 // Time Zone (Hours)
    var R = 0;                                  // Reference Longitude (Degrees)  
    var Sh = 1;                                 // Sh=1 (Shafii) - Sh=2 (Hanafi)
    var firstYear = new Date(t);
    
    firstYear.setMonth(0);
    firstYear.setDate(1);
    J = (today - firstYear) / 86400000;
	var beta = 2 * Math.PI * J / 365            // Year angle
	D = (180/Math.PI) * (0.006918 - (0.399912 * Math.cos(beta)) + (0.070257 * Math.sin(beta)) - (0.006758 * Math.cos(2 * beta)) + (0.000907 * Math.sin(2 * beta)) - (0.002697 * Math.cos(3 * beta)) + (0.001480 * Math.sin(3 * beta)));
	T = 229.18 * (0.000075 + (0.001868 * Math.cos(beta)) - (0.032077 * Math.sin(beta)) - (0.014615 * Math.cos(2 * beta)) - (0.040849 * Math.sin(2 * beta)));
    R = 15 * TZ;
    var G = 18;
    var Z = 12 + ((R - L) / 15) - (T / 60);
    var U =  (180 / (15 * Math.PI)) * Math.acos((Math.sin((-0.8333 - 0.0347 * (H / Math.abs(H)) * Math.sqrt(Math.abs(H))) * (Math.PI / 180)) - Math.sin(D * (Math.PI / 180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI / 180)) * Math.cos(B * (Math.PI/180))));
    var Vd = (180 / (15 * Math.PI)) * Math.acos((-Math.sin(Gd * (Math.PI / 180)) - Math.sin(D * (Math.PI/180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI/180)) * Math.cos(B * (Math.PI/180))));
    var Vn = (180 / (15 * Math.PI)) * Math.acos((-Math.sin(Gn * (Math.PI / 180)) - Math.sin(D * (Math.PI/180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI/180)) * Math.cos(B * (Math.PI/180))));
    var W =  (180 / (15 * Math.PI)) * Math.acos((Math.sin(Math.atan(1/(Sh+Math.tan(Math.abs(B - D)*Math.PI/180))))-Math.sin(D*Math.PI/180)*Math.sin(B*Math.PI/180))/(Math.cos(D*Math.PI/180)*Math.cos(B*Math.PI/180)));
    
    
    
    document.getElementById('41').innerHTML = FormatTime(Z-Vd);
    document.getElementById('42').innerHTML = FormatTime(Z-U);
    document.getElementById('43').innerHTML = FormatTime(Z);
    document.getElementById('44').innerHTML = FormatTime(Z+W);
    document.getElementById('45').innerHTML = FormatTime(Z+U);
    document.getElementById('46').innerHTML = FormatTime(Z+Vn);
       
        
    }
    
    function FormatTime(x) {
        var hour =  Math.floor(x);
        var minute = Math.floor((x - hour) * 60);
        var second = Math.floor((((x - hour) * 60) - minute) * 60);
        return (hour + ':' + minute + ':' + second);
    }
    
    
    function UmAlQyaunprayer(t)
{

 var today = new Date(t);
    var J = 0;                                  // Day of year
    var H = 4;                                  // The height above sea level in meters
    var D = 0;                                  // Solar Declination (Degrees)
    var T = 0;                                  // Equation of Time (Minutes)
    var Gd = 19;                                // Dawn’s Twilight Angle (15°-19°)
    var Gn = 19;                                // Night’s Twilight Angle (15°-19°)
    var B = 25.56;                               // Latitude (Degrees)
    var L = 55.55;                              // Longitude (Degrees)
    var TZ = 4;                                 // Time Zone (Hours)
    var R = 0;                                  // Reference Longitude (Degrees)  
    var Sh = 1;                                 // Sh=1 (Shafii) - Sh=2 (Hanafi)
    var firstYear = new Date(t);
    
    firstYear.setMonth(0);
    firstYear.setDate(1);
    J = (today - firstYear) / 86400000;
	var beta = 2 * Math.PI * J / 365            // Year angle
	D = (180/Math.PI) * (0.006918 - (0.399912 * Math.cos(beta)) + (0.070257 * Math.sin(beta)) - (0.006758 * Math.cos(2 * beta)) + (0.000907 * Math.sin(2 * beta)) - (0.002697 * Math.cos(3 * beta)) + (0.001480 * Math.sin(3 * beta)));
	T = 229.18 * (0.000075 + (0.001868 * Math.cos(beta)) - (0.032077 * Math.sin(beta)) - (0.014615 * Math.cos(2 * beta)) - (0.040849 * Math.sin(2 * beta)));
    R = 15 * TZ;
    var G = 18;
    var Z = 12 + ((R - L) / 15) - (T / 60);
    var U =  (180 / (15 * Math.PI)) * Math.acos((Math.sin((-0.8333 - 0.0347 * (H / Math.abs(H)) * Math.sqrt(Math.abs(H))) * (Math.PI / 180)) - Math.sin(D * (Math.PI / 180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI / 180)) * Math.cos(B * (Math.PI/180))));
    var Vd = (180 / (15 * Math.PI)) * Math.acos((-Math.sin(Gd * (Math.PI / 180)) - Math.sin(D * (Math.PI/180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI/180)) * Math.cos(B * (Math.PI/180))));
    var Vn = (180 / (15 * Math.PI)) * Math.acos((-Math.sin(Gn * (Math.PI / 180)) - Math.sin(D * (Math.PI/180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI/180)) * Math.cos(B * (Math.PI/180))));
    var W =  (180 / (15 * Math.PI)) * Math.acos((Math.sin(Math.atan(1/(Sh+Math.tan(Math.abs(B - D)*Math.PI/180))))-Math.sin(D*Math.PI/180)*Math.sin(B*Math.PI/180))/(Math.cos(D*Math.PI/180)*Math.cos(B*Math.PI/180)));
    
    
    
    document.getElementById('51').innerHTML = FormatTime(Z-Vd);
    document.getElementById('52').innerHTML = FormatTime(Z-U);
    document.getElementById('53').innerHTML = FormatTime(Z);
    document.getElementById('54').innerHTML = FormatTime(Z+W);
    document.getElementById('55').innerHTML = FormatTime(Z+U);
    document.getElementById('56').innerHTML = FormatTime(Z+Vn);
       
        
    }
    
    function FormatTime(x) {
        var hour =  Math.floor(x);
        var minute = Math.floor((x - hour) * 60);
        var second = Math.floor((((x - hour) * 60) - minute) * 60);
        return (hour + ':' + minute + ':' + second);
    }
    
    
    function AlFujairaPrayer(t)
{

 var today = new Date(t);
    var J = 0;                                  // Day of year
    var H = 4;                                  // The height above sea level in meters
    var D = 0;                                  // Solar Declination (Degrees)
    var T = 0;                                  // Equation of Time (Minutes)
    var Gd = 19;                                // Dawn’s Twilight Angle (15°-19°)
    var Gn = 19;                                // Night’s Twilight Angle (15°-19°)
    var B = 25.07;                               // Latitude (Degrees)
    var L = 56.18;                              // Longitude (Degrees)
    var TZ = 4;                                 // Time Zone (Hours)
    var R = 0;                                  // Reference Longitude (Degrees)  
    var Sh = 1;                                 // Sh=1 (Shafii) - Sh=2 (Hanafi)
    var firstYear = new Date(t);
    
    firstYear.setMonth(0);
    firstYear.setDate(1);
    J = (today - firstYear) / 86400000;
	var beta = 2 * Math.PI * J / 365            // Year angle
	D = (180/Math.PI) * (0.006918 - (0.399912 * Math.cos(beta)) + (0.070257 * Math.sin(beta)) - (0.006758 * Math.cos(2 * beta)) + (0.000907 * Math.sin(2 * beta)) - (0.002697 * Math.cos(3 * beta)) + (0.001480 * Math.sin(3 * beta)));
	T = 229.18 * (0.000075 + (0.001868 * Math.cos(beta)) - (0.032077 * Math.sin(beta)) - (0.014615 * Math.cos(2 * beta)) - (0.040849 * Math.sin(2 * beta)));
    R = 15 * TZ;
    var G = 18;
    var Z = 12 + ((R - L) / 15) - (T / 60);
    var U =  (180 / (15 * Math.PI)) * Math.acos((Math.sin((-0.8333 - 0.0347 * (H / Math.abs(H)) * Math.sqrt(Math.abs(H))) * (Math.PI / 180)) - Math.sin(D * (Math.PI / 180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI / 180)) * Math.cos(B * (Math.PI/180))));
    var Vd = (180 / (15 * Math.PI)) * Math.acos((-Math.sin(Gd * (Math.PI / 180)) - Math.sin(D * (Math.PI/180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI/180)) * Math.cos(B * (Math.PI/180))));
    var Vn = (180 / (15 * Math.PI)) * Math.acos((-Math.sin(Gn * (Math.PI / 180)) - Math.sin(D * (Math.PI/180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI/180)) * Math.cos(B * (Math.PI/180))));
    var W =  (180 / (15 * Math.PI)) * Math.acos((Math.sin(Math.atan(1/(Sh+Math.tan(Math.abs(B - D)*Math.PI/180))))-Math.sin(D*Math.PI/180)*Math.sin(B*Math.PI/180))/(Math.cos(D*Math.PI/180)*Math.cos(B*Math.PI/180)));
    
    
    
    document.getElementById('61').innerHTML = FormatTime(Z-Vd);
    document.getElementById('62').innerHTML = FormatTime(Z-U);
    document.getElementById('63').innerHTML = FormatTime(Z);
    document.getElementById('64').innerHTML = FormatTime(Z+W);
    document.getElementById('65').innerHTML = FormatTime(Z+U);
    document.getElementById('66').innerHTML = FormatTime(Z+Vn);
       
        
    }
    
    function FormatTime(x) {
        var hour =  Math.floor(x);
        var minute = Math.floor((x - hour) * 60);
        var second = Math.floor((((x - hour) * 60) - minute) * 60);
        return (hour + ':' + minute + ':' + second);
    }
    
    
    function RasAlKhaymaPrayer(t)
{

 var today = new Date(t);
    var J = 0;                                  // Day of year
    var H = 4;                                  // The height above sea level in meters
    var D = 0;                                  // Solar Declination (Degrees)
    var T = 0;                                  // Equation of Time (Minutes)
    var Gd = 19;                                // Dawn’s Twilight Angle (15°-19°)
    var Gn = 19;                                // Night’s Twilight Angle (15°-19°)
    var B = 25.50;                               // Latitude (Degrees)
    var L = 56.59;                              // Longitude (Degrees)
    var TZ = 4;                                 // Time Zone (Hours)
    var R = 0;                                  // Reference Longitude (Degrees)  
    var Sh = 1;                                 // Sh=1 (Shafii) - Sh=2 (Hanafi)
    var firstYear = new Date(t);
    
    firstYear.setMonth(0);
    firstYear.setDate(1);
    J = (today - firstYear) / 86400000;    
	var beta = 2 * Math.PI * J / 365            // Year angle
	D = (180/Math.PI) * (0.006918 - (0.399912 * Math.cos(beta)) + (0.070257 * Math.sin(beta)) - (0.006758 * Math.cos(2 * beta)) + (0.000907 * Math.sin(2 * beta)) - (0.002697 * Math.cos(3 * beta)) + (0.001480 * Math.sin(3 * beta)));
	T = 229.18 * (0.000075 + (0.001868 * Math.cos(beta)) - (0.032077 * Math.sin(beta)) - (0.014615 * Math.cos(2 * beta)) - (0.040849 * Math.sin(2 * beta)));
    R = 15 * TZ;
    var G = 18;
    var Z = 12 + ((R - L) / 15) - (T / 60);
    var U =  (180 / (15 * Math.PI)) * Math.acos((Math.sin((-0.8333 - 0.0347 * (H / Math.abs(H)) * Math.sqrt(Math.abs(H))) * (Math.PI / 180)) - Math.sin(D * (Math.PI / 180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI / 180)) * Math.cos(B * (Math.PI/180))));
    var Vd = (180 / (15 * Math.PI)) * Math.acos((-Math.sin(Gd * (Math.PI / 180)) - Math.sin(D * (Math.PI/180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI/180)) * Math.cos(B * (Math.PI/180))));
    var Vn = (180 / (15 * Math.PI)) * Math.acos((-Math.sin(Gn * (Math.PI / 180)) - Math.sin(D * (Math.PI/180)) * Math.sin(B * (Math.PI / 180))) / (Math.cos(D * (Math.PI/180)) * Math.cos(B * (Math.PI/180))));
    var W =  (180 / (15 * Math.PI)) * Math.acos((Math.sin(Math.atan(1/(Sh+Math.tan(Math.abs(B - D)*Math.PI/180))))-Math.sin(D*Math.PI/180)*Math.sin(B*Math.PI/180))/(Math.cos(D*Math.PI/180)*Math.cos(B*Math.PI/180)));
    
    
    
    document.getElementById('71').innerHTML = FormatTime(Z-Vd);
    document.getElementById('72').innerHTML = FormatTime(Z-U);
    document.getElementById('73').innerHTML = FormatTime(Z);
    document.getElementById('74').innerHTML = FormatTime(Z+W);
    document.getElementById('75').innerHTML = FormatTime(Z+U);
    document.getElementById('76').innerHTML = FormatTime(Z+Vn);
       
        
    }
    
    function FormatTime(x) {
        var hour =  Math.floor(x);
        var minute = Math.floor((x - hour) * 60);
        var second = Math.floor((((x - hour) * 60) - minute) * 60);
        return (hour + ':' + minute + ':' + second);
    }
    
    function PrayerTime(t)
    {    
    Dubaiprayer(t);
    AbuDhabiprayer(t);
    Sharjaprayer(t);
    Ajmanprayer(t);
    UmAlQyaunprayer(t);
    AlFujairaPrayer(t);
    RasAlKhaymaPrayer(t);

    }
    
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////   


function clickbutton()
{

var obj=document.getElementsByName("chkcareergroup");
for (var i = 0; i < document.getElementsByName("chkcareergroup").length; i++)
 {

      if (obj[i].checked)
      {
     
        var title=obj[i].value       
        break
      }
      else
      {
       
      var title=0
      
      }
      
      
   }   
   window.open('popup/approvalcareer.aspx?title='+title);
}


///////////avoid click here to activate this control
function activectrl() 
{
    theObjects = document.getElementsByTagName("object");
    for (var i = 0; i < theObjects.length; i++)
        {
        
            theObjects[i].outerHTML = theObjects[i].outerHTML;
            
        }
} 
////////////////////////////////////////////////////



function SelectSportApplicant()
{
var obj=document.getElementsByName("tendergroup");


}

function clicktenderbutton()
{

var obj=document.getElementsByName("tendergroup");
for (var i = 0; i < document.getElementsByName("tendergroup").length; i++)
 {

      if (obj[i].checked)
      {
     
        var tid=obj[i].value       
        break
      }
      else
      {
       
      var tid=0
      
      }
      
      
   } 
  
   if (tid!=0)
   {
    window.open('popup/tenderSubmit.aspx?tid='+tid);
   }
   else
   {  
    alert('Please select any tender');
 
   }
}

function clickcoursebutton()
{

var obj=document.getElementsByName("coursegroup");
for (var i = 0; i < document.getElementsByName("coursegroup").length; i++)
 {

      if (obj[i].checked)
      {
     
        var cid=obj[i].value       
        break
      }
      else
      {
       
      var cid=0
      
      }
      
      
   } 
  
   if (cid!=0)
   {
    window.open('popup/SendCourses.aspx?courseid='+cid);
   }
   else
   {  
    alert('Please select any course');
 
   }
}



	






