
function apformurlb()
{
//apformurld function for profiles accessed from newfem pages
//apformurlc function for profiles accessed from fp pages
//because of different string length calculations so originating site will = str1 
//and to add 'newfem' at end of string where profiles accessed from newfem pages
 
document.forms.test4.url.value = this.location.href;

if(document.forms.test4.url.value.indexOf("newfem")== -1)
apformurlc()
else apformurld()

}




function apformurlc()
{
//This function called where 'showprofile.php' is in the address bar
//'document.location' is not recognised when js called from 'showprofile.php'
//'this.location.href' is recognised when called from 'showprofile.php'
//'this.location.href' is a different way of referring to the document.location  

document.forms.test4.url.value = document.referrer;

//Following ensures one of the 3 sites is quoted in str1 - e.g if fp
//page is accessed from a search engine 'ifm-intros.co.uk' = the default site   
if((document.forms.test4.url.value.indexOf("marriage-agency.co.uk")== -1)&&
   (document.forms.test4.url.value.indexOf("ifm-intros.co.uk")== -1)&&
   (document.forms.test4.url.value.indexOf("russian-girls.co.uk")== -1))
document.forms.test4.url.value = "http://www.ifm-intros.net/members/searchmatch.php?page=1&txtgender=M&txtlookgender=F&txtlookagestart=18&txtlookageend=80&with_photo=?http://www.ifm-intros.co.uk";

var str = document.forms.test4.url.value;

var str1 = str.substr(133,100); 


if((document.forms.test4.url.value.indexOf("marriage-agency.co.uk")!== -1)||
   (document.forms.test4.url.value.indexOf("russian-girls.co.uk")!== -1))
this.location.href = "http://www.ifm-intros.net/members/signup.php?" + str1;
else this.location.href = str1 + "/apform.htm";
}

function apformurld()
{

document.forms.test4.url.value = this.location.href;

if(document.forms.test4.url.value.indexOf("ifm-intros.co.uk")!== -1)
apformurld2();
else apformurld1();
}


function apformurld1()
{
//This function called where 'showprofile.php' is in the address bar
//'document.location' is not recognised when js called from 'showprofile.php'
//'this.location.href' is recognised when called from 'showprofile.php'
//'this.location.href' is a different way of referring to the document.location  

document.forms.test4.url.value = this.location.href;


//Following ensures one of the 3 sites is quoted in str1 - e.g if fp
//page is accessed from a search engine 'ifm-intros.co.uk' = the default site   


if((document.forms.test4.url.value.indexOf("marriage-agency.co.uk")== -1)&&
   (document.forms.test4.url.value.indexOf("ifm-intros.co.uk")== -1)&&
   (document.forms.test4.url.value.indexOf("russian-girls.co.uk")== -1))
document.forms.test4.url.value = "http://www.ifm-intros.net/members/showprofile.php?id=nnnn?newfem9.htm?http://www.ifm-intros.co.uk";

var str = document.forms.test4.url.value;

var str1 = str.substr(70,100); 


if((document.forms.test4.url.value.indexOf("marriage-agency.co.uk")!== -1)||
   (document.forms.test4.url.value.indexOf("russian-girls.co.uk")!== -1))
this.location.href = "http://www.ifm-intros.net/members/signup.php?" + str1 + "?new";
else this.location.href = str1 + "/apform.htm?new";

}


function apformurld2()
{

document.forms.test4.url.value = this.location.href;

var str = document.forms.test4.url.value;

var str1 = str.substr(107,100); 

if(str1.length > 5)
this.location.href =  "http://www.ifm-intros.co.uk/" + str1 + "/apform.htm?new";
else this.location.href = "http://www.ifm-intros.co.uk/apform.htm?new";
}


function apformurl()
{
//Called where 'searchmatch.php' is in the address bar

document.forms.test4.url.value = document.location;

//Following ensures one of the 3 sites is quoted in str1 - e.g if fp
//page is accessed from a search engine 'ifm-intros.co.uk' = the default site   
if((document.forms.test4.url.value.indexOf("marriage-agency.co.uk")== -1)&&
   (document.forms.test4.url.value.indexOf("ifm-intros.co.uk")== -1)&&
   (document.forms.test4.url.value.indexOf("russian-girls.co.uk")== -1))
document.forms.test4.url.value = "http://www.ifm-intros.net/members/searchmatch.php?page=1&txtgender=M&txtlookgender=F&txtlookagestart=18&txtlookageend=80&with_photo=?http://www.ifm-intros.co.uk";

var str = document.forms.test4.url.value;

var str1 = str.substr(133,100); 


if((document.forms.test4.url.value.indexOf("marriage-agency.co.uk")!== -1)||
   (document.forms.test4.url.value.indexOf("russian-girls.co.uk")!== -1))
parent.document.location = "http://www.ifm-intros.net/members/signup.php?" + str1;
else parent.document.location = str1 + "/apform.htm";

}

function homeurl()
{

document.forms.test4.url.value = document.location;

//Following ensures one of the 3 sites is quoted in str1 - e.g if fp
//page is accessed from a search engine 'ifm-intros.co.uk' = the default site   
if((document.forms.test4.url.value.indexOf("marriage-agency.co.uk")== -1)&&
   (document.forms.test4.url.value.indexOf("ifm-intros.co.uk")== -1)&&
   (document.forms.test4.url.value.indexOf("russian-girls.co.uk")== -1)&&
   (document.forms.test4.url.value.indexOf("http://www.ifm-intros.net/members/admin/")== -1))
document.forms.test4.url.value = "http://www.ifm-intros.net/members/searchmatch.php?page=1&txtgender=M&txtlookgender=F&txtlookagestart=18&txtlookageend=80&with_photo=?http://www.ifm-intros.co.uk";

var str = document.forms.test4.url.value;

var str1 = str.substr(133,100); 

parent.document.location = str1;

}
