﻿
jQuery(function($){
  var returnurl = "http://sns.cio360.net/space/login.php?op=login&url=http://epaper.cio360.net/zgjsjb/paperindex.htm"
  var returnurlexit = "http://sns.cio360.net/space/login.php?op=cexit&url="+window.location.href;
  //如果是电子报的头退出后返回电子报首页
  if(window.location.href.indexOf("http://www.cio360.net/Page/1952/Default.aspx")>=0)
  {
    returnurlexit = "http://sns.cio360.net/space/login.php?op=cexit&url=http://epaper.cio360.net/zgjsjb/paperindex.htm";
  }
  
  $('#sns_exit').attr("href", returnurlexit);
  $('#sns_exit').attr("target", "_parent");
  $.get("DesktopModules/SNSUser/SNSUser_JSON.ashx",{t:(new Date()).getTime()},function(data){
       eval(data);
       if(!!!window.cio360_SNSUser.UID){//登陆前 
          var currentUrl =window.location.href;
             //判断是否电子报的头部
//             if(currentUrl.indexOf("http://www.cio360.net/Page/1952/Default.aspx")>=0)
//             {
//              //window.parent.location.href = returnurl;
//             
//             }
//           else{
              $('#sns_defore').show();
              
           
           //}
       }else{//登陆后
           $('#sns_after').show();
           $('#sns_user').text(window.cio360_SNSUser.Alias);
           
           
            $('#freeregist').html("<img id=\"Img4\" src=\"/DesktopModules/Login/4.gif\" alt=\"\"  /><span>我的空间</span>");
            $('#freeregist').attr("href","http://sns.cio360.net/space/index.php?ownerId=" +window.cio360_SNSUser.UID );
	       
	   
       }
  });

});

//jQuery(function($){

//var name ="ucs2discuzbbs";
//var cookieValue = null; 
//        if (document.cookie && document.cookie != '') 
//        { 
//            var cookies = document.cookie.split(';'); 
//            for (var i = 0; i < cookies.length; i++) 
//            { 
//                var cookie = jQuery.trim(cookies[i]); 
//                // Does this cookie string begin with the name we want? 
//                if (cookie.substring(0, name.length + 1) == (name + '='))
//                { 
//                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); 
//                    break; 
//                } 
//             }
//          } 
//          
//         
////'<script+type="text/javascript"+src="http://bbs.cio360.net/api/uc.php?time=1245657423&code=e1c9aebuK1dJRBeVf6QiOAllv6C%2BFumIRuWlTIhP9bxNymEbdCqAHsM3%2FlvulR%2BKY7K20W1sGUIfW%2F%2Bzq45MvWKXl3kmaljZnxCNWoJti3hb%2FcX%2FE2trwl0quMJvfsP1yc3tvMKz02%2FuQG%2FLRHanTjf0AqtrIMtE4VFvN%2BZDECs"></script>'
// if(cookieValue!=null){
//  cookieValue =cookieValue.replace(/\+/g," ");
//  document.write(cookieValue);
// //alert(cookieValue);
//}

//});

 


//    //控制导航的样式
jQuery(function($){
   var currentUrl =window.location.href;

   if(currentUrl.indexOf("http://www.cio360.net/Page/2173/Default.aspx")>=0)
   {
      var current= $('#leo_cio');
      current.removeClass("item");
	  current.addClass("item_leo"); 
   }
  if(currentUrl.indexOf("http://www.cio360.net/Page/2176/Default.aspx")>=0)
   {
      var current= $('#leo_tu');
      current.removeClass("item");
	  current.addClass("item_leo"); 
   }
   if(currentUrl.indexOf("http://www.cio360.net/Page/265/Default.aspx")>=0)
   {
      var current= $('#leo_zx');
      current.removeClass("item");
	  current.addClass("item_leo"); 
   }

   if(currentUrl.indexOf("http://www.cio360.net/")>=0&&currentUrl.indexOf("/Page/2173/Default.aspx")<0&&currentUrl.indexOf("/Page/2176/Default.aspx")<0&&currentUrl.indexOf("/Page/265/Default.aspx")<0)
   {
      var current= $('#leo_home');
      current.removeClass("item");
	  current.addClass("item_leo"); 
   }
  
    if(currentUrl.indexOf("http://industry.cio360.net/")>=0)
   {
      var current= $('#leo_industry');
      current.removeClass("item");
	  current.addClass("item_leo"); 
   }
    if(currentUrl.indexOf("http://finance.cio360.net/")>=0)
   {
      var current= $('#leo_finance');
      current.removeClass("item");
	  current.addClass("item_leo"); 
   }
    if(currentUrl.indexOf("http://energy.cio360.net/")>=0)
   {
      var current= $('#leo_energy');
      current.removeClass("item");
	  current.addClass("item_leo"); 
   }
    if(currentUrl.indexOf("http://tele.cio360.net/")>=0)
   {
      var current= $('#leo_tele');
      current.removeClass("item");
	  current.addClass("item_leo"); 
   }
   
    });
