// JavaScript Document


function tipDiff(entry, days) {
	var diff = days % entry;
	return diff;
}

entry = ["All PlayNC Game Time Cards can be used for adding time for any NCsoft subs\cription. For example, you can use a \<em\>City of Villains\<sup\>TM\<\/sup\>\<\/em\> Game Time Card to add 60 days of time to your \<em\>Lineage II\<\/em\> game account.","A clan leader may transfer their rights to other clan members. The leader must request the clan leader transfer from an NPC who is in charge of clan activities. The new clan leader will assume their new role during the next maintenance time (10:00 AM Central on Tuesdays), or during a server downtime.","You can hide dropped items on the ground by selecting the option in the Game Options window. If you turn this function on, you can significantly reduce lag arising from the client. You cannot obtain hidden items on the ground by mouse, but you can use the Pick Up button.","The fishing skills Pumping and Reeling determine fishing success. These skills can be learned by paying adena to the Fisherman&#8217;s Guild Members. Use the Reeling skill while the fish struggles and resists, and the Pumping skill while the fish is exhausted.","The competition period for the Seven Signs is Monday 6:00 PM CST - Monday 6:00 PM CST. The seal validation period is Monday 6:15 PM CST - Monday 5:45 PM CST.","Matches in the Olympiad Coliseum are held from 6:00 PM CST to 12:00 AM CST (6:00 PM GMT+1 to 12:00 AM GMT+1 on the Teon and Franz servers).","The manor system opens for business every day at 8:00 PM CST (8:00 GMT+1 on Teon and Franz).",""]
category = ["http://www.lineage2.com/archive/2006/11/game_time_cards_1.html","http://www.lineage2.com/archive/2006/10/clan_leadership.html","http://www.lineage2.com/archive/2006/10/hide_items.html","http://www.lineage2.com/archive/2006/08/fishing_skills.html","http://www.lineage2.com/archive/2006/08/seven_signs_tim_2.html","http://www.lineage2.com/archive/2006/08/olympiad_compet.html","http://www.lineage2.com/archive/2006/08/manor_system.html",""]

var blank = entry.pop();
var numentry = entry.length; //number of entry in archive

//Set the two dates
var today = new Date();
var posted=new Date(2002, 8, 12);
//Set 1 day in milliseconds
var one_day=1000*60*60*24

//Calculate difference btw the two dates, and convert to days
var numDays = Math.floor((today.getTime()-posted.getTime())/(one_day));
var currTip = entry[tipDiff(numentry, numDays)];
var currCat = category[tipDiff(numentry, numDays)];



function RandomEntry() {
	document.write(currTip);
	if (homePage==1){
		if(currCat.indexOf('/castle_siege_taxes/', 0) != -1){
			document.write('<div style="text-align:right;  margin-top:5px; position:relative; left:30px;"><a href="/tip/tip_1.html"><IMG SRC="/images/main/tipbtn_gold.jpg" alt="More Tips"></a></div>');
		}else if(currCat.indexOf('/clans/', 0) != -1){
			document.write('<div style="text-align:right;  margin-top:5px; position:relative; left:30px;"><a href="/tip/tip_2.html"><IMG SRC="/images/main/tipbtn_gold.jpg" alt="More Tips"></a></div>');
		}else if(currCat.indexOf('/commerce_trade/', 0) != -1){
			document.write('<div style="text-align:right;  margin-top:5px; position:relative; left:30px;"><a href="/tip/tip_3.html"><IMG SRC="/images/main/tipbtn_gold.jpg" alt="More Tips"></a></div>');
		}else if(currCat.indexOf('/interface/', 0) != -1){
			document.write('<div style="text-align:right;  margin-top:5px; position:relative; left:30px;"><a href="/tip/tip_4.html"><IMG SRC="/images/main/tipbtn_gold.jpg" alt="More Tips"></a></div>');
		}else if(currCat.indexOf('/items/', 0) != -1){
			document.write('<div style="text-align:right;  margin-top:5px; position:relative; left:30px;"><a href="/tip/tip_5.html"><IMG SRC="/images/main/tipbtn_gold.jpg" alt="More Tips"></a></div>');
		}else if(currCat.indexOf('/petitions/', 0) != -1){
			document.write('<div style="text-align:right;  margin-top:5px; position:relative; left:30px;"><a href="/tip/tip_6.html"><IMG SRC="/images/main/tipbtn_gold.jpg" alt="More Tips"></a></div>');
		}else if(currCat.indexOf('/pets/', 0) != -1){
			document.write('<div style="text-align:right;  margin-top:5px; position:relative; left:30px;"><a href="/tip/tip_7.html"><IMG SRC="/images/main/tipbtn_gold.jpg" alt="More Tips"></a></div>');
		}else if(currCat.indexOf('/pvp_karma/', 0) != -1){
			document.write('<div style="text-align:right;  margin-top:5px; position:relative; left:30px;"><a href="/tip/tip_8.html"><IMG SRC="/images/main/tipbtn_gold.jpg" alt="More Tips"></a></div>');
		}else if(currCat.indexOf('/quests/', 0) != -1){
			document.write('<div style="text-align:right;  margin-top:5px; position:relative; left:30px;"><a href="/tip/tip_9.html"><IMG SRC="/images/main/tipbtn_gold.jpg" alt="More Tips"></a></div>');
		}else if(currCat.indexOf('/skills/', 0) != -1){
			document.write('<div style="text-align:right;  margin-top:5px; position:relative; left:30px;"><a href="/tip/tip_10.html"><IMG SRC="/images/main/tipbtn_gold.jpg" alt="More Tips"></a></div>');
		}else if(currCat.indexOf('/your_account/', 0) != -1){
			document.write('<div style="text-align:right;  margin-top:5px; position:relative; left:30px;"><a href="/tip/tip_11.html"><IMG SRC="/images/main/tipbtn_gold.jpg" alt="More Tips"></a></div>');
		}else{
			document.write('<div style="text-align:right;  margin-top:5px; position:relative; left:30px;"><a href="/tip/tip.html"><IMG SRC="/images/main/tipbtn_gold.jpg" alt="More Tips"></a></div>');
		}
	}
}