function AddVideoToFavorites() {

/* Steps to be performed 
1. Check for the Valid login
2. If Login is Valid then 
	Perform the postback to add the video to Favorites list of the current login user.
	Display the div with the message telling it has been added
   else
	Display the alert message saying "Please Login to perform this action." */
	
  CheckLogin();
	
}

function toggleDisplay(divName){
	tempDiv = document.getElementById(divName);
	if (!tempDiv) {
		return;
	}  
	 if (tempDiv.style.display=="block"){
	 	tempDiv.style.display="none";
	 }
	 else {	
	 	if (tempDiv.style.display=="none"){
			tempDiv.style.display="block";
		}
	 }
}

function openDiv (elName) {
	var theElemenet = document.getElementById(elName);
	if (theElemenet) {
		theElemenet.style.display = "block";
	}
}
function closeDiv (elName) {
	var theElemenet = document.getElementById(elName);
	if (theElemenet) {
		theElemenet.style.display = "none";
	}
}

function hideDiv(divName){
	tempDiv = document.getElementById(divName);
	alerrt(tempDiv);
	if (!tempDiv) {
		return;
	}
	if (tempDiv.style.display=="block"){
	     tempDiv.style.display="none";
	}
}

function showDiv(divName){
	tempDiv = document.getElementById(divName);
	if (!tempDiv) {
	  return;
	}
	if (tempDiv.style.display=="none"){
		tempDiv.style.display="block";
	 }
}

// class List: Hight Light
function setHighLight() {
	var ol = document.getElementsByTagName("ol");
	for (var i=0; i<ol.length; i++) {
		if(ol[i].className == "List") {
			var li = ol[i].getElementsByTagName("li");
			for(var j=0; j < li.length; j++) {
				li[j].style.background = (j%2) ? "#fff" : "#ecf3ff";
			}
		}
	}
}



function setLogo(){
/*	var home = document.getElementsByTagName("body")[0].className;
	var HTML = "";
	
	if(home == "Home"){
		HTML += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='112' height='134' id='logo' align='middle'>";
		HTML += "	<param name='allowScriptAccess' value='sameDomain' />";
		HTML += "	<param name='movie' value='f/logo.swf' />";
		HTML += "	<param name='quality' value='high' />";
		HTML += "	<param name='bgcolor' value='#fff5d9' />";
		HTML += "	<embed src='f/logo.swf' quality='high' bgcolor='#fff5d9' width='112' height='134' name='logo' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
		HTML += "</object>";
	} else{
		HTML += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='112' height='134' id='logo' align='middle'>";
		HTML += "	<param name='allowScriptAccess' value='sameDomain' />";
		HTML += "	<param name='movie' value='f/logo2.swf' />";
		HTML += "	<param name='quality' value='high' />";
		HTML += "	<param name='bgcolor' value='#fff5d9' />";
		HTML += "	<embed src='f/logo2.swf' quality='high' bgcolor='#fff5d9' width='112' height='134' name='logo' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
		HTML += "</object>";
	}
	
	document.write(HTML);*/
	
}


// setting login
function setLogin(status){
	if(status){
		var HTML = "";
		HTML += "<form action='logincheck.asp' method='post'>";
		HTML += "	<h2>login</h2>";
		HTML += "	<label accesskey='m' for='login-mail'>mail </label> <input type='text' class='Text' name='login-mail' id='login-mail' value='' tabindex='1' />&emsp;";
		HTML += "	<label accesskey='p' for='login-password'>password </label> <input type='password' class='Text' name='login-password' id='login-password' value='' tabindex='2' />&emsp;";
		HTML += "	<input accesskey='l' type='submit' value='login' class='Submit' tabindex='3' />";
		HTML += "</form>";
		HTML += "<ul class='ClearFix'>";
		HTML += "	<li class='Dec-B01'><a href='artistadd.html' title=''>アーティスト新規登録はこちら</a></li>";
		HTML += "	<li class='Dec-B01'><a href='useradd2.html' title=''>リスナー新規登録はこちら</a></li>";
		HTML += "</ul>";
	} else{
		var HTML = "";
		HTML += "<form action='logincheck.asp' method='post'>";
		HTML += "	<h2>××××さん</h2>";
		HTML += "	<span>ようこそindiesmusicアーティストマイページへ。</span>";
		HTML += "</form>";
		HTML += "<p>&rarr; <a href=''>ログアウト</a></p>";
	}
	
	document.write(HTML);
	
}

// setting sub nav
function setSubNav(){
	var HTML = "";
	HTML += "<ul>";
	HTML += "	<li class='Home'><a href='index.html'>ホーム</a></li>";
	HTML += "	<li class='About'><a href='about.html'>indiesmusic.comとは？</a></li>";
	HTML += "	<li class='Security'><a href='security.html'>プライバシーポリシー</a></li>";
	HTML += "	<li class='Guide'><a href='guide.html'>ご利用にあたり</a></li>";
	HTML += "	<li class='Company'><a href='company.html'>会社概要</a></li>";
	HTML += "	<li class='Contact'><a href='contact.html'>お問合せ</a></li>";
	HTML += "	<li class='Help'><a href='help.html'>how to／help</a></li>";
	HTML += "</ul>";
	HTML += "<p class='Mail'><a href='mail.html'>mail magazine</a></p>";
	
	document.write(HTML);
	
}

// setting banner
function setBanner(){
	var HTML = "";
	HTML += "<ul>";
	HTML += "	<li><a href='http://blog.ameba.jp/entry/entryinput.do?prm_code=0018' title='' target='_blank'><img src='i/global/banner/amebablog.gif' width='158' height='50' alt='アメーバブログバナー' title='' /></a></li>";
	HTML += "	<li><a href='http://www.livecheers.com/' title='' target='_blank'><img src='i/global/banner/livecheers_banner.jpg' width='158' height='50' alt='Live cheers！バナー' title='' /></a></li>";
	//HTML += "	<li><a href='http://www.ebank.co.jp/kojin/account/index.html' title='' target='_blank'><img src='i/global/banner/ebankbanner.gif' width='158' height='50' alt='イーバンク銀行バナー' title='' /></a></li>";
	HTML += "</ul>";
	
	document.write(HTML);
	
}

// setting plugin
function setPlugin(){
	var HTML = "";
	HTML += "<ul>";
	HTML += "	<li><a href='https://seal.verisign.com/splash?form_file=fdf/splash.fdf&dn=indiesmusic.com&lang=ja' target='_blank'><img src='i/global/verisign.gif'></a></li>";
	HTML += "</ul>";
	HTML += "<dl>";
	HTML += "	<dt><img src='i/global/elicense.gif' width='88' height='31' alt='イーライセンス' title='' /></dt>";
	HTML += "		<dd>ID13414</dd>";
	HTML += "		<dd>ID09322</dd>";
	HTML += "		<dd>ID09323</dd>";
	HTML += "		<dd>ID09324</dd>";
	HTML += "</dl>";
	HTML += "<dl>";
	HTML += "	<dt style='margin-bottom:5px;'><em>JASRAC license number</em></dt>";
	HTML += "	<dt><img src='i/global/JASRAC/9009961001Y30005.gif' width='50' height='50' /></dt>";
	HTML += "		<dd style='margin-bottom:5px;'>9009961001Y30005</dd>";
	HTML += "	<dt><img src='i/global/JASRAC/9009961002Y31015.gif' width='50' height='50' /></dt>";
	HTML += "		<dd style='margin-bottom:5px;'>9009961002Y31015</dd>";
	HTML += "	<dt><img src='i/global/JASRAC/9009961003Y38026.gif' width='50' height='50' /></dt>";
	HTML += "		<dd>9009961003Y38026</dd>";
	HTML += "</dl>";
	HTML += "<dl>";
	HTML += "	<dt><img src='i/global/japanrights.gif' width='50' height='44' alt='ジャパンライツクリアランス' title='' /></dt>";
	HTML += "		<dd>X00182A01L</dd>";
	HTML += "		<dd>X00182B01L</dd>";
	HTML += "		<dd>X00182B02L</dd>";
	HTML += "		<dd>X00182B03L</dd>";
	HTML += "</dl>";
	
	document.write(HTML);
	
}

// setting Window Media Player in Search Control
function setWMAControl(){
	var HTML = "";
	HTML += "<ul>";
	HTML += "	<li><a href='http://www.microsoft.com/japan/windows/windowsmedia/download/' target='_blank' title=''><img src='i/global/wmp_banner.gif' width='88' height='31' alt='windows media player バナー' title='' /></a></li>"
	HTML += "</ul>";
	HTML += "<hr />"
	HTML += "<ul>";
	HTML += "	<li><a href='https://seal.verisign.com/splash?form_file=fdf/splash.fdf&dn=SSL.IQI.CO.JP&lang=ja' target='_blank'><img src='i/VeriSignSeal_w85.gif'></a></li>";
	HTML += "</ul>";
	document.write(HTML);
	
}

function checkMaxLength(id,val,str)
{
if(id.value.length > val-1) {
id.value = id.value.substring(0,val-1);
alert(val + str);
}
}

// setting foot
function setFoot(){
	var HTML = "";
	HTML += "<p>Copyright (C) 2005 <A href='http://www.iqi.co.jp/' target=_blank>IMAGE QUEST INTERACTIVE Inc.</A> All Rights Reserved.</p>";
	document.write(HTML);
	//statusbarmessage();
	
}

var messagetext = " indiesmusic.com "
var thetext = "";
var started = false;
var step = 0;
var times = 1;

function statusbarmessage() {
times--;
if (!times) {
if (!started) {
started = true;
window.status = messagetext;
setTimeout("anim()", 1);
}
thetext = messagetext;
}
}

function anim() {
step++;
if (step==8) step = 1;
if (step==1) window.status = '>>===' + thetext + '===<<';
if (step==2) window.status = '=>>==' + thetext + '==<<=';
if (step==3) window.status = '==>>=' + thetext + '=<<==';
if (step==4) window.status = '===>>' + thetext + '<<===';
if (step==5) window.status = '====>' + thetext + '<====';
if (step==6) window.status = '=====' + thetext + '====='; 
if (step==7) window.status = '>====' + thetext + '====<';
setTimeout("anim()", 200); } 

function hackPlay(){
	var ua = navigator.userAgent;
	var win = ua.indexOf("Win");
	var msie = ua.indexOf("MSIE");
	var opera = ua.indexOf("Opera");
	
	var empty = "";
	
	if(msie == "-1"){return 0;}
	else if((msie != "-1")&&(opera == "-1")&&(win != "-1")){
		var dd = document.getElementsByTagName("dd");
		for(var i=0; i<dd.length; i++){
			if(dd[i].className == "Play"){
				var em = dd[i].childNodes[0];
				var div = em.appendChild(document.createElement("div"));
				div.style.clear = "left";
			}
		}
	}
}

function init() {
	setHighLight();
	hackPlay();
}

window.onload = init;




