
/*This is how to break out of a forreign website's frame with JavaScript*/
/*Does the browser support DOM?*/
ie = (document.all) ? true:false; // IE4+
dom = ((document.getElementById) && (!ie)) ? true:false; // Mozilla
/*Calls the help function to set an event*/
setEventByObject(window,"load", breakingOutOfFrames);
/*Help function*/
function setEventByObject(ob, ev, fu) {
if(dom) {
ob.addEventListener(ev, fu, false);
}
if(ie) {
ob.attachEvent('on' + ev, fu);
}
}
/*Breaks out of frames*/
function breakingOutOfFrames() {
if (top.location != location) {
top.location.href = document.location.href;
}
}