﻿var NWEplus = {
    BasePath:'',
    WebService: {
        AddTipToMyList: function (data) {                   
            WebService.AddTipToMyList(data[0],data[1], NWEplus.WebService._addtiptomylist_oncomplete, _MSAjax_OnError, _MSAjax_OnTimeOut);   
        },
        _addtiptomylist_oncomplete: function (data) {
	        var o = eval('('+data+')');
	        if (o.Status == "1")
	            jQuery('#'+o.RefCtrl).attr('href','#').css('color','silver').html('&radic; <em>Added to My List</em>');
        }
    },
    BindVideo: function(index, o) {
        var file = jQuery(o).attr('href');
        if (file.match(/(\.wmv|\.avi|\.mov|\.mp4)/i))
            jQuery(o).attr('href',NWEplus.BasePath+'/library/video.aspx?link='+file);
        if (file.match(/\.mov/i))
            jQuery(o).colorbox( {iframe:true, width:670, height:560, opacity: 0.35 });
        else
            jQuery(o).colorbox( {iframe:true, width:650, height:560, opacity: 0.35 });
    },
    RenderRoadblock: function() {}
}

function _MSAjax_OnComplete(arg)
{
    //alert(arg);
    return true;
}
function _MSAjax_OnError(arg)
{
    alert("error has occured: " + arg.get_message());
}
function _MSAjax_OnTimeOut(arg)
{
   alert("timeout has occured");
}
