Javascript question

ok first of all, thanks for spending 2minutes time reading this/helping me ...
ok, im not looking for someone who can help me with 2javascriptthings ...
first thing: the script has to check the url on top for example: www.conquerclub.com if the url is correct, it has to redirect to http://www.conquerclub.com/player.php?mode=mygames1
second thing: the script has to search for text on the page for example: Waiting for your next turn... if the text is found, it has to redirect to http://www.conquerclub.com/player.php?m ... es1&next=Y
I know its simple, but I cant seem to find this to work ... I tried:
if (url == "www.conquerclub.com") {
window.location.href = "http://www.conquerclub.com/player.php?mode=mygames1"
}
if (text == "Waiting for your next turn..." {
window.location.href = "http://www.conquerclub.com/player.php?mode=mygames1&next=Y"
}
if (text == "You played last the previous round, so you must wait until either an opponent begins their turn or half of the round passes." {
window.location.href = "http://www.conquerclub.com/player.php?mode=mygames1&next=Y"
}
but it doesnt work ...
can someone edit this to the right please? thanks in advance
ok, im not looking for someone who can help me with 2javascriptthings ...
first thing: the script has to check the url on top for example: www.conquerclub.com if the url is correct, it has to redirect to http://www.conquerclub.com/player.php?mode=mygames1
second thing: the script has to search for text on the page for example: Waiting for your next turn... if the text is found, it has to redirect to http://www.conquerclub.com/player.php?m ... es1&next=Y
I know its simple, but I cant seem to find this to work ... I tried:
if (url == "www.conquerclub.com") {
window.location.href = "http://www.conquerclub.com/player.php?mode=mygames1"
}
if (text == "Waiting for your next turn..." {
window.location.href = "http://www.conquerclub.com/player.php?mode=mygames1&next=Y"
}
if (text == "You played last the previous round, so you must wait until either an opponent begins their turn or half of the round passes." {
window.location.href = "http://www.conquerclub.com/player.php?mode=mygames1&next=Y"
}
but it doesnt work ...
can someone edit this to the right please? thanks in advance