var expDays1 = 5;


var page1 = "http://news.mywebpal.com/partners/929/documents/custom/adimage/popupimage.html";

var popuptop=screen.height-400-100;
var windowprops1 = "width=300,height=400,top="+popuptop+",left=20,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes";



function GetCookie1 (name) {  

var arg = name + "=";  

var alen = arg.length;  

var clen = document.cookie.length;  

var i = 0;  

while (i < clen) {    

var j = i + alen;    

if (document.cookie.substring(i, j) == arg)      

return getCookieVal1 (j);    

i = document.cookie.indexOf(" ", i) + 1;    

if (i == 0) break;   

}  

return null;

}

function SetCookie1 (name, value) {  

var argv = SetCookie1.arguments;  

var argc = SetCookie1.arguments.length;  

var expires = (argc > 2) ? argv[2] : null;  

var path = (argc > 3) ? argv[3] : null;  

var domain = (argc > 4) ? argv[4] : null;  

var secure = (argc > 5) ? argv[5] : false;  

document.cookie = name + "=" + escape (value) + 

((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 

((path == null) ? "" : ("; path=" + path)) +  

((domain == null) ? "" : ("; domain=" + domain)) +    

((secure == true) ? "; secure" : "");

}

function DeleteCookie1 (name) {  

var exp1 = new Date();  

exp1.setTime (exp.getTime() - 1);  

var cval = GetCookie1 (name);  

document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();

}

var exp1 = new Date(); 

exp1.setTime(exp1.getTime() + (expDays1*24*60*60*1000));

function amt(){

var countimage = GetCookie1('countimage')

if(countimage == null) {

SetCookie1('countimage','1')

return 1

}

else {

var newcountimage = parseInt(countimage) + 1;

DeleteCookie1('countimage')

SetCookie1('countimage',newcountimage,exp)

return countimage

   }

}

function getCookieVal1(offset) {

var endstr = document.cookie.indexOf (";", offset);

if (endstr == -1)

endstr = document.cookie.length;

return unescape(document.cookie.substring(offset, endstr));

}



function checkcountimage1() {


/* var countimage = GetCookie1('countimage');

if (countimage == null) {

countimage=1;

SetCookie1('countimage', countimage, exp1);







}

else {

var altercount = countimage % 2;
countimage++;
SetCookie1('countimage', countimage, exp1);

*/

	 
		var wunder=window.open(page1, 'twindow', windowprops1);
		wunder.blur()
		window.focus()
	 

  // }

}

//  End -->
