﻿var urlgolist="";
var urlgoview="";
var urlgodel="";
var urlgomodify="";
var urlgowrite="";
var urlgoreply="";
var title_js_var=""; //원문복사 타이틀
var idx="";

function GoList()
{
  if(urlgolist!="")
    document.location.href=urlgolist;
}

function GoView()
{
  if(urlgoview!="")
    document.location.href=urlgoview;
}

function GoDel()
{
  if(urlgodel!="")
  {
    if(confirm("정말 삭제 하시겠습니까?\n\n(답변까지 모두 삭제됩니다.)"))
      document.location.href=urlgodel;
  }
}

function GoModify()
{
  if(urlgomodify!="")
    document.location.href=urlgomodify;
}

function GoReply()
{
  if(urlgoreply!="")
    document.location.href=urlgoreply;
}

function GoScrap()
{
  if(idx != "")
    document.location.href = "http://ts.studymania.com/tss/common/scrap.aspx?idx="+idx+"&loc=talk_board";
}

function GoWrite()
{
  if(urlgowrite!="")
    document.location.href=urlgowrite;
}

function showButton(id, click)
{
  var obj = document.getElementById("btnPannel");
  var objTail = document.getElementById("btnPannelTail");
    
  if(obj && typeof(obj) !="undefined")  
    obj.innerHTML += "&nbsp;<img src=\"http://file.studymania.com/renewal/board/images/btn_" + id + ".gif\" class=\"btnImage\" onClick=\"" + click+ "\">";
  if(objTail && typeof(objTail)!="undefined")  
    objTail.innerHTML += "&nbsp;<img src=\"http://file.studymania.com/renewal/board/images/btn_" + id + ".gif\" class=\"btnImage\" onClick=\"" + click+ "\">";
  
}

function viewFlash(flashname, width, height) {
  	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+width+"' height='"+height+"'>");
  	document.write("<param name='movie' value='"+flashname+"'>");
  	document.write("<param name='quality' value='high'>");
  	document.write("<param name='wmode' value='transparent'>");
  	document.write("<param name='bgcolor' value='#ffffff'>");
  	document.write("<param name='SCALE' value='#noborder'>");
  	document.write("<embed src='"+flashname+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"'></embed></object>");
}

function validate_chk(obj, msg) {
	if (obj.value.split(" ").join("") == "") {
		alert(msg);
		obj.focus();
		return false;
	} else {
		return true;
	}
}

function contents_cp()
{
	if (window.event)
	{
		window.event.returnValue = true;
		window.setTimeout('attach_kinref()', 25);
	}
}

function attach_kinref()
{
	if (window.clipboardData) // IE
	{
		// get data from clipboard
		var txt = window.clipboardData.getData('Text');

		// attach the source at the end of text
		txt = txt + '\r\n(원문제목 : \''+title_js_var+'\' - 출처 : 스터디매니아 http://www.studymania.com )\r\n';

		// set data to clibboard
		var result = window.clipboardData.setData('Text', txt);
	}
}

String.prototype.Trim = function(str) {
  	str = this != window?this:str;
  	return str.replace(/^\s+/g,'').replace(/\s+$/g,'');
}


function validate_chk(obj, msg) {
	if (obj.value.split(" ").join("") == "") {
		alert(msg);
		obj.focus();
		return false;
	} else {
		return true;
	}
}



function IsNull(obj,msg)
{
  
	if (obj.split(" ").join("") == "") 
	{
		alert(msg);
		return false;
	}
	
	return true;
}


