﻿
//Javascrip document
// Code to Desafio Design provided by j.carvalho

//this function redirect all the pages for an iframe located on parent page 'index.asp'
function redirectToParent(id){
if(window.top.location.href==self.location.href) {
var urlname=window.location.pathname.substring(1)
var redirectUrl='index.asp' + '?url=' + urlname;

if (id!=""){
redirectUrl=redirectUrl+ '?id=' + id;
top.location.href='index.asp?url=' + urlname + '?id=' + id;
}
if (urlname!='index.asp'){
window.top.location.href=redirectUrl;
}
}
}
