새창 팝업창 소스

2015. 3. 24. 16:44IT/HTML

=======================================================main 시작

 

<!--팝업창 소스 start -->

 

<script language="javascript">

function setCookie( name, value, expiredays ){ 

 var todayDate = new Date();

 todayDate.setDate( todayDate.getDate() + expiredays );

 document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"

function getCookie( name ){ 

 var nameOfCookie = name + "=";

 var x = 0; 

 while ( x <= document.cookie.length ) { 

  var y = (x+nameOfCookie.length);

  if ( document.cookie.substring( x, y ) == nameOfCookie ) {

   if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) endOfCookie = document.cookie.length; 

   return unescape( document.cookie.substring( y, endOfCookie ) );

  } 

  x = document.cookie.indexOf( " ", x ) + 1;

  if ( x == 0 ) break; 

 } 

 return "";

}

 

 

//겨울철안전사고 새창띄우기 시작

 

if ( getCookie( "popup03" ) != "done" ){ 

 noticeWindow = window.open('./popup.php','window1','width=472,height=696,top=100,left=500,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');

 noticeWindow.opener = self; 

}

 

 

 

//네번째 새창띄우기 시작

/*if ( getCookie( "popup05" ) != "done" ){ 

 noticeWindow = window.open('./popup/popup_05.php','window5','width=620,height=330,top=100,left=350,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');

 noticeWindow.opener = self; 

}

*/

 

</script>

 

<!--팝업창 소스 end -->

 

=======================================================main 끝

 

 

 

 

 

=======================================================팝업창(새창) 소스 시작

 

<html>

 

<head>

<meta http-equiv="content-type" content="text/html; charset=euc-kr">

<titleSite Name</title>

<meta http-equiv="imagetoolbar" content="no"> 

 

<script language="JavaScript"> 

<!-- 

function setCookie( name, value, expiredays ) 

    { 

        var todayDate = new Date(); 

        todayDate.setDate( todayDate.getDate() + expiredays ); 

        document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 

        } 

function closeWin() 

        if ( document.forms[0].popup03.checked ) 

 

 

                setCookie( "popup03", "done" , 1); 

 

        self.close(); 

 

// --> 

</script>

</head>

 

<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">

 

<table width="100%" border="0" cellspacing="0" cellpadding="0">

  <tr>

    <td><img src="/img/sinsin.jpg" border="0" ></td>

  </tr>

  <tr>

    <td height="30" bgcolor="#1E3A01">

<form name="cnjform">

<table width="100%" height="31" border="0" cellpadding="0" cellspacing="0">

      <tr>

        <td align="left" style="padding-left:15px; font-size:10pt; color:#ffffff;background-color:#000; "><input type="checkbox" name="popup03" onclick="closeWin()">오늘 하루 이 창을 띄우지 않습니다.</td>

      </tr>

    </table>  </form></td>

  </tr>

</table>

 

</body>

 

</html>

 

=======================================================팝업 창 소스 끝