/*function changeHeight(page) {
		page=page.split("#");
		page=page[0];
		page=page.split("?");
		page=page[0];
	if (!document.styleSheets) return;
			var theRules = new Array();
	if (document.styleSheets[0].cssRules)
		theRules = document.styleSheets[0].cssRules;
	else if (document.styleSheets[0].rules)
		theRules = document.styleSheets[0].rules;
	else return;
	switch(page) {
		case 'rooms/rooms.php':
			theRules[1].style.height = '3200px';
			theRules[0].style.height = '3205px';
		break;
		case 'main.php':
			theRules[1].style.height = '1400px';
			theRules[0].style.height = '1405px';
		break;
		case 'soft/soft.php':
		case 'links/links.php':
			theRules[1].style.height = '1600px';
			theRules[0].style.height = '1605px';
		break;
		case 'promo/promo.php':
			theRules[1].style.height = '3800px';
			theRules[0].style.height = '3805px';
		break;
		case 'strategy/strategy.php':
			theRules[1].style.height = '1800px';
			theRules[0].style.height = '1805px';
		break;
		case 'forum/forum.php':
			theRules[1].style.height = '1800px';
			theRules[0].style.height = '1805px';
		break;
		case 'freeroll/freeroll.php':
			theRules[1].style.height = '1700px';
			theRules[0].style.height = '1705px';
		break;
	}
}*/

/*function vote(url, number, frame){
	var vote_field='vote_field'+number;
	var rutan=document.getElementById(vote_field);
	var addedrating=rutan.value;
	if (addedrating!='' && (addedrating.length<3 || addedrating=='100')){
		rutan.value='';
		var mainiframe=parent.document.getElementById(frame);
		var active=window.location.href;
		alert(active);
		mainiframe.src=active+'?vote=vote' + '&' + 'var1=' + url + '&' + 'var2=' + addedrating;
	}
}*/

function openComment (c) {
	window.open(c,
	'window',
	'width=750,height=650,scrollbars=no,status=yes,toolbar=no,directories=no,location=no,menubar=no,left=300,top=0');
}
function test(name) {
		alert(name);
}
function clickstat(name, from) {
	var addclickframe=parent.document.getElementById('addclickframe');

	switch (from) {
		case 'link':
		case 'soft':
			var type="other";
			break;
		default:
			var type="rooms";
			break;
	}
	var source='clickstat.php?name='+name+'&from='+from+'&type='+type;
	addclickframe.src=source;
}

/*function checkFrame() {
	if (!parent.document.getElementById('mainiframe')) {
		var active=window.location.pathname;
		active=active.slice(1);
		window.location.replace('/index.php?page='+active);
	}
}*/
function startCount(id, hours, minutes, seconds) {
	
	seconds=seconds-1;
	if (seconds==-1) {
		seconds=59;
		minutes=minutes-1;
	}
	if (minutes==-1) {
		minutes=59;
		hours=hours-1;
	}
	if (hours==-1) {
		window.location.href=window.location.href;
		
	}
	print_hours=hours;
	print_minutes=minutes;
	print_seconds=seconds;
	if (hours <= 9) print_hours = "0" + hours;
	if (minutes <= 9) print_minutes = "0" + minutes;
	if (seconds <= 9) print_seconds = "0" + seconds;
	time = print_hours + "h " + print_minutes + "m " + print_seconds +'s';
	document.countdown.display_count.value = time;
	window.setTimeout("startCount("+id+', '+hours+', '+minutes+', '+seconds+");", 1000);
}
