/*        SCRIPT 4 E-MEDIA'S SITE         */

function doRollover(imageID, imageSource)

		{
			document.getElementById(imageID).src = imageSource;
		}
		
function gotoUrl(URL) {

		window.location = URL;
		
}



// SCRIPT : TYPER

/* Creation Date: 14th May, 2006.
Subtract of: cplib.js by Alex Davidovic, alex.d@c-point.com              
 Copyright 2002-2005 C Point                                             
This script is free for personal, educational, and commercial use  
 provided that this header is left unmodified                       
                                                                  
          Created with Antechinus JavaScript Editor                
                       www.c-point.com
					   
					   
*/


var speed = 50;                   // scroller speed             
var msg = new Array()
msg[0] = "You are highly welcome";
var cursor_color = '#000066'
var ticker_top = 80
var ticker_left = 80

//**************//

var pics = new Array()
pics[0] = ''
var temp = "";
var temp2 = "";
var count = 0;
var count2 = 1;
var count3 = 0;
var tag = 0;


function set_scroller()
 {
  document.all.scroll_holder.style.top   = ticker_top; 
  document.all.scroll_holder.style.left  = ticker_left; 
  scroller();
 }
 
 function scroller()
 {
  switch (count3) // change timings for different parts of message
  {
   case 0:   msg_delay = 3000; break
   case 2:   msg_delay = 200;  break
   case 7:   msg_delay = 3000; break
  }  
  if (count3 < msg.length)
   {   
	if (count2 < msg[count3].length + 1)
     {
      temp = msg[count3].substring(count,count2);
	  temp2+=temp;
      count++;
	  count2++;
	  if(temp=="<"||temp==">")status = temp
      document.all.scroller.innerHTML = temp2 + "<font color='"+cursor_color+"'>_</font>";
      setTimeout('scroller();',speed);
     } 
	else
	 {
      document.all.scroller.innerHTML = temp2 + "<font color='"+cursor_color+"'><blink>_</blink></font>";
	  count = 0;
	  count2 = 1;
	  count3++;
	  setTimeout('scroller();',msg_delay);
	 }
   }
  else
   {
    count = 0;
	count2 = 1;
	temp2 = ""; // reset the entire message
	count3 = 0;
	setTimeout('scroller();',msg_delay);    
   }
 }
 
 function doBlink() 
 {
  // Blink, Blink, Blink...
  var blink = document.all.tags("BLINK")
  for (var i=0; i < blink.length; i++)
    blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "" 
 }
 
  //Script 4 Date!!!
   
   function doDate() {
   
  //Variable 'now' which contains current date
  now = new Date();
										   // Specification for variable 'day'
									if (now.getDay() == 0) { day = "Sunday"; }
									if (now.getDay() == 1) { day = "Monday"; }
									if (now.getDay() == 2) { day = "Tuesday"; }
									if (now.getDay() == 3) { day = "Wednesday"; }
									if (now.getDay() == 4) { day = "Thursday"; }
									if (now.getDay() == 5) { day = "Friday"; }
									if (now.getDay() == 6) { day = "Saturday"; }
										  // Specification for variable 'month'
									if (now.getMonth() == 0) { Month = "January"; }
									if (now.getMonth() == 1) { Month = "February"; }
									if (now.getMonth() == 2) { Month = "March"; }
									if (now.getMonth() == 3) { Month = "April"; }
									if (now.getMonth() == 4) { Month = "May"; }
									if (now.getMonth() == 5) { Month = "June"; }
									if (now.getMonth() == 6) { Month = "July"; }
									if (now.getMonth() == 7) { Month = "August"; }
									if (now.getMonth() == 8) { Month = "September"; }
									if (now.getMonth() == 9) { Month = "October"; }
									if (now.getMonth() == 10) { Month = "November"; }
									if (now.getMonth() == 11) { Month = "December"; }
									//Word that comes after date!
			var dAtt;
			if ((now.getDate() == 1) || (now.getDate() == 21) || (now.getDate() == 31)) { dAtt = "st "; }
			else if ((now.getDate() == 2) || (now.getDate() == 22)) { dAtt = "nd "; }
			else if ((now.getDate() == 3) || (now.getDate() == 23)) { dAtt = "rd "; }
			else { dAtt = "th "; }
									
									//output
									
									document.write('<font class="date">');
									document.write(day + " " + now.getDate() + dAtt + Month + ", " + now.getFullYear() + ".");
									document.write('</font>');
									
}
 

// Script 4 Pop-up information when button is clicked on!!

function doInfo() {

	window.alert('Story already filed. For request, fill contact form.');
	
}
function doInfo2() {

	window.alert("For full news story and pictures, keep a date with e-media magazine's last quarter edition. (Oct-Dec 2006)");
	
}
function popUp(URL) {
  windowprop = "width=660,height=300,left=50,top=40,toolbars=no,scrollbars=yes";
  window.open(URL,"Pictures",windowprop);

}

/* SCRIPT FOR ALTERNATING IMAGE	*/

var imagelist = new Array();
var imagelink = "http://www.tahirguestpalace.com";
window.focus();
mycount = 0;
imagelist[0] = "images/tar_adv1.jpg";
imagelist[1] = "images/tar_adv.jpg";
imagelist[2] = "images/tar_adv2.jpg";
imagelink = new Array();
imagelink[0] = "http://www.tahirguestpalace.com";
imagelink[1] = "http://www.tahirguestpalace.com";
imagelink[2] = "http://www.tahirguestpalace.com";



function switch2a() {
 	
	setTimeout("switch2a()", 5000);
	if (mycount > imagelist.length-1) { mycount = 0; }
	advertlink = imagelink[mycount];
	if (document.all) //if IE 4+
	{
 		advert.src=imagelist[mycount]; 
	
	}else{
  		document.advert.src=imagelist[mycount];  	
	}
	mycount++;
		 
}