﻿
    
    
    function OpenPlaylist()
    {
     
     var filename = document.getElementById("ctl00_ContentPlaceHolder1_hdnfilename");
     
     if(filename!=null && filename.value != "")
     {
        var thewindow=new Window({url: "http://www.eco-tube.com/Playlist.aspx?Filename=" + filename.value, className: "alphacube",top: 10, width:400,height:300,resizable:false,scrollbars:false,showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true, wiredDrag: true ,options: {method: 'get' }});
        thewindow.setZIndex(50)
        thewindow.show();
        thewindow.setDestroyOnClose();
     }   
    }
    
    function ConfirmFunction(stralert)
	{	    
		if(confirm(stralert)== true)
		return true;
		else
		return false;
}
	
	function FocusButton(button)
    {
        
        var obj=document.forms[0]
	    if (event.keyCode == 13) 
	    {
		    document.getElementById(button).click();
		    return false;
	    }
    }
    function DisableButton() {
        document.forms[0].submit();
        window.setTimeout("disableButton('" + 
           window.event.srcElement.id + "')", 0);
    }

    function disableButton(buttonID) {
        document.getElementById(buttonID).disabled=true;
    }

    function OpenAdvt()
    {     
     var filename = document.getElementById("ctl00_ContentPlaceHolder1_idadvt").innerHTML;
     //alert(filename);
     
     if(filename!=null && filename != "")
     {
        var thewindow=new Window({url: "http://www.eco-tube.com/Playlist.aspx?Filename=" + filename.value, className: "alphacube",top: 10, width:400,height:300,resizable:false,scrollbars:false,showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true, wiredDrag: true ,options: {method: 'get' }});
        thewindow.setZIndex(50)
        thewindow.show();
        thewindow.setDestroyOnClose();
     }
 }
    

    function OpenCaptureDetails() {

        window.open("CaptureDetails.aspx", "PostComment", "width=500,height=300,top=300,left=200,toolbar=no,menubar=no,resizable=no", false);
        
        //var thewindow = new Window("CaptureDetails.aspx", "PostComment", "width=500,height=300,top=300,left=200;toolbar=no,menubar=no,resizable=no");

        //var thewindow = new Window({ url: "http://www.eco-tube.com/CaptureDetails.aspx", className: "alphacube", top: 10, width: 400, height: 300, resizable: false, scrollbars: false, showEffect: Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable: true, wiredDrag: true, options: { method: 'get'} });
        //var thewindow = new Window({ url: "CaptureDetails.aspx", className: "alphacube", top: 10, width: 400, height: 300, resizable: false, scrollbars: false, showEffect: Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable: true, wiredDrag: true, options: { method: 'get'} });
        
        //thewindow.setZIndex(50)
        //thewindow.show();
//
        //thewindow.setDestroyOnClose();
        
    } 
    
    function getwindow(curobj,cid,did,flv,id,chl,vtitle)
    {
        idvideo = id;
	    document.getElementById(cid).style.display="none";
	    document.getElementById(did).style.display="block";
	    document.getElementById("ctl00_ContentPlaceHolder1_hdnVIdeoId").value=id;	 
        var urname = "http://www.eco-tube.com/v/" + id + "/" + chl + "/" + vtitle;
        window.location = "http://www.eco-tube.com/v/" + chl + "/" + vtitle.replace(" ", "_") + ".aspx";
    }
    

    function getyoutube(curobj,cid,did,tagname,id,chl,vtitle)
    {
        idvideo = id;
//        alert(tagname);
        document.getElementById(cid).style.display="none";
	    document.getElementById(did).style.display="block";
//	    document.getElementById("ctl00_ContentPlaceHolder1_hdnLink").value=id;	 
        var urname = "http://www.eco-tube.com/v/" + id + "/" + chl + "/" + vtitle;
//        window.location = "videoshow.aspx?video=" + tagname + "";

        window.location = "http://www.eco-tube.com/v/" + chl + "/" + vtitle.replace(" ", "_")  + ".aspx";
        
//        //http://www.youtube.com/swf/l.swf?video_id=1JbL6fJLYwQ&eurl=&iurl=http%3A//img.youtube.com/vi/1JbL6fJLYwQ/default.jpg&t=OEgsToPDskL97_nqkJVsNmcp7-XrOlqh&rel=1&border=0
    }

    
    function getwindowvideorelated(curobj,cid,did,flv,id,chl,vtitle,isSearch)
    {
        idvideo = id;
	    document.getElementById(cid).style.display="none";
	    document.getElementById(did).style.display="block";
	    document.getElementById("ctl00_ContentPlaceHolder1_hdnVIdeoId").value=id;	 
        if(isSearch == "YES")
            window.location = "http://www.eco-tube.com/v/" + chl + "/" + vtitle.replace(" ", "_") + ".aspx;related";
        else
            window.location = "http://www.eco-tube.com/v/" + chl + "/" + vtitle.replace(" ", "_") + ".aspx";
    }
    function getyoutubevideorelated(curobj,cid,did,tagname,id,chl,vtitle,isSearch)
    {
        idvideo = id;

        document.getElementById(cid).style.display="none";
        document.getElementById(did).style.display="block";

        if(isSearch == "YES")
            window.location = "http://www.eco-tube.com/v/" + chl + "/" + vtitle.replace(" ", "_")  + ".aspx;related";
        else
            window.location = "http://www.eco-tube.com/v/" + chl + "/" + vtitle.replace(" ", "_")  + ".aspx";

    }
    function openPostComment(vdoid)
    {
        vid = vdoid;
        var grp = 0;
       window.open("http://www.eco-tube.com/PostComment.aspx?Group=" + grp + "&amp;Video=" + vid ,"PostComment","status=yes,width=500,height=300,resizable=no,top=300,left=200");
//        window.open("PostComment.aspx?Group=" + grp + "&amp;Video=" + vid ,className: "alphacube",top: 10, width:450,height:325,resizable:false,scrollbars:false,showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true, wiredDrag: true ,options: method: 'get');
    } 
    function openShareVideo(vdoid)
    {
//        alert(idvideo);
//        var video = document.getElementById("ctl00_ContentPlaceHolder1_hdnVIdeoId");
//        var a = video.Value;
//        alert(a);
        
        //alert(vid);
        //window.open("ShareVideo.aspx?Video=" + vid ,"ShareComment","status=yes,width=500,height=450,resizable=no,top=300,left=200");
        vid = vdoid;   
        window.open("http://www.eco-tube.com/ShareVideo.aspx?Video=" + vid ,"ShareComment","status=yes,width=500,height=350,resizable=no,top=300,left=200");  
        /*var thewindow=new Window({url: "http://www.eco-tube.com/ShareVideo.aspx?Video=" + vid , className: "alphacube",top: 10, width:500,height:350,resizable:false,scrollbars:false,showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true, wiredDrag: true ,options: {method: 'get' }});
        thewindow.setZIndex(50)
        thewindow.show();
        thewindow.setDestroyOnClose();*/
    }
    
    function NewWindow(urlname)
    {
        /*var thewindow=new Window({url: urlname, className: "alphacube",top: 10, width:800,height:700,resizable:false,scrollbars:false,showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true, wiredDrag: true ,options: {method: 'get' }});
        thewindow.setZIndex(50)
        thewindow.show();
        thewindow.setDestroyOnClose();*/
	window.open('http://www.eco-tube.com/ViewAdvt.aspx?'+urlname) ;
    }
    
    
    function validateRadioGroup(grpobj)
    {

	var cnt = -1;
	if(grpobj.length)
	{
		for (var i=grpobj.length-1; i > -1; i--) 
		{
			if (grpobj[i].checked) 
			{
				cnt = i; i = -1;
			}
		}
		   
	}
	else
	{		
	 if (grpobj.checked) 
	 {
	    cnt = 0;
	 }
	}
	
	
	if (cnt > -1) 
	{
		if(grpobj.length)
		{
			return grpobj[cnt].value;
		}
		else
		{
			return grpobj.value;
		}
	}
	else 
	{
		return null;
	}
   }
    
    
    
    
 // Home Page
 


    
    
    function playvideo(ccurobj,cid,did,flv,group,userid,strpage)
    {
        if (strpage == 'Link')
        {

			var tagname = '<object width="425" height="355"><param name="movie" value="' + 'http://www.youtube.com/v/' + flv + '"/><param name="wmode" value="transparent"/><embed src="' + 'http://www.youtube.com/v/' + flv + '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>';
            flashcontents.innerHTML = tagname;
        }
        if (strpage == 'Video')
        {    
            document.getElementById(did).style.display="block";            
            var so = new SWFObject("videoplayer.swf", "videoplayer", "460", "330", "8", "#343434");
	        so.addVariable("flashVarText", escape(encodeURIComponent(flv))); 
	        so.addParam("_cx", "3307");
            so.addParam("_cy", "3307");
            so.addParam("WMode", "Opaque");
            so.addParam("Play", "-1");
            so.addParam("Loop", "-1");
            so.addParam("Quality", "High");
            so.addParam("Menu", "-1");
            so.addParam("Scale", "ShowAll");
            so.addParam("SeamlessTabbing", "1");
            so.addParam("DeviceFont", "0");
            so.addParam("EmbedMovie", "0");
            so.addParam("ProfilePort", "0");
            so.addParam("live", "true");
            so.addParam("allowFullScreen", "true");
	        so.write("flashcontents");
	    }
    }    
    
    function expandhomevideo()
    {
    
            if (vdo_Path != null)
        {
            if(vdo_Path.indexOf(".flv") > 0)
            {
                var brow=(navigator.appName)
                if(brow=="Microsoft Internet Explorer")
                {
                    var so = new SWFObject("http://www.eco-tube.com/videoplayer.swf", "videoplayer", "460", "330", "8", "#343434");
                    so.addVariable("flashVarText", vdo_Path); 
                }
                else
                {
                    var so = new SWFObject("http://www.eco-tube.com/videoplay.swf?flvName=flv/" + vdo_Path, "videoplay", "460", "330", "8", "Transparent");                    
                }
                so.skin = "http://www.eco-tube.com/SteelExternalNoVol.swf";
                so.addParam("_cx", "3307");
                so.addParam("_cy", "3307");
                so.addParam("WMode", "Transparent");
                so.addParam("Play", "-1");
                so.addParam("Loop", "-1");
                so.addParam("Quality", "High");
                so.addParam("Menu", "-1");
                so.addParam("Scale", "ShowAll");
                so.addParam("SeamlessTabbing", "1");
                so.addParam("DeviceFont", "0");
                so.addParam("EmbedMovie", "0");
                so.addParam("ProfilePort", "0");
                so.addParam("live", "true");
                so.addParam("allowFullScreen", "true");
                so.addVariable("FlashVars", "skinName=http://www.eco-tube.com/SteelExternalNoVol.swf");
                //so.addParam("skin", "http://www.eco-tube.com/SteelExternalAll.swf");
                so.write("flashcontents");                
            }
            else
            {
                var tagname = '<object width="425" height="355"><param name="movie" value="' + 'http://www.youtube.com/v/' + vdo_Path + '"/><param name="wmode" value="transparent"/><embed src="' + 'http://www.youtube.com/v/' + vdo_Path + '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>';
                document.getElementById('mydiv').innerHTML = tagname;
                flashcontents.style.display = "none";                
            }
        }        
    //sef url
//        var qsParm = new Array();
//        var query = unescape(window.location.href);
//        var parms = query.split('/');
//        var vdpath = parms[parms.length-1];
////        alert(vdPath);
//        
//        var resVal = Home.Getpath(vdpath);
//        resVal = resVal.value
//        
//        if (resVal != "false")
//        {
//            var startPos = resVal.indexOf(".flv");
//            if (startPos > -1) 
//            {
//                document.getElementById('flashcontent').style.display="block";            
//                var so = new SWFObject("http://localhost:1243:1599/echotube/videoplayer.swf", "videoplayer", "460", "330", "8", "#343434");
//	            so.addVariable("flashVarText", resVal); 
//	            so.addParam("_cx", "3307");
//                so.addParam("_cy", "3307");
//                so.addParam("WMode", "Opaque");
//                so.addParam("Play", "-1");
//                so.addParam("Loop", "-1");
//                so.addParam("Quality", "High");
//                so.addParam("Menu", "-1");
//                so.addParam("Scale", "ShowAll");
//                so.addParam("SeamlessTabbing", "1");
//                so.addParam("DeviceFont", "0");
//                so.addParam("EmbedMovie", "0");
//                so.addParam("ProfilePort", "0");
//                so.addParam("allowFullScreen", "true");
//	            so.write("flashcontents");             
//            }
//            else
//            {
//                var tagname = '<object width="460" height="330"><param name="movie" value="' + 'http://www.youtube.com/v/' + resVal + '"/><param name="wmode" value="transparent"/><embed src="' + 'http://www.youtube.com/v/' + resVal + '" type="application/x-shockwave-flash" wmode="transparent" width="460" height="330"></embed></object>';
//                flashcontents.innerHTML = tagname;
//            }
//        }
//      sef url
        
        // flvName=Flv/Eyecatcher_128412481044843750.flv
        
        
////        var qsParm = new Array();
////        var query = window.location.search.substring(1);
////        var parms = query.split('&');

////        for (var i=0; i<parms.length; i++) 
////        {

////            var pos = parms[i].indexOf('=');
////            if (pos > 0) 
////            {
////                var key = parms[i].substring(0,pos);
////                var val = parms[i].substring(pos+1);
////                qsParm[key] = val;
////            }
////        }
////        
////	    var path = escape(encodeURIComponent(qsParm["path"]));
////	    if (qsParm["video"] != null)
////	    {
////            var tagname = '<object width="460" height="330"><param name="movie" value="' + 'http://www.youtube.com/v/' + escape(encodeURIComponent(qsParm["video"])) + '"/><param name="wmode" value="transparent"/><embed src="' + 'http://www.youtube.com/v/' + escape(encodeURIComponent(qsParm["video"])) + '" type="application/x-shockwave-flash" wmode="transparent" width="460" height="330"></embed></object>';
////            document.getElementById('mydiv').innerHTML = tagname;
////            flashcontents.style.display = "none";
////        }
////	    else
////	    {
////            if (qsParm["path"] != null)
////            {
////                var brow=(navigator.appName)
////                if(brow=="Microsoft Internet Explorer")
////                {
////                    var so = new SWFObject("videoplayer.swf", "videoplayer", "460", "330", "8", "#343434");
////                    so.addVariable("flashVarText", escape(encodeURIComponent(qsParm["path"]))); 
////                }
////                else
////                {
////                    var so = new SWFObject("videoplay.swf?flvName=flv/" + escape(encodeURIComponent(qsParm["path"])), "videoplay", "460", "330", "8", "Transparent");                    
////                }
////                so.addParam("_cx", "3307");
////                so.addParam("_cy", "3307");
////                so.addParam("WMode", "Transparent");
////                so.addParam("Play", "-1");
////                so.addParam("Loop", "-1");
////                so.addParam("Quality", "High");
////                so.addParam("Menu", "-1");
////                so.addParam("Scale", "ShowAll");
////                so.addParam("SeamlessTabbing", "1");
////                so.addParam("DeviceFont", "0");
////                so.addParam("EmbedMovie", "0");
////                so.addParam("ProfilePort", "0");
////                so.addParam("live", "true");
////                so.addParam("allowFullScreen", "true");
////                so.write("flashcontents");
////            }	
////        }        
    }
    
    
    function PlayFirst()
    {        
        var startPos = vdoPath.indexOf(".flv");
        if (startPos > -1) 
        {
            document.getElementById('flashcontent').style.display="block";    
            /*var brow=(navigator.appName)
            if(brow=="Microsoft Internet Explorer")
            {        
                var so = new SWFObject("videoplayer.swf", "videoplayer", "460", "330", "8", "#343434");
	            so.addVariable("flashVarText", vdoPath);
	        }
	        else
	        {
                var so = new SWFObject("videoplay.swf?flvName=flv/" + vdoPath, "videoplay", "460", "330", "8", "Transparent");
	        }
	        so.addParam("_cx", "3307");
            so.addParam("_cy", "3307");
            so.addParam("WMode", "Transparent");
            so.addParam("Play", "-1");
            so.addParam("Loop", "-1");
            so.addParam("Quality", "High");
            so.addParam("Menu", "-1");
            so.addParam("Scale", "ShowAll");
            so.addParam("SeamlessTabbing", "1");
            so.addParam("DeviceFont", "0");
            so.addParam("EmbedMovie", "0");
            so.addParam("ProfilePort", "0");
            so.addParam("allowFullScreen", "true");
	so.write("flashcontents");  */
	/*var so = new SWFObject("FlowPlayerDark.swf", "FlowPlayer", "460", "330", "8", "#343434");
            so.addParam("allowFullScreen", "true");
            so.addVariable("config", "{ videoFile: 'Flv/"+vdoPath+"',autoPlay: true,  initialScale: 'scale',autoBuffering: true,bufferLength: 20   }");
            so.write("flashcontents");  */         
        }
        else
        {
            var tagname = '<object width="425" height="355"><param name="movie" value="' + 'http://www.youtube.com/v/' + vdoPath + '"/><param name="wmode" value="transparent"/><embed src="' + 'http://www.youtube.com/v/' + vdoPath + '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>';
            document.getElementById("flashcontents").innerHTML = tagname;
            //flashcontents.innerHTML = tagname;
        }
    }
    
    //Video Page
function CallServerVideo(value)
{
    
    
     var val = Video.GetComments(value);
     
     if(val.value != "")
        document.getElementById("CommentDiv").innerHTML = val.value;
     else
        document.getElementById("CommentDiv").style.display = "none";   
}

function TagOver(tagid,clsname)
{
    //document.getElementById(tagid).className = "TagSelect";
    document.getElementById(tagid).className = clsname;
}


function TagDown(tagid, clsname)
{
    document.getElementById(tagid).className = clsname;    
    
}


//videoshow page
 
 
 
         function showInline(elName)
        {
            var theElemenet=document.getElementById(elName);
            if(theElemenet)
            {
                theElemenet.style.display="inline";
            }
        }
        
        function hideInline(elName)
        {
            var theElemenet=document.getElementById(elName);
            if(theElemenet)
            {
                theElemenet.style.display="none";
            }
        }

 
function expandvideo()
    {
	    
            var brows=(navigator.appName)
            if(brows=="Microsoft Internet Explorer")
            {        
            }
            else
            {
                document.getElementById("ctl00_ContentPlaceHolder1_divBanner").style.height = "1024px";
            }

	    if (vpath != null)
	    {
	        if(vpath.indexOf(".flv") == -1)
	        {
   
                var tagname = '<object width="425" height="355"><param name="movie" value="' + 'http://www.youtube.com/v/' + vpath + '"/><param name="wmode" value="transparent"/><embed src="' + 'http://www.youtube.com/v/' + vpath + '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>';
                //document.getElementById('mydiv').innerHTML = tagname;                              
                document.getElementById('ifrOne').style.display = "none";
                document.getElementById('dvframecontain').innerHTML = tagname;
                
                
            }
    	    else
	        {
                    
                    
                    document.getElementById('ifrOne').src = 'http://www.eco-tube.com/playersrc.html';
                    var strvideofile = vpath.replace("_","%5F");  
                    strvideofile = strvideofile.replace(".","%2E");
                    var strImageFile = vimg.replace("_","%5F");  
                    strImageFile = strImageFile.replace(".","%2E");                
                    
                    
                    GetEmbed(strvideofile,strImageFile);
                    //GetEmbed(vpath);        	        
                    ShowDetail('divGeneral');
                   
            }	
        } 
                  
    }
    
    function GetEmbed(vdolink,img)
    {
        
        //var embedtag = "<object width='460' height='330'><param name='movie' value='http://www.eco-tube.com/EmbedVideo.swf?flvName=" + vdolink + "'/><param name='wmode' value='transparent'/><embed src='http://www.eco-tube.com/EmbedVideo.swf?flvName=" + vdolink + "' type='application/x-shockwave-flash' wmode='transparent' width='460' height='330'></embed></object>";
        var embedtag = "<embed src=\"http://www.eco-tube.com/FlowPlayerDark.swf?config=%7Bembedded%3Atrue%2CbaseURL%3A%27http%3A%2F%2Fwww%2Eeco%2Dtube%2Ecom%27%2CcontrolBarBackgroundColor%3A%27%23343434%27%2CmenuItems%3A%5B0%2C0%2C1%2C1%2C1%2C1%2C0%5D%2CstartingBufferLength%3A10%2CbufferLength%3A20%2CautoBuffering%3Atrue%2CinitialScale%3A%27scale%27%2CautoPlay%3Afalse%2CplayList%3A%5B%7BoverlayId%3A%27play%27%2Curl%3A%27http%3A%2F%2Fwww%2Eeco%2Dtube%2Ecom%2FImages%2F"+img+"%27%7D%2C%7Burl%3A%27http%3A%2F%2Fwww%2Eeco%2Dtube%2Ecom%2FFlv%2F" + vdolink+"%27%7D%5D%7D\" width=\"460\" height=\"330\" scale=\"noscale\" bgcolor=\"111111\" type=\"application/x-shockwave-flash\" allowFullScreen=\"true\" allowScriptAccess=\"always\" allowNetworking=\"all\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed>";
        document.getElementById('txtEmbedCode').value = embedtag;
    }

    function getCommentsDiv(divname)
    {
        for (var i=1; i<=pgCnt; i++) 
        {
            var dgDiv = "divComm" + i;
            document.getElementById(dgDiv).style.display = "none";
        }
        document.getElementById(divname).style.display = "block";        
    }
    function getCommDiv(pageno, vdoid)
   {

        var resval;
        resval = Video2.GetComms(pageno, vdoid);
        resval = resval.value;
        document.getElementById("ctl00_ContentPlaceHolder1_Comm").innerHTML = "";
        //alert(document.getElementById("parentDiv").innerHTML);
        document.getElementById("ctl00_ContentPlaceHolder1_Comm").innerHTML = resval;
               

   }
   function getnewpage()
    {
        window.location="Video.aspx";
    }
   
   function ShowDetail(divid)
   {
	    document.getElementById('divComment').style.display="none";
	    document.getElementById('divGeneral').style.display="none";
	    document.getElementById('divThumbnail').style.display="none";
	    document.getElementById('divLinks').style.display="none";
//	    document.getElementById('CommentDiv').style.display="none";

	    var brow=(navigator.appName)
//	    alert(brow);
	    
	    document.getElementById(divid).style.width="800px";	    
//	    document.getElementById(divid).style.height="275px";	    
        if(brow=="Microsoft Internet Explorer")
        {
            document.getElementById(divid).style.display="block";
        }
        else
        {
	        document.getElementById(divid).style.display="table";	    
	    }
  
   }
   
    
    function GetUp(id, idtext)
    {
        document.getElementById('tbGen').className="TabText";
        document.getElementById('tbComment').className="TabText";
        document.getElementById('tbThumb').className="TabText";
        document.getElementById('tbLink').className="TabText";

        document.getElementById('divGenInfo').className="TextNormal";
        document.getElementById('divComInfo').className="TextNormal";
        document.getElementById('divThmInfo').className="TextNormal";
        document.getElementById('divLnkInfo').className="TextNormal";

        document.getElementById(id).className="TabTextOver";
        document.getElementById(idtext).className="TextOver";
    }

    function GetDown(id)
    {
        document.getElementById('tbGen').className="TabText";
        document.getElementById('tbComment').className="TabText";
        document.getElementById('tbThumb').className="TabText";
        document.getElementById('tbLink').className="TabText";
        
        document.getElementById(id).className="TabTextOver";        
    }
    
    function PrevComments()
    {
        document.getElementById('CommentDiv').style.display="block";
    }
    

        function GetShareWindow(sitename)
        {
            var embcode = window.location.href;
            //alert(embcode);
            if(sitename == "icio")
            {
                embcode = "http://del.icio.us/post?url=" + embcode;
                window.open(embcode);
                return;
            }
            if(sitename == "digg")
            {                                            
                embcode = "http://digg.com/submit?phase=2&url=" + embcode;
                window.open(embcode);
                return;
            }
            if(sitename == "furl")
            {
                embcode = "http://furl.net/storeIt.jsp?u=" + embcode;
                window.open(embcode);
                return;
            }
            if(sitename == "netscape")
            {                                
                embcode = "http://www.netscape.com/submit/?U=" + embcode;
                window.open(embcode);
                return;
            }
            if(sitename == "yahoo")
            {                                
                embcode = "http://myweb2.search.yahoo.com/myresults/bookmarklet?u=" + embcode;
                window.open(embcode);
                return;
            }
            if(sitename == "stumbleupon")
            {                                
                embcode = "http://www.stumbleupon.com/submit?url=" + embcode;
                window.open(embcode);
                return;
            }
            if(sitename == "google")
            {                                
                embcode = "http://www.google.com/bookmarks/mark?op=edit&bkmk=" + embcode;
                window.open(embcode);
                return;
            }
            if(sitename == "technorati")
            {                                
                embcode = "http://www.technorati.com/faves?add=" + embcode;
                window.open(embcode);
                return;
            }
            if(sitename == "blinklist")
            {                                
                embcode = "http://blinklist.com/index.php?Action=Blink/addblink.php&Url=" + embcode;
                window.open(embcode);
                return;
            }
            if(sitename == "newsvine")
            {                                
                embcode = "http://www.newsvine.com/_wine/save?u=" + embcode;
                window.open(embcode);
                return;
            }
            if(sitename == "gnolia")
            {                                
                embcode = "http://ma.gnolia.com/bookmarklet/add?url=" + embcode;
                window.open(embcode);
                return;
            }
            if(sitename == "reddit")
            {                                
                embcode = "http://reddit.com/submit?url=" + embcode;
                window.open(embcode);
                return;
            }
            if(sitename == "live")
            {                                
                embcode = "https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url=" + embcode;
                window.open(embcode);
                return;
            }
            if(sitename == "tailrank")
            {                                
                embcode = "http://tailrank.com/share/?link_href=" + embcode;
                window.open(embcode);
                return;
            }
            
        }


    //videoupload page
    
    var file;
function checkSpaceInName()
{
    var sFileName = document.getElementById('ctl00$ContentPlaceHolder1$flVideoUpload').value;           
    sFileName = sFileName.split('\\');
    var Exp=/ /;

    var found = Exp.test(sFileName[sFileName.length -1]);

    var ext = sFileName[sFileName.length -1].lastIndexOf('.');
//    if(found)
//    {
//        alert('Please select the filename without spaces.');
//        return false;
//    }
    var extToCheck = sFileName[sFileName.length -1].substring(ext, sFileName[sFileName.length -1].length).toLowerCase();
    if (ext == -1 || (extToCheck != '.avi' && extToCheck != '.wmv' && extToCheck != '.mkv' && extToCheck != '.mov' && extToCheck != '.flv' && extToCheck != '.mpeg' && extToCheck != '.mpg' && extToCheck != '.asf' && extToCheck != '.rm' && extToCheck != '.mp4'))
    {
        alert('Please select .avi,.wmv,.mkv,.mov,.flv,.mpeg,.rm,.asf files only');
        return false;
    }
                              


}
//    function CheckComm()
//    {
//        var code;
//        var txtComm = document.getElementById('ctl00_ContentPlaceHolder1_txtComment');
//        var comm = txtComm.innerText;
//        if (comm.length 
//        if (!e) var e = window.event;
//        if (e.keyCode) code = e.keyCode; 
//        if( (code >= 65 && code <= 90) || (code >= 97 && code <= 122) || code == 32 || code == 46 )
//        {
//            return true;
//        }
//        return false;
//    }   




//forgetpassword page
function isBlank(ctl){
	if(trimme(ctl.value))	
    {		
      return (false);
    }
  else
    {
    	return (true);
    }
}
function trimme(strName)
{
  var strTemp = "";
  strTemp = strName;
  var i = 0;

  if(strName.indexOf(" ") == 0)
  {
    for(i=0;i<=strTemp.length;i++)
    {
      if(strName.indexOf(" ") == 0)
      {
       strName = strName.substr(1);
      }  
      else
        break;   
    }
  }
  if(strName == "")
	return false;
  else
	return true;
}
function ValidateEmail(ctl){
    	var id=ctl;
	var at=id.value.indexOf('@');
	var lastat=id.value.lastIndexOf('@');
	var dot=id.value.indexOf('.');
	lastdot=id.value.lastIndexOf('.')
	space=id.value.lastIndexOf(' ')
	if(space!=-1)
		return false;
	if ( !( (0 < at) && (at < (lastdot-1)) && (lastdot < (id.value.length-1)) && (at == lastat) ) ) {
	  error = 1;
	 
	  return (false);
	}

}
 function ValidPassWord(){
if(document.getElementById('divusername').style.display == 'block'){
document.getElementById('divusername').style.display = 'none' ;
}
if(document.getElementById('divemail').style.display == 'block'){
document.getElementById('divemail').style.display = 'none' ;
}
if(isBlank(document.forms[0].ctl00$ContentPlaceHolder1$txtUsername) && isBlank(document.forms[0].ctl00$ContentPlaceHolder1$txtEmail)){
document.getElementById('divusername').style.display = 'block' ;
document.getElementById('spanusername').innerHTML = 'Veuillez entrer votre Nom d’utilisateur ou votre Email'
document.forms[0].ctl00$ContentPlaceHolder1$txtUsername.focus();
return false;
}
if(!isBlank(document.forms[0].ctl00$ContentPlaceHolder1$txtUsername) && !isBlank(document.forms[0].ctl00$ContentPlaceHolder1$txtEmail)){
document.getElementById('divusername').style.display = 'block' ;
document.getElementById('spanusername').innerHTML = 'Veuillez entrer votre Nom d’utilisateur ou votre Email'
document.forms[0].ctl00$ContentPlaceHolder1$txtUsername.focus();
return false;
}

var checkmail = ValidateEmail(document.forms[0].ctl00$ContentPlaceHolder1$txtEmail);
if(checkmail == false && isBlank(document.forms[0].ctl00$ContentPlaceHolder1$txtUsername)){
document.getElementById('divemail').style.display = 'block' ;
document.getElementById('spanemail').innerHTML = 'Veuillez entrer une adresse Email valide';
document.forms[0].ctl00$ContentPlaceHolder1$txtEmail.focus();
return false;
}
}

//View profile page
    function GetCompose(userid)
    {
        window.open("MsgCompose.aspx?uid=" + userid, "Compose","status=yes,width=700,height=400,resizable=no,top=200,left=200");
    }
