
//-------------------------------------------------------------------//

var is_IE = navigator.appName.indexOf('Microsoft') != -1;
var is_Safari = navigator.userAgent.indexOf('Safari') != -1;
var is_Opera = navigator.userAgent.indexOf('Opera') != -1;


//-------------------------------------------------------------------//

              
function clearDefault(el) {
     if (el.defaultValue==el.value) el.value = ""            
}

//-------------------------------------------------------------------//

function showPopUp(video_id) {
	//var domain = '';

	//if(g_channel != 'default') domain = g_channel+'.';

	window.open('/index.php?action=send_video_popup&video_id='+video_id,'popup','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=580');

}

//-------------------------------------------------------------------//

function showAdminVideoPopUp(video_id) {
	window.open('/index.php?action=admin_video_popup&video_id='+video_id,'popup','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=500');
}

//-------------------------------------------------------------------//

function toggleTippBar() {
	if($F('tipp_bar') == 0){
		$('help').style.display = 'block';
		$('tipp_bar').value = 1;
		setTippBarCookie(1);
	}
	else{
		$('help').style.display = 'none';
		$('tipp_bar').value = 0;
		setTippBarCookie(0);
	}
}

//-------------------------------------------------------------------//

function getTippBarCookie() {
	var str = '';
	if (document.cookie.length > 0) {
		var cookiename = "v_tippbar";
		var quickStart = document.cookie.indexOf(cookiename+"=");

		if (quickStart != -1) {
			quickStart += cookiename.length+1;
      quickEnd = document.cookie.indexOf(";",quickStart);
			str = document.cookie.substring(quickStart,document.cookie.length+quickStart+quickEnd);
		}
	}

	return str;
}

//-------------------------------------------------------------------//

function setTippBarCookie(state) {
		if(state.length == 0) state = 0;

		var str = getTippBarCookie();

		var today = new Date();
    var expire = new Date();
		var separator = '';

    expire.setTime(today.getTime() + 7*24*3600000);

		if(str.length > 0) {
			separator = ',';
		}
    document.cookie = "v_tippbar="+state+";expires="+expire.toGMTString()+";domain=videobomb.hu;path=/;";
}

//-------------------------------------------------------------------//

function changeTopVideos(key) {

	for(n=1;n<4;n++) {
		if(n == key) {
			$('box-top-'+n).style.display = 'block';
			$('box-top-a-'+n).className = 'color-2 selected';
		}
		else {
			$('box-top-'+n).style.display = 'none';
			$('box-top-a-'+n).className = 'color-2';
		}
	}
}

//-------------------------------------------------------------------//

function changeTopUsers(key) {

	for(n=2006;n<=2008;n++) {
		if(n == key) {
			$('box-topu-'+n).style.display = 'block';
			$('box-topu-a-'+n).className = 'color-2 selected';
		}
		else {
			$('box-topu-'+n).style.display = 'none';
			$('box-topu-a-'+n).className = 'color-2';
		}
	}
}

//-------------------------------------------------------------------//

function changeEditorVideos(key) {

	for(n=0;n<=2;n++) {
		if(n == key) {
			$('box-tope-'+n).style.display = 'block';
			$('box-tope-a-'+n).className = 'color-2 selected';
		}
		else {
			$('box-tope-'+n).style.display = 'none';
			$('box-tope-a-'+n).className = 'color-2';
		}
	}
}

//-------------------------------------------------------------------//

function changeRelatedVideos(key) {

	for(n=1;n<4;n++) {
		if(n == key) {
			$('box-related-'+n).style.display = 'block';
			$('box-rel-a-'+n).className = 'color-2 selected';
		}
		else {
			$('box-related-'+n).style.display = 'none';
			$('box-rel-a-'+n).className = 'color-2';
		}
	}
}

//-------------------------------------------------------------------//

function fullScreen(hash) {
	parent.window.open('/fullscreen.php?hash='+hash);
}

//-------------------------------------------------------------------//


function clearField(el) {
  if (el.defaultValue==el.value) el.value = "";
}
  
function adocean( name, margin_top, margin_bottom ) {
    document.write( '<div style="margin-top: ' + margin_top + 'px; margin-bottom: ' + margin_bottom + 'px;" id="' + name + '_container">' );
    document.write( '<div id="' + name + '"></div><script type="text/javascript">ado.slave(\'' + name + '\', {myMaster: \'' + bannerCode + '\' });</script>' );
    document.write( '</div>' );
}
				    
function placeadocean( name, margin_top, margin_bottom ) {
    document.write( '<div style="margin-top: ' + margin_top + 'px; margin-bottom: ' + margin_bottom + 'px;" id="' + name + '_container">' );
    document.write( '<div id="' + name + '"></div><script type="text/javascript">ado.placement( { id: \'' + name + '\', server: \'indexhu.adocean.pl\' });</script>' );
    document.write( '</div>' );
}									