function open_error_win(error_msg) { var my_win = window.open("","error_win","width=500px,height=200px,resizable=no,scrollbars=no"); my_win.moveTo(screen.width/2-250,screen.height/2-100); my_win.document.open(); my_win.document.write("Warning"); my_win.document.write(""); my_win.document.write(""); my_win.document.write(""); my_win.document.write("
"); my_win.document.write("
Warning :
"); my_win.document.write(error_msg); my_win.document.write("
"); my_win.document.write("
"); my_win.document.write("
"); my_win.document.write(""); my_win.document.close(); my_win.focus(); } function clipp(obgname) { value = document.getElementById(obgname).style.clip; var res = value.match(/rect\((\d+)px[,]?[ ]+(\d+)px[,]?[ ]+(\d+)px[,]?[ ]+(\d+)px\)/i); if (!res) return [0,100,100,0]; return [parseInt(res[1]), parseInt(res[2]), parseInt(res[3]), parseInt(res[4])]; } var timerId=Array(); function toggle_floating(obgname,state,timer,max_width,max_height,init_width,init_height,close_scroll_left,open_scroll_left,cliptop,clipright,clipbottom,clipleft,clipstep) { ifr = document.getElementById(obgname+"_iframe"); clipar = clipp(obgname); cur_cliptop = clipar[0]; cur_clipleft = clipar[3]; cur_clipbottom = clipar[2]; cur_clipright = clipar[1]; if(state==1) { if(cur_cliptop > 0) { cur_cliptop=cur_cliptop-clipstep; if(cur_cliptop < 0) cur_cliptop=0; } if(cur_clipleft > 0) { cur_clipleft=cur_clipleft-clipstep; if(cur_clipleft < 0) cur_clipleft=0; } if(cur_clipbottom < max_height) { cur_clipbottom=cur_clipbottom+clipstep; if(cur_clipbottom > max_height) cur_clipbottom=max_height; } if(cur_clipright < max_width) { cur_clipright=cur_clipright+clipstep; if(cur_clipright > max_width) cur_clipright=max_width; } } else { if(cur_cliptop < cliptop) { cur_cliptop=cur_cliptop+clipstep; if(cur_cliptop > cliptop) cur_cliptop=cliptop; } if(cur_clipleft < clipleft) { cur_clipleft=cur_clipleft+clipstep; if(cur_clipleft > clipleft) cur_clipleft=clipleft; } if(cur_clipbottom > clipbottom) { cur_clipbottom=cur_clipbottom-clipstep; if(cur_clipbottom < clipbottom) cur_clipbottom=clipbottom; } if(cur_clipright > clipright) { cur_clipright=cur_clipright-clipstep; if(cur_clipright < clipright) cur_clipright=clipright; } } document.getElementById(obgname).style.clip = "rect("+cur_cliptop+"px,"+cur_clipright+"px,"+cur_clipbottom+"px,"+cur_clipleft+"px)"; if(state==1) { if(cur_cliptop==0 && cur_clipleft==0 && cur_clipbottom==max_height && cur_clipright==max_width) { return; } } else { if(cur_cliptop==cliptop && cur_clipleft==clipleft && cur_clipbottom==clipbottom && cur_clipright==clipright) { ifr.width = init_width; ifr.height = init_height; ifr.contentWindow.document.getElementById("iframe_div").style.left = close_scroll_left+"px"; return } } timerId[obgname] = setTimeout('toggle_floating(\"'+obgname+'\",'+state+','+timer+','+max_width+','+max_height+','+init_width+','+init_height+','+close_scroll_left+','+open_scroll_left+','+cliptop+','+clipright+','+clipbottom+','+clipleft+','+clipstep+')',timer); } function toggle_floating_banner(obgname,state,timer,max_width,max_height,init_width,init_height,close_scroll_left,open_scroll_left,cliptop,clipright,clipbottom,clipleft,clipstep) { ifr = document.getElementById(obgname+"_iframe"); if(state==1) { ifr.width = max_width; ifr.height = max_height; ifr.contentWindow.document.getElementById("iframe_div").style.left = open_scroll_left+"px"; } try { clearTimeout(timerId[obgname]); } catch(e) {} timerId[obgname] = setTimeout('toggle_floating(\"'+obgname+'\",'+state+','+timer+','+max_width+','+max_height+','+init_width+','+init_height+','+close_scroll_left+','+open_scroll_left+','+cliptop+','+clipright+','+clipbottom+','+clipleft+','+clipstep+')',timer); }