/*************************************************
 * etnews¿¡¼­ »ç¿ëµÉ ÀÚ¹Ù½ºÅ©¸³Æ® ÇÔ¼öµé
 *
 * Æ÷Åä´º½º
 *	- photoMove()
 *	- popPhotoSlide()
 *
 * IT Plaza
 *	- chgItplazaDiv()
 *	- incNumITP()
 *
 * ÆË¾÷¶ç¿ì±â ÇÔ¼ö
 *	- openWindow()
 *************************************************/




/*
 *	Æ÷Åä´º½º
 */
	var cur = 0;
	var speed =10000;

	function photoMove(cn) {
		clearTimeout(timerID);
		var max_photo = 3;
		cur = cur + cn;
		if(cur>=max_photo)	cur = 0;
		else if(cur<0) cur = max_photo-1;

		document.getElementById('photo_roll_div0').style.display = 'none';
		document.getElementById('photo_roll_div1').style.display = 'none';
		document.getElementById('photo_roll_div2').style.display = 'none';

		tmp =  document.getElementById('photo_roll_div'+cur);

		tmp.style.display = '';

		timerID = setTimeout("photoMove(1)",speed);

	}

	function popPhotoSlide(id) {
		window.open("http://www.etnews.co.kr/photonews/photoslide.html?mc=m_002_00002&id="+id, 'photoslider','width=680, height=680, scrollbars=no, resizable = no, menubar = no, top=10, left=10');
	}





/*
 *	IT Plaza
 */
	function chgItplazaDiv(){
		for (var i=0;i<4;i++ ) {
	//		obj = eval('itplaza_div_'+i);
			obj = document.getElementById('itplaza_div_'+i);
			obj.innerHTML =  ITPLAZA_Array[itp_nm];
			incNumITP();
		}
	}

	function incNumITP(){
		itp_nm = itp_nm + 1;
		if (itp_cnt <= itp_nm) itp_nm = 0;
	}








/**
 * Javascript open window
 **/
///[ »õÃ¢¿­±â ¿É¼Çµé ]///////////////////////////////////
//width:°ª
//height:°ª
center:true;
fullscreen:true;
scrollbars:true;
menubars:true;
locationbar:true;
resizable:true;
//////////////////////////////////////////////////////////////

function openWindow(anchor, options) {

	var args = '';

	if (typeof(options) == 'undefined') { var options = new Object(); }
	if (typeof(options.name) == 'undefined') { options.name = 'win' + Math.round(Math.random()*100000); }

	if (typeof(options.height) != 'undefined' && typeof(options.fullscreen) == 'undefined') {
		args += "height=" + options.height + ",";
	}

	if (typeof(options.width) != 'undefined' && typeof(options.fullscreen) == 'undefined') {
		args += "width=" + options.width + ",";
	}

	if (typeof(options.fullscreen) != 'undefined') {
		args += "width=" + screen.availWidth + ",";
		args += "height=" + screen.availHeight + ",";
	}

	if (typeof(options.center) == 'undefined') {
		options.x = 0;
		options.y = 0;
		args += "screenx=" + options.x + ",";
		args += "screeny=" + options.y + ",";
		args += "left=" + options.x + ",";
		args += "top=" + options.y + ",";
	}

	if (typeof(options.center) != 'undefined' && typeof(options.fullscreen) == 'undefined') {
		options.y=Math.floor((screen.availHeight-(options.height || screen.height))/2)-(screen.height-screen.availHeight);
		options.x=Math.floor((screen.availWidth-(options.width || screen.width))/2)-(screen.width-screen.availWidth);
		args += "screenx=" + options.x + ",";
		args += "screeny=" + options.y + ",";
		args += "left=" + options.x + ",";
		args += "top=" + options.y + ",";
	}

	if (typeof(options.scrollbars) != 'undefined') { args += "scrollbars=1,"; }
	if (typeof(options.menubar) != 'undefined') { args += "menubar=1,"; }
	if (typeof(options.locationbar) != 'undefined') { args += "location=1,"; }
	if (typeof(options.resizable) != 'undefined') { args += "resizable=1,"; }

	var win = window.open(anchor, options.name, args);
	return false;

}

//±×¸°µ¥ÀÏ¸® ciobiz ·£´ý
function Random(){
 var num = Math.round(Math.random()*2+1);
 return num;
}  

 function Random2(){
 var ch = Random();

  if(ch==4){
    document.write("<a href='http://www.boan.com' target='_blank'><img src='http://img.etnews.co.kr/Et_2009/gnb/tab_boan_off.gif' width='80' height='42' border='0'></a>");
  }

  if(ch==3){
    document.write("<a href='http://www.greendaily.co.kr' target='_blank'><img src='http://img.etnews.co.kr/Et/etnews/banner/20090831/tab_greendaily_off.gif' width='80' height='42' border='0'></a>");
  }

  if(ch==2){
   document.write("<a href='http://www.ciobiz.co.kr' target='_blank'><img src='http://img.etnews.co.kr/Et_2009/gnb/tab_cio_off.gif' width='80' height='42' border='0'></a>");
  }
  
  if(ch==1){
   document.write("<a href='http://www.gvalley.co.kr' target='_blank'><img src='http://img.etnews.co.kr/Et/etnews/banner/20090904/tab_gvalley_off.gif' width='80' height='42' border='0'></a>");
  }
 }
