// JavaScript Document
function MG_Cookie(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 "";
}

function MS_Cookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function makeRequest(sUrl, oParams) {
		 for (sName in oParams) {
            if (sUrl.indexOf("?") > -1) {
              sUrl += "&";
            } else {
              sUrl += "?";
            }
            sUrl += encodeURIComponent(sName) + "=" + encodeURIComponent(oParams[sName]);
          }
        
          var oScript = document.createElement("script");
          oScript.src = sUrl;
	
          document.body.appendChild(oScript);
        }
        
     
		function HandleResponse(sText)
{
		var vedioid=MG_Cookie('vedioid');
		fText = sText.replace(/\&amp;/g,'&');
		/*ind1 = fText.indexOf("vcode=") + 6;
		ind2 = fText.indexOf("&style=");
		part1 = fText.substring(0,ind1);
		part2 = escape(fText.substring(ind1,ind2));
		part3 = fText.substring(ind2);
		playetUrl = part1+part2+part3;
		document.getElementById(vedioid).innerHTML = playerUrl;*/
		document.getElementById(vedioid).innerHTML = fText;

		
	
}

        
        function getInfo(client,video) {
			
			MS_Cookie('vedioid',"ResponseDiv"+video,365);

			 var oParams = {"name": "" ,"callback": "HandleResponse"};
		 
            
			makeRequest("http://www.marcellus.tv/m3/get_video/video.php?client="+client+"&&video="+video, oParams);
		
        

        } 