/* Playlist */
var plblk_templ='<div class="movie_name" style="width:432px;z-index:100">%vtitle%</div><div class="flashpl" style="margin-top:-37px;position:relative;"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0" width="432px" height="324px"><param name="movie" value="../flash/player.swf" /><param name="quality" value="high" /><param name="wmode" value="opaque" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="bgcolor" value="#EEEEEE" /><param name="FlashVars" value="file=%vlink%&image=%scrlink%&controlbar=over" /><embed src="../flash/player.swf" width="432px" height="324px" wmode="opaque" bgcolor="#EEEEEE" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowfullscreen="true" flashvars="file=%vlink%&image=%scrlink%&controlbar=over" /></object></div>';
function playlist (li_el) {
	
	var lis=document.getElementById('play_list').getElementsByTagName('a');
	var ii=0;  
	while(lis[ii]){		
	  lis[ii].style.background='transparent';
    lis[ii].style.fontWeight='normal';    
		ii++;
	}
  
  
  lis=document.getElementById('play_list').getElementsByTagName('li');
	ii=0;
  var num;
	while(lis[ii]){		
	  if(lis[ii]==li_el){
      num=ii+1;
      break;
    }
		ii++;
	}
   
	li_el.firstChild.style.background = '#1A3853';
	li_el.firstChild.style.fontWeight='bold';
  
  var vtitle=li_el.firstChild.innerHTML;
  var plParams=li_el.lang.split('::');
  
  var video2html=plblk_templ.replace(new RegExp('%vtitle%','gi'),num+'.&nbsp;'+vtitle);
  video2html=video2html.replace(new RegExp('%vlink%','gi'),plParams[0]);
  video2html=video2html.replace(new RegExp('%scrlink%','gi'),plParams[1]);
  //alert(video2html);
  document.getElementById('video2').innerHTML=video2html;
	//li_el.firstChild.style.marginLeft='-34px';
	//li_el.firstChild.style.marginRight='-4px';
	//li_el.firstChild.style.paddingLeft='34px';	
}
/* Playlist */

/* Upload */
var colorbackup;
var colorbackup_span;

function upload_photo (menu_choise) {
	document.getElementById('movies').style.background = "#f9e6e6";
	document.getElementById('mov').style.background = "#796649";
	document.getElementById('upl_photo').style.display = "block";
	document.getElementById('upl_movie').style.display = "none";	
	document.getElementById('mov').firstChild.style.color = "#dbcbb6";
	document.getElementById('pho').firstChild.style.color = "#fff";
	$$('div.r_img_r')[0].style.background = "#3c3526";
	menu_choise.style.background = "#3c3526";
	$$('div.r_img_l')[0].style.background = "#796649";
	colorbackup = "#3c3526";
	colorbackup_span = "#ffffff";
}
function upload_movie (menu_choise) {
	document.getElementById('movies').style.background = "#e1ebf3";
	document.getElementById('pho').style.background = "#796649";
	document.getElementById('upl_photo').style.display = "none";
	document.getElementById('upl_movie').style.display = "block";
	document.getElementById('mov').firstChild.style.color = "#fff";
	document.getElementById('pho').firstChild.style.color = "#dbcbb6";
	$$('div.r_img_r')[0].style.background = "#796649";
	menu_choise.style.background = "#3c3526";
	$$('div.r_img_l')[0].style.background = "#3c3526";
	colorbackup = "#3c3526";
	colorbackup_span = "#ffffff";
}

function over_photo (menu_choise) {
	var gf = "rgb(60, 53, 38)";
	var current_bg = menu_choise.style.backgroundColor;
	if (current_bg != gf) {
	/*alert('active color: '+gf+'\n'+'current color: '+current_bg);*/
	menu_choise.style.cursor = "pointer";
	colorbackup = document.getElementById('pho').style.backgroundColor;
	colorbackup_span = document.getElementById('pho').firstChild.style.color;
	document.getElementById('pho').style.backgroundColor = "#554934";
	document.getElementById('pho').firstChild.style.color = "#f1eae2";
	$$('div.r_img_r')[0].style.background = "#554934";
	}
	else {menu_choise.style.cursor = "default"}	
}
function out_photo (menu_choise) {
	var gf = "rgb(60, 53, 38)";
	var current_bg = menu_choise.style.backgroundColor;
	if (current_bg != gf) {

	document.getElementById('pho').style.backgroundColor = colorbackup;
	document.getElementById('pho').firstChild.style.color = colorbackup_span;
	$$('div.r_img_r')[0].style.background = colorbackup;
	}
}

function over_movie (menu_choise) {
	var gf = "rgb(60, 53, 38)";
	var current_bg = menu_choise.style.backgroundColor;
	if (current_bg != gf) {
	/*alert('active color: '+gf+'\n'+'current color: '+current_bg);*/
	menu_choise.style.cursor = "pointer";
	colorbackup = document.getElementById('mov').style.backgroundColor;
	colorbackup_span = document.getElementById('mov').firstChild.style.color;
	document.getElementById('mov').style.backgroundColor = "#554934";
	document.getElementById('mov').firstChild.style.color = "#f1eae2";
	$$('div.r_img_l')[0].style.background = "#554934";
	}
	else {menu_choise.style.cursor = "default"}
}
function out_movie (menu_choise) {
	var gf = "rgb(60, 53, 38)";
	var current_bg = menu_choise.style.backgroundColor;
	if (current_bg != gf) {

	document.getElementById('mov').style.backgroundColor = colorbackup;
	document.getElementById('mov').firstChild.style.color = colorbackup_span;
	$$('div.r_img_l')[0].style.background = colorbackup;
	}
}
/* Upload */

/* Bookmark */
var urlAddress = document.location;
var pageName = document.title;

function bookmark_(){
    if (window.sidebar) // firefox
    window.sidebar.addPanel(pageName, urlAddress, "");
    else if(window.opera && window.print){ // opera
    var elem = document.createElement('a');
    elem.setAttribute('href',urlAddress);
    elem.setAttribute('title',pageName);
    elem.setAttribute('rel','sidebar');
    elem.click();
    }    else if(document.all)// ie
    window.external.AddFavorite(urlAddress, pageName);
}
/* Bookmark */
