Комбиниране на 2 кода

HR78

Registered
Здравейте - значи имам следната дилема имам 2 кода за попъп които ще изложа по-доло.

1-ят ми върши идеална работа - но изисква от браузера да разрешиш попъповете,

2-ят неизисква разрешение от браузера, но пък неподдържа кукита и зарежда при всеки рефреш.

Въпросът ми е може ли да се комбинират 2-та скрипта така че да не изисква разрешение за допускане на попуп от попуп-блокера и да поддържа кукита???

скрипт 1:
Код:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
 
</head>
<body>
<script type="text/javascript">

//JK Popup Window Script (version 3.0)- By JavaScript Kit (http://www.javascriptkit.com)
//Visit JavaScriptKit.com for free JavaScripts
//This notice must stay intact for legal use
//Win Type: Pop Up | 24 hours period
    
//Specify URLs to randomly select from and popup/popunder:
//To display a single URL, just remove all but the first entry below:
var popurls=new Array()
popurls[0]="http://bgtop.net/in.php/1270894375"

function openpopup(popurl){
var winpops=window.open(popurl,"","width=100,height=100,toolbar,location,directories,status,scrollbars,menubar,resizable")
}

function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if cookie exists
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1)
         end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}

popfrequency="24 hours"

function resetcookie(){
var expireDate = new Date()
expireDate.setHours(expireDate.getHours()-10)
document.cookie = "jkpopunder=;path=/;expires=" + expireDate.toGMTString()
}

function loadornot(){
if (get_cookie('jkpopunder')==''){
openpopup(popurls[Math.floor(Math.random()*(popurls.length))])
var expireDate = new Date()
expireDate.setHours(expireDate.getHours()+parseInt(popfrequency))
document.cookie = "jkpopunder="+parseInt(popfrequency)+";path=/;expires=" + expireDate.toGMTString()
}
}

if (get_cookie('jkpopunder')!=parseInt(popfrequency))
resetcookie()
loadornot()

</script>
</body>
</html>

и скрипт 2:

Код:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
 
</head>
<body>
<script type="text/javascript">

//JK Popup Window Script (version 3.0)- By JavaScript Kit (http://www.javascriptkit.com)
//Visit JavaScriptKit.com for free JavaScripts
//This notice must stay intact for legal use
//Win Type: Pop Up | 24 hours period
    
//Specify URLs to randomly select from and popup/popunder:
//To display a single URL, just remove all but the first entry below:
var popurls=new Array()
popurls[0]="http://bgtop.net/in.php/1270894375"

function openpopup(popurl){
var winpops=window.open(popurl,"","width=100,height=100,toolbar,location,directories,status,scrollbars,menubar,resizable")
}

function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if cookie exists
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1)
         end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}

popfrequency="24 hours"

function resetcookie(){
var expireDate = new Date()
expireDate.setHours(expireDate.getHours()-10)
document.cookie = "jkpopunder=;path=/;expires=" + expireDate.toGMTString()
}

function loadornot(){
if (get_cookie('jkpopunder')==''){
openpopup(popurls[Math.floor(Math.random()*(popurls.length))])
var expireDate = new Date()
expireDate.setHours(expireDate.getHours()+parseInt(popfrequency))
document.cookie = "jkpopunder="+parseInt(popfrequency)+";path=/;expires=" + expireDate.toGMTString()
}
}

if (get_cookie('jkpopunder')!=parseInt(popfrequency))
resetcookie()
loadornot()

</script>
</body>
</html>

П.П: А ще е още по-лесно ако някой може да ми каже как да накарам лентата от този урок http://web-tourist.net/login/login/view.php?st=2296 която в момента ползвам да се отваря в попъп или нов подпрозорец а не както е в момента в същият.
 

Back
Горе