1
2var embedover_visible;
3
4function embedover_click(e, click, style)
5{
6    // Update style
7    document.getElementById("embedover_div" ).setAttribute("style", style);
8	document.getElementById("embedover_div" ).style.cssText = style;
9    // Update contents
10    if ((click == document.getElementById("embedover_div" ).src) &&
11         (embedover_visible != 'no') )
12    {
13        document.getElementById("embedover_div" ).style.display= 'none';
14        embedover_visible = 'no';
15    }
16    else
17    {
18        document.getElementById("embedover_div" ).src=click; // encodeURIComponent
19        document.getElementById("embedover_div" ).style.display = 'block' ;
20        embedover_visible = 'yes';
21    }
22    // Update position
23    if (!e) var e = window.event;
24	if (e.pageX || e.pageY) 	{ posy = e.pageY; }
25	else if (e.clientX || e.clientY) 	{ 		posy = e.clientY + document.body.scrollTop 	+ document.documentElement.scrollTop; 	}
26    document.getElementById("embedover_div" ).style.top = posy;
27    document.getElementById("embedover_div" ).style.left = document.body.clientWidth - document.getElementById("embedover_div").offsetWidth ;
28}
29
30
31// From  : http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm
32// Use : <iframe id="myframe" src="externalpage.htm" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none"></iframe>
33
34/***********************************************
35* IFrame SSI script II- � Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
36* Visit DynamicDrive.com for hundreds of original DHTML scripts
37* This notice must stay intact for legal use
38***********************************************/
39
40//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
41//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
42var iframeids=["embedover_div"];
43
44//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
45var iframehide="yes";
46
47var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1];
48var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0; //extra height in px to add to iframe in FireFox 1.0+ browsers
49
50function resizeCaller() {
51var dyniframe=new Array();
52for (i=0; i<iframeids.length; i++){
53if (document.getElementById)
54resizeIframe(iframeids[i]);
55//reveal iframe for lower end browsers? (see var above):
56if ((document.all || document.getElementById) && iframehide=="no"){
57var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i]);
58//tempobj.style.display="block";
59}
60}
61}
62
63function resizeIframe(frameid){
64var currentfr=document.getElementById(frameid);
65if (currentfr && !window.opera){
66//currentfr.style.display="block";
67if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
68currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
69else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
70currentfr.height = currentfr.Document.body.scrollHeight;
71if (currentfr.addEventListener)
72currentfr.addEventListener("load", readjustIframe, false);
73else if (currentfr.attachEvent){
74currentfr.detachEvent("onload", readjustIframe);
75currentfr.attachEvent("onload", readjustIframe);
76}
77}
78}
79
80function readjustIframe(loadevt) {
81var crossevt=(window.event)? event : loadevt;
82var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement;
83if (iframeroot)
84resizeIframe(iframeroot.id);
85}
86
87function loadintoIframe(iframeid, url){
88if (document.getElementById)
89document.getElementById(iframeid).src=url;
90}
91
92if (window.addEventListener)
93window.addEventListener("load", resizeCaller, false);
94else if (window.attachEvent)
95window.attachEvent("onload", resizeCaller);
96else
97window.onload=resizeCaller;
98
99