﻿
function Moredetails(tagName,tblName)
{
	document.getElementById(tagName).style.display=(document.getElementById(tagName).style.display=='none'?'inline':'none');
	document.getElementById(tblName).style.backgroundColor = '#fff'; 

	if (document.getElementById(tagName).style.display=='inline'){
	document.getElementById(tblName).style.backgroundColor = '#e4eef8';
	}
}

function Lessdetails(tagName,tblName)
{
	document.getElementById(tagName).style.display=(document.getElementById(tagName).style.display=='none'?'inline':'none');
	document.getElementById(tblName).style.backgroundColor = '#fff'; 
	if (document.getElementById(tagName).style.display=='none'){
	//	document.getElementById(tagName+'A').innerHTML = '??? ????';
	} else {
	//	document.getElementById(tagName+'A').innerHTML = '????';
	}
}

function popup(id)
{
	window.open(""+id, "_blank","toolbar=no, titlebar=no, fullscreen=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=700, height=400")
}

function popup500(id)
{
	window.open(""+id, "_blank","toolbar=no, titlebar=no, fullscreen=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=750, height=520")
}
function popup650(id)
{
	window.open(""+id, "_blank","toolbar=no, titlebar=no, fullscreen=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=680, height=680")
}




    function makeMyDefaultPlaylist(youTubeId) {
        var xmlHttp;
        try {
            xmlHttp=new XMLHttpRequest();    
        } catch (e) {
            try {
                xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
            } catch (e) {
                try {
                    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
                } catch (e) {
                    alert("Your browser does not support AJAX!");        
                    return false;
                }
            }
        }
            
        xmlHttp.onreadystatechange=function()
		{
            if(xmlHttp.readyState==4)
			{
			var tempStr=xmlHttp.responseText;
			document.getElementById("resultArea").innerHTML=tempStr
			var t=setTimeout("document.getElementById('resultArea').innerHTML=''",5000);
            }
        }
          
        var url="makeMyDefaultPlaylist.asp?youTubeId=" + youTubeId;
        xmlHttp.open("GET",url,true);
        xmlHttp.send(null);  

    }



	    function markAsBad(youTubeId) {
        var xmlHttp;
        try {
            xmlHttp=new XMLHttpRequest();    
        } catch (e) {
            try {
                xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
            } catch (e) {
                try {
                    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
                } catch (e) {
                    alert("Your browser does not support AJAX!");        
                    return false;
                }
            }
        }
            
        xmlHttp.onreadystatechange=function()
		{
            if(xmlHttp.readyState==4)
			{
			var tempStr=xmlHttp.responseText;
			document.getElementById("resultArea").innerHTML=tempStr
			var t=setTimeout("document.getElementById('resultArea').innerHTML=''",5000);
            }
        }
          
        var url="markAsBad.asp?youTubeId=" + youTubeId;
        xmlHttp.open("GET",url,true);
        xmlHttp.send(null);  

    }


function set_Cookie(name, value, expiredays, path, domain, secure) {
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
    document.cookie= name + "=" + escape(value) +
        ((expiredays) ? "; expires=" + exdate.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}


function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}
