function keep_marquee_mask(){
return;
show_mask_flag = 1;
}
function show_marquee_mask(){
return;
if($("marquee_title").innerHTML == ''){
return;
}
show_mask_flag = 1;
window.setTimeout("do_show_marquee_mask()", 10);
}
function hide_marquee_mask(){
return;
show_mask_flag = -1;
window.setTimeout("do_hide_marquee_mask()", 100);
}
function show_marquee_url(){
if(marquee[marquee_id][3]){
window.open(marquee[marquee_id][3]);
}
}
function show_marquee_pageup(){
$("marquee_pageup").style.opacity = 0.9;
}
function hide_marquee_pageup(){
$("marquee_pageup").style.opacity = 0.1;
}
function marquee_pageup(){
window.clearTimeout(marquee_timeout);
next_marquee_dir = -1;
$("marquee_video").innerHTML = "";
$("marquee_video").style.display = "none";
rotate_marquee();
}
function show_marquee_pagedown(){
$("marquee_pagedown").style.opacity = 0.9;
}
function hide_marquee_pagedown(){
$("marquee_pagedown").style.opacity = 0.1;
}
function marquee_pagedown(){
window.clearTimeout(marquee_timeout);
next_marquee_dir = 1;
$("marquee_video").innerHTML = "";
$("marquee_video").style.display = "none";
rotate_marquee();
}
function show_six_panel_cell(id){
current_six_panel_id = id;
for(var i = 0; i < $("six_panel").getElementsByTagName("div").length; i ++){
hide_six_panel_cell(i);
}
var panel = $("six_panel").getElementsByTagName("div")[id];
panel.className = "six-panel-cell-on";
if(six_feature_timeout){
window.clearTimeout(six_feature_timeout);
}
do_show_six_bg(id);
}
function hide_six_panel_cell(id){
if(id == current_six_panel_id){
return;
}
var panel = $("six_panel").getElementsByTagName("div")[id];
panel.className = "six-panel-cell";
}
function horse_rotate_right(){
var center_horse = "cell_" + circle_array(get_most_center_horse_id() * 1 + 1, horse_length);
last_horse_rotate_dir = -1;
rotate_to($(center_horse),1);
}
function show_big_news_left(){
if(big_news_left_timeout){
window.clearTimeout(big_news_left_timeout);
}
big_news_left_timeout = window.setTimeout("do_show_big_news_left()", 20);
}
function hide_big_news_left(){
if(big_news_left_timeout){
window.clearTimeout(big_news_left_timeout);
}
big_news_left_timeout = window.setTimeout("do_hide_big_news_left()", 20);
}
function show_big_news_right(){
if(big_news_right_timeout){
window.clearTimeout(big_news_right_timeout);
}
big_news_right_timeout = window.setTimeout("do_show_big_news_right()", 20);
}
function hide_big_news_right(){
if(big_news_right_timeout){
window.clearTimeout(big_news_right_timeout);
}
big_news_right_timeout = window.setTimeout("do_hide_big_news_right()", 20);
}
function show_button(obj){
obj.className = "button-on";
}
function hide_button(obj){
obj.className = "button-off";
}
function show_more_news(){
// alert(news_page);
// alert(news.length);
if(news_page * 5 < news.length) {
news_page ++;
}
else{
return;
}
var max_news = news_page * 5;
if(max_news > news.length){
max_news = news.length;
}
//console.log("max_news" + max_news);
for(var i = news_page * 5 - 5; i < max_news; i ++){
if(i == news.length)
break;
add_news_fall(news[i][0]);
}
}
function video_move_left(){
video_move_dir = -1;
move_video(1);
}
function stop_video_rotate(){
//console.log("stop "+video_move_dir);
window.clearTimeout(vr_state);
if(video_move_dir != 0){
current_dir = video_move_dir;
}
else{
return;
}
video_move_dir = 0;
}
function start_video_rotate(){
vr_state = window.setTimeout("do_start_video_rotate()", 200);
//console.log("try to start ");
}
function video_move_right(){
video_move_dir = 1;
move_video(1);
}
var vr_state;
var marquee = Array();
var marquee_id = 0;
var marquee_timeout;
var marquee_video_player=document.getElementById("marquee_video_player");
function rotate_marquee(){
if(marquee_margin == 0){
if(mask_opacity > 0){
marquee_timeout = window.setTimeout("rotate_marquee()", 1000);
return;
}
marquee_dir = next_marquee_dir;
}
marquee_margin += marquee_dir;
if(marquee_dir == -1){
$("marquee_0").style.marginLeft = transfer_vw((-marquee_margin / 10 * 1920 - 1920));
if(marquee_margin == 10 * marquee_dir){
marquee_margin = 0;
marquee_id += (marquee.length + marquee_dir);
marquee_id %= marquee.length;
$("marquee_1").getElementsByTagName("img")[0].src = marquee[marquee_id][0];
$("marquee_0").style.marginLeft = "-100vw";
$("marquee_2").getElementsByTagName("img")[0].src = marquee[(marquee_id + 1) % marquee.length][0];
$("marquee_0").getElementsByTagName("img")[0].src = marquee[(marquee_id + marquee.length - 1) % marquee.length][0];
// $("marquee_mask").getElementsByTagName("div")[0].getElementsByTagName("div")[0].innerHTML = marquee[marquee_id][1];
// $("marquee_mask").getElementsByTagName("div")[0].getElementsByTagName("div")[1].innerHTML = marquee[marquee_id][2];
if(marquee[marquee_id][3]){
$("marquee_slide_container").style.cursor = "pointer;";
}
else{
$("marquee_slide_container").style.cursor = "auto;";
}
if(marquee[marquee_id][4] == 1){
$("marquee_video").style.display = "block";
$("marquee_video").innerHTML = '';
$("marquee_video_player").onended = function(){
$("marquee_video").innerHTML = "";
$("marquee_video").style.display = "none";
rotate_marquee();
}
}
else{
marquee_timeout = window.setTimeout("rotate_marquee()", 3000);
}
}
else{
marquee_timeout = window.setTimeout("rotate_marquee()", 20);
}
}
else{
$("marquee_1").style.marginLeft = transfer_vw((-marquee_margin / 10 * 1920));
if(marquee_margin == 10 * marquee_dir){
marquee_margin = 0;
marquee_id += (marquee.length + marquee_dir);
marquee_id %= marquee.length;
$("marquee_1").getElementsByTagName("img")[0].src = marquee[marquee_id][0];
$("marquee_1").style.marginLeft = "-0vw";
$("marquee_2").getElementsByTagName("img")[0].src = marquee[(marquee_id + 1) % marquee.length][0];
$("marquee_0").getElementsByTagName("img")[0].src = marquee[(marquee_id + marquee.length - 1) % marquee.length][0];
// $("marquee_mask").getElementsByTagName("div")[0].getElementsByTagName("div")[0].innerHTML = marquee[marquee_id][1];
// $("marquee_mask").getElementsByTagName("div")[0].getElementsByTagName("div")[1].innerHTML = marquee[marquee_id][2];
if(marquee[marquee_id][3]){
$("marquee_slide_container").style.cursor = "pointer";
$("marquee_1").getElementsByTagName("img")[0].style.cursor = "pointer";
}
else{
$("marquee_slide_container").style.cursor = "auto";
$("marquee_1").getElementsByTagName("img")[0].style.cursor = "auto";
}
if(marquee[marquee_id][4] == 1){
$("marquee_video").style.display = "block";
$("marquee_video").innerHTML = '';
$("marquee_video_player").onended = function(){
$("marquee_video").innerHTML = "";
$("marquee_video").style.display = "none";
rotate_marquee();
}
}
else{
marquee_timeout = window.setTimeout("rotate_marquee()", 3000);
}
}
else{
marquee_timeout = window.setTimeout("rotate_marquee()", 20);
}
}
}
var marquee_margin = 0;
var mask_opacity = 0;
var six_feature_timeout;
function do_show_six_bg(id){
//document.title = id;
if(six_feature_change == id){
if($("six_feature_bg").style.opacity < 1){
$("six_feature_bg").style.opacity = $("six_feature_bg").style.opacity * 1 + 0.1;
$("six_blue").style.width = transfer_vw($("six_feature_bg").style.opacity * 800 + 200);
six_feature_timeout = window.setTimeout("do_show_six_bg(" + id + ")", 20);
}
else{
}
}
else{
if($("six_feature_bg").style.opacity > 0){
$("six_feature_bg").style.opacity -= 0.1;
$("six_blue").style.width = transfer_vw($("six_feature_bg").style.opacity * 800 + 200);
}
else{
six_feature_change = id;
$("six_feature_bg").src = six_feature[id][0];
$("six_blue_title").innerHTML = six_feature[id][1];
$("six_blue_content").innerHTML = six_feature[id][2];
}
six_feature_timeout = window.setTimeout("do_show_six_bg(" + id + ")", 20);
}
}
var six_feature_change = 0;
var six_feature = Array();
function horse_rotate_left(){
var center_horse = "cell_" + circle_array(get_most_center_horse_id() - 1, horse_length);
last_horse_rotate_dir = 1;
rotate_to($(center_horse),1);
}
var big_news_right_timeout;
function do_show_big_news_right(){
if($("slice_right_yellow").style.opacity < 1){
$("slice_right_yellow").style.marginRight = transfer_vw($("slice_right_yellow").style.opacity * 1000 - 1000);
$("slice_right_yellow").style.opacity = $("slice_right_yellow").style.opacity * 1 + 0.1;
big_news_right_timeout = window.setTimeout("do_show_big_news_right()", 20);
}
}
function do_hide_big_news_right(){
if($("slice_right_yellow").style.opacity > 0.1){
$("slice_right_yellow").style.opacity = $("slice_right_yellow").style.opacity - 0.1;
$("slice_right_yellow").style.marginRight =transfer_vw($("slice_right_yellow").style.opacity * 1000 - 1000);
big_news_right_timeout = window.setTimeout("do_hide_big_news_right()", 20);
}
}
var big_news_left_timeout;
function do_show_big_news_left(){
if($("slice_left_yellow").style.opacity < 1){
$("slice_left_yellow").style.marginLeft = transfer_vw($("slice_left_yellow").style.opacity * 1000 - 1000);
$("slice_left_yellow").style.opacity = $("slice_left_yellow").style.opacity * 1 + 0.1;
big_news_left_timeout = window.setTimeout("do_show_big_news_left()", 20);
}
}
function do_hide_big_news_left(){
if($("slice_left_yellow").style.opacity > 0.1){
$("slice_left_yellow").style.opacity = $("slice_left_yellow").style.opacity - 0.1;
$("slice_left_yellow").style.marginLeft = transfer_vw($("slice_left_yellow").style.opacity * 1000 - 1000);
big_news_left_timeout = window.setTimeout("do_hide_big_news_left()", 20);
}
}
function circle_array(id, count){
return (id + count) % count;
}
function get_most_center_horse_id(){
var min_diff = max_screen_width;
var min_id = -1;
for(var i = 0; i < horse_length; i ++){
var diff = 0;
if(degrees[i] <= 180) {
diff = degrees[i];
}
else{
diff = 360 - degrees[i];
}
if(diff < min_diff){
min_id = i;
min_diff = diff;
}
}
return min_id;
}
var horse_length;
function out_rotate_to(obj){
mouse_on_horse = -1;
}
function rotate_to(){
var auto_flag = 0;
var obj = arguments[0];
if(obj.style.opacity <= 0){
return;
}
chosen_horse = obj.id.substr(5);
if(arguments.length > 1){
if(arguments[1] != 1){
mouse_on_horse = chosen_horse;
}
}
else{
mouse_on_horse = chosen_horse;
}
//document.title = obj.id;
//console.log('chosen_horse=' + chosen_horse);
//console.log('chosen_horse=' + chosen_horse + ',chosen_horse_degree='+circle_degree(degrees[chosen_horse]));
var target_horse = -1;
if(degrees[chosen_horse] < 90){
//console.log('right clicked ' + chosen_horse);
for(var i = 0; i < horse_length; i ++){
//console.log("i=" + i + ", degree=" + origin_degrees[circle_array(chosen_horse * 1 - i, horse_length)]);
if(origin_degrees[circle_array(chosen_horse - i, horse_length)] == 0){
target_horse = i;
break;
}
}
//console.log('span='+target_horse);
for(var i = 0; i < horse_length; i ++){
target_degrees[i] = origin_degrees[circle_array(i - target_horse, horse_length)];
}
last_horse_rotate_dir = -1;
}
else{
//console.log('left clicked');
for(var i = 0; i < horse_length; i ++){
// console.log("i=" + i + ", degree=" + origin_degrees[circle_array(chosen_horse * 1 + i, horse_length)]);
if(origin_degrees[circle_array(chosen_horse * 1 + i, horse_length)] == 0){
target_horse = i;
break;
}
}
//console.log('span='+target_horse);
for(var i = 0; i < horse_length; i ++){
target_degrees[i] = origin_degrees[circle_array(i + target_horse, horse_length)];
}
last_horse_rotate_dir = 1;
}
if(horse_to == 0){
horse_to = window.setTimeout("rotate()", 10);
}
}
var news_page = 1;
var news = Array();
function init(){
if($("video")){
horse_length = 33;
video_length = 13;
$("video").style.width = video_length * 18.5 * 3 + "vw";
$("video_container_0").style.width = video_length * 18.5 + "vw";
$("video_container_1").style.width = video_length * 18.5 + "vw";
$("video_container_2").style.width = video_length * 18.5 + "vw";
$("video_container_0").style.marginLeft = -video_length * 18.5 + "vw";
window.setTimeout("move_video()", 20);
}
if($("show")){
var brands = new Array();
brands.push({'id':'1', 'img' : '/brand/1/logo.png'});
brands.push({'id':'2', 'img' : '/brand/2/logo.png'});
brands.push({'id':'4', 'img' : '/brand/4/logo.png'});
brands.push({'id':'6', 'img' : '/brand/6/logo.png'});
brands.push({'id':'23', 'img' : '/brand/23/logo.png'});
brands.push({'id':'43', 'img' : '/brand/43/logo.png'});
brands.push({'id':'8', 'img' : '/brand/8/logo.png'});
brands.push({'id':'9', 'img' : '/brand/9/logo.png'});
brands.push({'id':'13', 'img' : '/brand/13/logo.png'});
brands.push({'id':'16', 'img' : '/brand/16/logo.png'});
brands.push({'id':'19', 'img' : '/brand/19/logo.png'});
brands.push({'id':'27', 'img' : '/brand/27/logo.png'});
brands.push({'id':'28', 'img' : '/brand/28/logo.png'});
brands.push({'id':'14', 'img' : '/brand/14/logo.png'});
brands.push({'id':'17', 'img' : '/brand/17/logo.png'});
brands.push({'id':'18', 'img' : '/brand/18/logo.png'});
brands.push({'id':'20', 'img' : '/brand/20/logo.png'});
brands.push({'id':'29', 'img' : '/brand/29/logo.png'});
brands.push({'id':'10', 'img' : '/brand/10/logo.png'});
brands.push({'id':'24', 'img' : '/brand/24/logo.png'});
brands.push({'id':'32', 'img' : '/brand/32/logo.png'});
brands.push({'id':'34', 'img' : '/brand/34/logo.png'});
brands.push({'id':'37', 'img' : '/brand/37/logo.png'});
brands.push({'id':'15', 'img' : '/brand/15/logo.png'});
brands.push({'id':'25', 'img' : '/brand/25/logo.png'});
brands.push({'id':'42', 'img' : '/brand/42/logo.png'});
brands.push({'id':'21', 'img' : '/brand/21/logo.png'});
brands.push({'id':'26', 'img' : '/brand/26/logo.png'});
brands.push({'id':'31', 'img' : '/brand/31/logo.png'});
brands.push({'id':'38', 'img' : '/brand/38/logo.png'});
brands.push({'id':'22', 'img' : '/brand/22/logo.png'});
brands.push({'id':'35', 'img' : '/brand/35/logo.png'});
brands.push({'id':'30', 'img' : '/brand/30/logo.png'});
for(var i = 0; i < (show_range + 1) / 2; i ++){
degrees[circle_array(highlight_horse * 1 + i, horse_length)] = display_range / (show_range - 1) * i;
degrees[circle_array(highlight_horse * 1 - i, horse_length)] = circle_degree(display_range / (show_range - 1) * (-i));
}
for(var i = 0; i < horse_length - show_range; i ++){
degrees[circle_array(highlight_horse + (show_range + 1) / 2 + i, horse_length)] = hidden_range / (horse_length - show_range - 1) * i + (180 - hidden_range) / 2 + 90;
}
var str = '';
for(var i = 0; i < horse_length; i ++){
current_w = (cell_width + 0.6 * cell_width * cos(degrees[i]));
current_h = (cell_height + 0.6 * cell_height * cos(degrees[i]));
cell_left = (showerWidth / 2 + horse_radius * sin(degrees[i]) - current_w / 2).toFixed(2);
cell_top = (showerHeight / 2 + horse_radius * cos(degrees[i]) - current_h / 2).toFixed(2)
cell_top /= 4;
target_degrees[i] = degrees[i];
origin_degrees[i] = degrees[i];
str += ('
0) ? Math.sqrt(cos(degrees[i])) : 0) + '" id="cell_' + i +'" onmouseover="rotate_to(this)" onmouseout="out_rotate_to(this)" onclick="window.open(\'brand_detail.php?id=' + brands[i]["id"] + '\');">
');
}
$("show").innerHTML = str;
horse_rotate_left();
}
if($("state")){
var str = '';
$("state_container").innerHTML = str;
$("state").options.selectedIndex = 0;
str = '';
$("wanted_brand_container").innerHTML = str;
$("wanted_brand").options.selectedIndex = 0;
}
if($("marquee_1")){
marquee.push(["/uploads/1469778586.jpg","","","", 0, ""]);
marquee.push(["/uploads/1465873615.jpg","","","http://www.tmall.com", 0, "/uploads/1466144767.mp4"]);
marquee.push(["/uploads/1465873492.jpg","","","https://www.baidu.com/", 0, ""]);
$("marquee_1").parentNode.style.width = marquee.length * 100 + "vw";
$("marquee_1").getElementsByTagName("img")[0].src = marquee[marquee_id][0];
if(marquee[marquee_id][3]){
$("marquee_1").getElementsByTagName("img")[0].style.cursor = "pointer";
}
$("marquee_2").getElementsByTagName("img")[0].src = marquee[(marquee_id + 1) % marquee.length][0];
$("marquee_0").getElementsByTagName("img")[0].src = marquee[(marquee_id + marquee.length - 1) % marquee.length][0];
marquee_timeout = window.setTimeout("rotate_marquee()", 3000);
}
if($("six_feature_bg")){
six_feature.push(["images/six-feature_1.jpg", "衣·时尚", "衣恋集团拥有快时尚、女装、男装、童装、配件等时尚品牌,我们的梦想是让世界各个角落,不论男女老少,都能够拥有一件衣恋的衣服。"]);
six_feature.push(["images/six-feature_2.jpg", "食·美食", "在衣恋,不仅有最正宗的韩式料理,来自法国的美妙甜品,更有源自美国加州的浓郁咖啡,让您可以尽享世界美食。"]);
six_feature.push(["images/six-feature_3.jpg", "住·居家", "衣恋集团拥有韩国领军大型家居生活馆,以焕美生活为核心,希望以精致的商品和人性的设计为您的住家增添温馨和焕然惊喜。"]);
six_feature.push(["images/six-feature_4.jpg", "休·休旅", "从韩国市区的特级酒店到济州岛的度假村,从中国桂林喜来登到塞班岛度假村,衣恋集团用最顶级的酒店环境与服务迎接来自世界各地的你。"]);
six_feature.push(["images/six-feature_5.jpg", "美·美品", "衣恋集团旗下休闲购物商场现已进驻中国,致力于让您能够以最优的价格购买衣恋旗下美品及其他世界名品,在舒适优美的购物环境中让您尽享韩流购物体验。"]);
six_feature.push(["images/six-feature_6.jpg", "乐·娱乐", "衣恋集团不仅拥有韩国最具人气的卡通形象乐园及主题公园,更是聚集了最当红的韩国人气偶像团体代言旗下品牌,为您带来最具潮流的娱乐资讯。"]);
for(var i = 0; i < six_feature.length; i ++){
var tmp_img = new Image();
if(i == six_feature.length)
break;
tmp_img.src = six_feature[i][0];
}
show_six_panel_cell(0);
}
if($("news_container")){
news.push(["/images/news12.jpg", "休旅", "2016-08-01", "『肯辛顿酒店塞班』携手马里亚纳观光局共同举办推介会", "已于2016年7月21日开业的“肯辛顿酒店塞班(Kensington Hotel Saipan)”是衣恋集团在海外第一次上市的肯辛顿品牌,位于塞班北部的圣洛克地区,为顾客提供惬意安静闲适度假环境。",3,12]);
news.push(["/images/news2.jpg", "美食", "2016-06-15", "自然别谷进驻中国 ", "衣恋集团旗下韩式自助餐餐厅自然别谷1号店11月7号在上海浦东正大广场开业",1,2]);
news.push(["/images/news4.jpg", "购物", "2016-06-15", "Luxury Gallery一号店开业 ", "衣恋集团旗下奢侈品购物天堂Luxury Gallery入驻上海百盛优客城市广场,并于1月15日开业。Dior 、Burberry 、Gucci、Coach、Michael Kors、Tory Burc",2,4]);
news.push(["/images/news6.jpg", "休旅", "2016-06-15", "韩国衣恋联手中国万达布局韩国旅游产业 ", "近日,韩国衣恋集团与中国万达集团决定,联手开展出境游(外国人韩国游)相关业务,双方按持股比例50比50成立合作旅行社,目标是,每年吸引100万中国游客赴韩旅游。",3,6]);
news.push(["/images/news7.jpg", "时尚", "2016-06-15", "SHOOPEN鞋范潮流来袭 中国首店九月在沪登陆 ", "SHOOPEN鞋范——作为近两年来最为热门的首家鞋类快时尚品牌,背靠韩国衣恋集团,以不同于传统鞋类品牌的销售方式,提倡时尚多样、极具性价比的SPA运营模式,在韩国迅速崛起,风靡大街小巷。",4,7]);
news.push(["/images/news8.jpg", "慈善", "2016-06-15", "中国衣恋集团荣获第九届“中华慈善奖” ", "2015年12月,中国衣恋集团以其长期对社会慈善事业的支持,而获得第九届“中华慈善奖”。在此之前,致力于慈善事业的衣恋集团曾获得第六届,第七届 “中华慈善奖”,并连续两年被选为“最具爱心捐赠企业”。",5,8]);
news.push(["/images/news5.jpg", "购物", "2016-06-15", "百盛优客城市广场盛大开业", "位于天山路的百盛优客城市广场于2016年1月15日正式营业,为申城人点亮了一种崭新的“优客生活”——以“优价,优品,优趣,要去”的理念打造最年轻时尚的城市奥莱。",2,5]);
news.push(["/images/news3.jpg", "美食", "2016-06-15", "衣恋集团收购The Coffee Bean & Tea Leaf", "衣恋集团于2015年8月24日收购了跨国咖啡&茶品牌公司The Coffee Bean & Tea Leaf(以下简称Coffee Bean)的中国经营权",1,3]);
news.push(["/images/news27.jpg", "资讯", "2017-03-07", "衣念(上海)时装建设工程竣工环保验收公示", "衣念(上海)时装贸易有限公司新建厂房坡道1、平台1建设工程竣工环保验收公示",6,27]);
news.push(["/images/news25.jpg", "资讯", "2017-03-07", "衣念(上海)时装贸易有限公司新建厂房环保措施落实情况报告", "衣念(上海)时装贸易有限公司新建厂房 坡道1、平台1 环 保 措 施 落 实 情 况 报 告",6,25]);
news.push(["/images/news24.jpg", "资讯", "2017-03-07", "衣念(上海)时装贸易有限公司新建厂房项目 非重大变动的环境影响分析报告", "衣念(上海)时装贸易有限公司新建厂房项目 非重大变动的环境影响分析报告",6,24]);
news.push(["/images/news23.jpg", "资讯", "2017-03-07", "衣恋时装建设工程竣工环保验收公示", "衣恋时装(上海)有限公司建设工程竣工环保验收公示",6,23]);
news.push(["/images/news22.jpg", "资讯", "2017-03-07", "衣恋时装(上海)有限公司新建厂房及仓储用房项目 非重大变动的环境影响分析报告", "衣恋时装(上海)有限公司新建厂房及仓储用房项目 非重大变动的环境影响分析报告",6,22]);
news.push(["/images/news21.jpg", "资讯", "2017-03-07", "新建厂房及仓储用房C楼项目环保措施落实情况报告", "新建厂房及仓储用房C楼项目环保措施及落实情况报告",6,21]);
for(var i = 0; i < news_page * 5; i ++){
if(i == news.length)
break;
add_news_fall(news[i][0]);
}
}
if($("csr_container")){
csr.push(["/images/csr4.jpg", "衣恋中国每月组织员工志愿者至孤儿院及脑瘫患儿康复中心服务","csr_detail.php?id=4"]);
csr.push(["/images/csr1.jpg", "为资助特困特优的高中生,设立“衣恋阳光助学”,帮助渴望知识的孩子步入大学","csr_detail.php?id=1"]);
csr.push(["/images/csr3.jpg", "衣恋中国已累计为中国灾区人民捐赠超过19万个LIFE-BAG","csr_detail.php?id=3"]);
for(var i = 0; i < csr.length; i ++){
if(i == csr.length)
break;
add_csr_fall(csr[i][0]);
}
window.setTimeout("do_csr(1)", 200);
window.setTimeout("do_csr(2)", 300);
window.setTimeout("do_csr(3)", 400);
}
draw_weibo();
//var horse_length = 43;
}
var show_range = 7;
function move_video(){
if(video_move_dir == 0){
window.setTimeout("move_video()", 20);
return;
}
var tmp_margin = $("video_container_0").style.marginLeft;
tmp_margin = tmp_margin.substr(0, tmp_margin.length - 2);
tmp_margin = tmp_margin * 1 + (video_move_dir * 1.85);
var max_margin = video_move_dir * video_length * 18.5;
if(video_move_dir == -1){
if(tmp_margin <= max_margin){
$("video_container_0").style.marginLeft = tmp_margin + "vw";
$("video_container_1").style.marginLeft = tmp_margin - max_margin + "vw";
}
else{
$("video_container_0").style.marginLeft = tmp_margin + "vw";
}
}
else{
if(tmp_margin <= -max_margin){
$("video_container_0").style.marginLeft = tmp_margin + "vw";
$("video_container_1").style.marginLeft = tmp_margin + max_margin + "vw";
}
else{
$("video_container_0").style.marginLeft = tmp_margin + "vw";
}
}
if(tmp_margin <= max_margin * 2 && video_move_dir == -1){
$("video_container_0").style.marginLeft = -18.5 * video_length + "vw";
}
if(tmp_margin >= 0 && video_move_dir == 1){
$("video_container_0").style.marginLeft = -18.5 * video_length + "vw";
}
// document.title = tmp_margin + "," + max_margin + "," + video_move_dir;
if(arguments.length > 0){
if(arguments[0] == '1'){
window.clearTimeout(video_timeout);
}
}
if(Math.abs(Math.round(tmp_margin / 74) * 74 - tmp_margin) < 1){
video_timeout = window.setTimeout("move_video()", 1000);
}
else{
video_timeout = window.setTimeout("move_video()", 10);
}
}
var video_move_dir = 1;
var degrees = Array();
var highlight_horse = 5;
var display_range = 160;
function circle_degree(degree){
return (degree + 360) % (360);
}
var hidden_range = 170;
var cell_width=192;
function cos(degree){
return Math.cos(degree / 180 * Math.PI);
}
var cell_height=181;
var showerWidth= 1344;
var horse_radius = 600;
function sin(degree){
return Math.sin(degree / 180 * Math.PI);
}
var showerHeight= 400;
var target_degrees = Array();
var origin_degrees = Array();
var horse_to = 0;
function add_news_fall(url){
// var url = "images/" + parseInt(Math.random()*7+1) + ".jpg";
news_img_stack.push(url);
if(news_img_stack.length == 1){
add_news_fall_stack(url);
}
}
var news_img_stack = Array();
function add_news_fall_stack(url){
var img = new Image();
img.onload = function(){
img.onload = null;
draw_news_fall(img);
}
img.src = url;
}
var csr = Array();
function add_csr_fall(url){
// var url = "images/" + parseInt(Math.random()*7+1) + ".jpg";
csr_img_stack.push(url);
if(csr_img_stack.length == 1){
add_csr_fall_stack(url);
}
}
var csr_img_stack = Array();
function add_csr_fall_stack(url){
var img = new Image();
img.onload = function(){
img.onload = null;
draw_csr_fall(img);
}
img.src = url;
}
function draw_weibo(){
if(document.body.clientWidth < 900){
phone_mod = 1;
}
else{
phone_mod = 0;
}
if($("weibo_container")){
if(phone_mod == 1){
$("weibo_container").style.display = "none";
}
else{
$("weibo_container").style.display = "block";
$("weibo_container").innerHTML = '';
var weibo_frame_width = $("weibo_frame").clientWidth;
var weibo_frame_height = $("weibo_frame").clientHeight;
$("weibo_frame").src = "http://widget.weibo.com/list/list.php?language=zh_cn&width=" + (weibo_frame_width - 2) + "&height=" + (weibo_frame_height - 2)+ "&listid=3958555063845768&appkey=2308579169&uname=%E6%9C%AA%E6%9D%A5%E8%9E%8D%E5%90%88&uid=1879143802&listname=%E8%A1%A3%E6%81%8B%E9%9B%86%E5%9B%A2&color=&showcreate=0&isborder=0&info=0&sidebar=0&footbar=1&skin=0&dpc=1";
}
}
}
function rotate(){
for(var i = 0; i < horse_length; i ++){
degrees[i] = circle_degree(degrees[i]);
var degree_diff = (target_degrees[i] - degrees[i]);
if(degree_diff > 180){
degree_diff = degree_diff - 360;
}
else{
if(degree_diff < -180){
degree_diff = degree_diff + 360;
}
}
degrees[i] += (degree_diff / horse_length * 2);
current_w = (cell_width + 0.6 * cell_width * cos(degrees[i]));
current_h = (cell_height + 0.6 * cell_height * cos(degrees[i]));
cell_left = (showerWidth / 2 + horse_radius * sin(degrees[i]) - current_w / 2).toFixed(2);
cell_top = (showerHeight / 2 + horse_radius * cos(degrees[i]) - current_h / 2).toFixed(2)
cell_top /= 4;
document.getElementById("cell_" + i).style.left = transfer_vw(cell_left);
document.getElementById("cell_" + i).style.top = transfer_vw(cell_top);
document.getElementById("cell_" + i).style.width = transfer_vw(current_w);
document.getElementById("cell_" + i).style.height = transfer_vw(current_h);
document.getElementById("cell_" + i).style.zIndex = parseInt(cos(degrees[i])*100);
document.getElementById("cell_" + i).style.opacity = (cos(degrees[i]) > 0) ? Math.sqrt(cos(degrees[i])) : 0;
}
if(chosen_horse){
//console.log(chosen_horse + "," + degrees[chosen_horse] + "," + last_horse_rotate_dir);
if(degrees[chosen_horse] >= 359 || degrees[chosen_horse] <= 1){
//console.log(mouse_on_horse);
if(mouse_on_horse != chosen_horse){
if(last_horse_rotate_dir == 1){
horse_rotate_left();
}
else{
horse_rotate_right();
}
}
}
}
horse_to = window.setTimeout("rotate()", 10);
}
function draw_news_fall(img){
news_img_stack.shift();
var width = img.width;
var height = img.height;
//console.log(width + "," +height);
//alert(width);
var url = img.src;
height = height / width * news_width_each;
width = news_width_each;
var column;
if(deepest_news[0] <= deepest_news[1] && deepest_news[0] <= deepest_news[2]){
column = 0;
}
else{
if(deepest_news[1] <= deepest_news[0] && deepest_news[1] <= deepest_news[2]){
column = 1;
}
else{
if(deepest_news[2] <= deepest_news[0] && deepest_news[2] <= deepest_news[1]){
column = 2;
}
}
}
//alert(news[news_count]);
var str = '';
str += '';
// str += '
';
str += '
';
str += '
';
str += '
' + news[news_count][2] + '
';
str += '
';
str += '
';
str += '
';
str += '
';
str += '
';
str += '
';
str += '
';
// str += '';
$("column_" + column).innerHTML += str;
var news_item = $("news_fall_" + news_count);
news_item.style.height = transfer_vw(height);
news_item.style.width = transfer_vw(width);
news_item.style.backgroundImage="url('" + url + "')";
news_item.style.backgroundSize="contain";
deepest_news[column] += height;
news_count ++;
if(news_img_stack.length > 0){
add_news_fall_stack(news_img_stack[0]);
}
}
var news_width_each = 420;
function draw_csr_fall(img){
csr_img_stack.shift();
var width = img.width;
var height = img.height;
var url = img.src;
height = height / width * csr_width_each;
width = csr_width_each;
var column;
if(deepest_csr[0] <= deepest_csr[1] && deepest_csr[0] <= deepest_csr[2]){
column = 0;
}
else{
if(deepest_csr[1] <= deepest_csr[0] && deepest_csr[1] <= deepest_csr[2]){
column = 1;
}
else{
if(deepest_csr[2] <= deepest_csr[0] && deepest_csr[2] <= deepest_csr[1]){
column = 2;
}
}
}
//alert(deepest_csr);
var str = '';
str += '';
str += '
';
str += '
' + csr[csr_count][1] + '
';
str += '
';
str += '
';
$("csr_column_" + column).innerHTML += str;
var csr_item = $("csr_fall_" + csr_count)
csr_item.style.backgroundImage="url('" + url + "')";
csr_item.style.backgroundSize="contain";
csr_item.style.height = transfer_vw(height);
csr_item.style.width = transfer_vw(width);
deepest_csr[column] += height;
csr_count ++;
if(csr_img_stack.length > 0){
add_csr_fall_stack(csr_img_stack[0]);
}
}
function do_csr(id){
var current_number = parseInt($("moving_number_" + id).innerHTML);
if(current_number == moving_number[id - 1]){
$("moving_number_" + id).innerHTML = "00000";
window.setTimeout("do_csr(" + id + ")", 20);
return;
}
if(moving_number[id - 1] - current_number >= 10000){
$("moving_number_" + id).innerHTML = current_number + 10000;
window.setTimeout("do_csr(" + id + ")", 20);
}
else{
if(moving_number[id - 1] - current_number >= 1000){
$("moving_number_" + id).innerHTML = current_number + 1000;
window.setTimeout("do_csr(" + id + ")", 20);
}
else{
if(moving_number[id - 1] - current_number >= 100){
$("moving_number_" + id).innerHTML = current_number + 100;
window.setTimeout("do_csr(" + id + ")", 20);
}
else{
if(moving_number[id - 1] - current_number >= 10){
$("moving_number_" + id).innerHTML = current_number + 10;
window.setTimeout("do_csr(" + id + ")", 20);
}
else{
$("moving_number_" + id).innerHTML = moving_number[id - 1];
window.setTimeout("do_csr(" + id + ")", 3000);
}
}
}
}
}
var csr_width_each = 420;
var deepest_news= [0,0,0];
var moving_number = [57386, 16793, 67172];
var mouse_on_horse = -1;
var next_marquee_dir = 1;
var deepest_csr= [0,0,0];
var news_count = 0;
var csr_count = 0;
function show_news_detail(id){
news_to[id] = 1;
if(!big_interval){
do_big_interval();
}
}
function hide_news_detail(id){
news_to[id] = -1;
if(!big_interval){
do_big_interval();
}
}
var news_to = Array();
var big_interval = 0;
function do_big_interval(){
for(var key in news_to){
if(news_to[key] == 1){
do_show_news_detail(key);
}
else{
if(news_to[key] == -1){
do_hide_news_detail(key);
}
}
}
for(var key in csr_to){
if(csr_to[key] == 1){
do_show_csr_detail(key);
}
else{
if(csr_to[key] == -1){
do_hide_csr_detail(key);
}
}
}
for(var key in video_to){
if(video_to[key] == 1){
do_show_video_detail(key);
}
else{
if(video_to[key] == -1){
do_hide_video_detail(key);
}
}
}
for(var key in video_news_to){
if(video_news_to[key] == 1){
do_show_video_news_detail(key);
}
else{
if(video_news_to[key] == -1){
do_hide_video_news_detail(key);
}
}
}
big_interval = window.setTimeout("do_big_interval()", 10);
}
function do_hide_news_detail(id){
var news_content_height = ($("news_content_" + id).style.height.substr(0, $("news_content_" + id).style.height.length - 2));
if($("news_category_" + id).style.opacity > 0){
$("news_category_" + id).style.opacity = $("news_category_" + id).style.opacity * 1 - 0.1;
$("news_category_" + id).style.marginTop = $("news_category_" + id).style.opacity * 2.76 / 1 - 2.76 + "vw";
$("news_content_" + id).style.opacity = $("news_content_" + id).style.opacity * 1 - 0.09;
$("news_content_" + id).style.marginTop = news_content_height - $("news_category_" + id).style.opacity * news_content_height + "vw";
//window.setTimeout("do_hide_news_detail('" + id + "')", 20);
}
}
function do_show_news_detail(id){
var news_content_height = ($("news_content_" + id).style.height.substr(0, $("news_content_" + id).style.height.length - 2));
var current_category_margin = $("news_category_" + id).style.marginTop.toString().substr(0, $("news_category_" + id).style.marginTop.toString().length - 2);
if(current_category_margin < 0){
$("news_category_" + id).style.marginTop = $("news_category_" + id).style.opacity * 2.76 / 1 - 2.76 + "vw";
$("news_content_" + id).style.marginTop = news_content_height - $("news_category_" + id).style.opacity * news_content_height + "vw";
$("news_category_" + id).style.opacity = $("news_category_" + id).style.opacity * 1 + 0.1;
$("news_content_" + id).style.opacity = $("news_content_" + id).style.opacity * 1 + 0.09;
}
}
var csr_to = Array();
var video_to = Array();
var video_news_to = Array();
function keep_news_detail(id){
show_news_detail(id);
}
var submenu_timeout = Array();
function do_start_video_rotate(){
video_move_dir = current_dir;
//console.log("started, "+video_move_dir);
}
function show_csr_detail(id){
csr_to[id] = 1;
if(!big_interval){
do_big_interval();
}
}
function do_show_csr_detail(id){
var csr_content_height = ($("csr_content_" + id).style.height.substr(0, $("csr_content_" + id).style.height.length - 2));
if($("csr_content_" + id).style.opacity < 1){
$("csr_content_" + id).style.marginTop = csr_content_height - $("csr_content_" + id).style.opacity * 5.5 + "vw";
$("csr_content_" + id).style.opacity = $("csr_content_" + id).style.opacity * 1 + 0.1;
}
}
function hide_csr_detail(id){
csr_to[id] = -1;
if(!big_interval){
do_big_interval();
}
}
function keep_csr_detail(id){
show_csr_detail(id);
}
function do_hide_csr_detail(id){
var csr_content_height = ($("csr_content_" + id).style.height.substr(0, $("csr_content_" + id).style.height.length - 2));
if($("csr_content_" + id).style.opacity > 0){
$("csr_content_" + id).style.opacity = $("csr_content_" + id).style.opacity * 1 - 0.1;
$("csr_content_" + id).style.marginTop = csr_content_height - $("csr_content_" + id).style.opacity * 5.5 + "vw";
}
}