//flash
function flashEmbed(src,w,h,id){

tag = '';
tag += '<object id="'+id+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+w+'" height="'+h+'">';
tag += '<param name="movie" value="'+src+'">';
tag += '<param name="allowScriptAccess" value="sameDomain">';
tag += '<param name="quality" value="high">';
tag += '<param name="wmode" value="transparent">';
tag += '<embed name="'+id+'" src="'+src+'" quality="high" allowScriptAccess="sameDomain" swLiveConnect="true" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'"></embed>';
 tag += '</object>';
document.write(tag);
}


//login
function ch(num)
{
	if( num == '1' ){
		//document.all.userid.style="background-image:url(../images/common/id_bg2.jpg);";
		document.getElementById('userid').className = "id2";
	}else if( num == '2' ){
		document.getElementById('pwd').className = "pwd2";
	}
}

//scroll
var StickerAnimation = function(){}; 
StickerAnimation.prototype = { 
  duration : null, 
  obj : null, 
  from : null, 
  to : null, 
  timer : 10, 
  step : 0, 
  start : function(obj, from, to, duration, type){ 
		var self = this; 
		this.obj = obj; 
		this.from = from; 
		this.to = to; 
		this.now = new Date; 
		this.duration = duration || 100; 
		this._delta = this['_delta' +(type || 'Elastic')]; 

		if(this.timer) 
			 this.stop(); 

		this.timer = setInterval(function(){self.run();}, 10); 
  }, 
  run : function(){ 

		var time = ((new Date) - this.now) / this.duration; 
		var delta = this._delta(time); 

		var step = Math.pow(2, this.step); 
		var dep_x = (this.to.x - this.from.x) * delta; 
		var dep_y = (this.to.y - this.from.y) * delta; 

		if(time > 1){ 
			 this.stop(); 
			 this.end(); 
		}else{ 

			 this.obj.style.marginLeft = this.from.x + dep_x + "px"; 
			 this.obj.style.marginTop = this.from.y + dep_y + "px"; 
		} 
  }, 
  end : function(){ 
		this.obj.style.marginLeft = (this.to.x) + "px"; 
		this.obj.style.marginTop = (this.to.y) + "px"; 
  }, 
  stop : function(){ 
		clearInterval(this.timer); 
		this.timer = 0; 
  }, 

  _deltaBounce : function(pos){ 
		var p = 1 - pos; 

		var value; 
		for (var a = 0, b = 1; 1; a += b, b /= 2){ 
			 if (p >= (7 - 4 * a) / 11){ 
				  value = - Math.pow((11 - 6 * a - 11 * p) / 4, 2) + b * b; 
				  break; 
			 } 
		} 
		return 1 - value; 
  }, 

  _deltaExpo : function(pos){ 
		var p = 1 - pos; 
		return 1 - Math.pow(2, 8 * (p - 1)); 
  }, 

  _deltaElastic : function(pos){ 
		var p = 1 - pos; 
		return 1 - Math.pow(2, 10 * --p) * Math.cos(20 * p * Math.PI * 1 / 3); 
  }, 

  _deltaStatic : function(pos){ 
		return 1; 
  } 

} 

var StickerManager = { 
  init : false, 
  stickers : [], 
  opts : [], 
  add : function(id, duration, type){ 

		if(!this.init){ 
			 var self = this; 
			 var init_event = function(){self.oninit();}; 
			 var scroll_event = function(){self.onscroll();}; 

			 if(window.attachEvent){ 
				  window.attachEvent('onload', init_event); 
				  window.attachEvent('onscroll', scroll_event); 
			 }else{ 
				  window.addEventListener('load', init_event, false); 
				  document.addEventListener('scroll', scroll_event, false); 
			 } 

			 this.init = true; 
		} 

		this.stickers.push(id); 
		this.opts.push({duration:duration,type:type}); 
  }, 

  oninit : function(){ 
		var sticker; 
		for(var x = 0, len = this.stickers.length; x < len; x++){ 
			 sticker = document.getElementById(this.stickers[x]); 
			 if(!sticker){ 
				  alert(this.stickers[x] + ' is bad id.'); 
				  this.stickers[x] = null; 
				  continue; 
			 } 
			 this.stickers[x] = sticker; 
			 sticker.style.marginLeft = sticker.style.marginTop = "0px"; 
		} 
  }, 

  onscroll : function(){ 
		var left = parseInt(document.body.scrollLeft); 
		var top = parseInt(document.body.scrollTop); 
		var sticker; 
		for(var x = 0, len = this.stickers.length; x < len; x++){ 
			 sticker = this.stickers[x]; 

			 if(!sticker) 
				  continue; 

			 if(!sticker.animation){ 
				  sticker.animation = new StickerAnimation(); 
			 }else{ 
				  sticker.animation.stop(); 
			 } 
			 
			 sticker.animation.start( 
				  sticker, 
				  {x:parseInt(sticker.style.marginLeft), y:parseInt(sticker.style.marginTop)}, 
				  {x:left, y:top}, 
				  this.opts[x].duration, 
				  this.opts[x].type 
			 ); 

		} 
  } 
}

// 
// ½ºÄ«ÀÌ ·Î±× »çÀÌÆ®ÀÇ ½ºÅ©¸³Æ®
//
function sky_script_exec(sky_uid)
{ 
	var Srv_Send_Info;
	var skyTurl;
	Srv_Url = 'http://' + sky_uid + '.sublog.co.kr/log_script/skycounter.php';
	skyCuid = sky_uid;
	Doc_Url = document.URL;
	
	skyCcpu = (navigator.cpuClass==''?'undefined':navigator.cpuClass);
	skyCcpu = (skyCcpu=='undefined'?'UNKNOWN':skyCcpu);
	CuserAgent = navigator.userAgent.toLowerCase();
	skyClang = (typeof(navigator.language) == 'undefined')?navigator.browserLanguage:navigator.language;
	skyCje = (navigator.javaEnabled() == true)?'1':'0';
	skyCce = (navigator.cookieEnabled == true)?'1':'0';
	skyCref = (document.referrer == ''?'bookmark':document.referrer);

	eval('try{ skyTref=top.document.referrer; }catch(_e){}');
	eval('try{skyTurl = top.document.location.href; }catch(_e){}');

	if ( skyCref==skyTurl ) { 
		skyCref = (skyTref==''?'bookmark':skyTref);
	}

	skyCtz = -((new Date()).getTimezoneOffset()/60);
	skyCcd = (typeof(screen.colorDepth) == 'undefined')?screen.pixelDepth:screen.colorDepth;
	skyCswh = screen.width + '*' + screen.height;
	skyCid = (typeof(skyMemberId)=='undefined'?'':skyMemberId);
	Srv_Send_Info = Srv_Url + '?Cuid=' + skyCuid + '&Doc_Url=' + escape(Doc_Url) + '&Ccpu=' + skyCcpu + 
			'&CuserAgent=' + CuserAgent + '&Clang=' + skyClang + '&Cje=' + skyCje + '&Cce=' + skyCce + '&Cref=' + 
			escape(skyCref) + '&Ctz=' + skyCtz + '&Ccd=' + skyCcd + '&Cswh=' + skyCswh + '&Cid=' + skyCid;

	return Srv_Send_Info;
}

