﻿function openTerms() {
	var win = window.open("/swf/html/terms.html", "popWin",'width=650,height=600,scrollbars=yes');
	win.focus();
	
}

function openCopyright() {
	var win = window.open("/swf/html/terms.html", "popWin",'width=650,height=600,scrollbars=yes');
	win.focus();
}

function openRss() {
	var win = window.open("http://feeds.feedburner.com/converse/cn", "rss");
	win.focus();
}

function gotoTop(){			
	$('body').scrollTo(0,500);
} 

function gotoPosition(pos){			
	$('body').scrollTo(pos,500);
} 

function openURL(url){
	window.open(url);
}

/*
*add by Ivan begin
*/
function openURLForTout(url){
	window.open(url,"_self");
}
/*end*/
function openTnCPage(){
	openTerms();
}


function getBaseUrl(){

	return document.location.toString().split("#")[0];
	
}


function callMusicPlayer(){
	 window.open('musicPlayer/musicPlayer.html','newwindow','height=106,width=236');
}

function shareFunction(val,title){

	var u = document.location;
	var link = encodeURIComponent(u);
	
	title = '匡威 Converse '+title;
	
	var url = '';
	var tag = '';
	
	switch(val){
		
		case '1':
			var encodeString = encodeURIComponent(title);
			url = "http://share.renren.com/share/buttonshare.do?link="+link+"&title="+encodeString;
			tag = "/click/product_section_pdp_share_renren_click";
			break;
			
		case '2':
			var encodeString = encodeURIComponent(title);
			url = "http://www.kaixin001.com/repaste/share.php?rurl="+link+"&rtitle="+encodeString;
			tag = "/click/product_section_pdp_share_kaixin001_click";
			break;
			
		case '3':
			var encodeString = title;
			url = "http://www.douban.com/recommend/?url="+link+"&title="+encodeString;
			tag = "/click/product_section_pdp_share_douban_click";
			break;
		
		case '4':
			var encodeString = encodeURIComponent(title);
			url = "http://v.t.sina.com.cn/share/share.php?url="+link+"&title="+encodeString;
			tag = "/click/product_section_pdp_share_tsina_click";
			break;
	}
	
	track(tag);
	window.open(url);
}

var musicPlayerState = 0;


function setMusicPlayerValue(type){

	musicType = type;
	
}


function getMusicPlayerValue(){
	
	return musicType;

}


function lacesFit(){
	
	var height = 1196;
	
	if(screen.width==1024&&screen.height==768){
	
			swffit.fit("flashContent", 1000, height);
		
	}else{
	
			swffit.fit("flashContent", 1050, height);
	}
	
}


function loveNoiseFit(){
	
	var height = 2118;
	
	if(screen.width==1024&&screen.height==768){
	
			swffit.fit("flashContent", 1000, height);
		
	}else{
	
			swffit.fit("flashContent", 1050, height);
	}
	
}
