/*
 * Ext JS Library 2.0
 * Copyright(c) 2006-2007, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */

Ext.onReady(function(){
    var win;
    var button = Ext.get('agreement-popup');

var panel = new Ext.TabPanel({
                    el: 'agreement-tabs',
                    id: 'agreement-tabs',
                    autoTabs:true,
                    bodyStyle: 'padding: 10px 10px 10px 10px',
                    activeTab:0,
                    deferredRender:false,
                    border:false
                })

    button.on('click', function(){
        // create the window on the first click and reuse on subsequent clicks
        if(!win){
            win = new Ext.Window({
                el:'agreement-win',
                layout:'fit',
                width:1010,
                height:650,
                closeAction:'hide',
                plain: true,
                
                items: panel,
                buttons: [{
                    text: 'French Translation',
                    handler: translateAgreement
					},{
                    text: 'Close',
                    handler: function(){
                        win.hide();
                    }
                }]
            });
        }
        win.show(this);
    });
    
function translateAgreement(){
 var tab = panel.activeTab.title;
if(tab == "1. Acceptance of Terms" ){
if(navigator.appName == "Microsoft Internet Explorer"){

window.open("http://uk.babelfish.yahoo.com/translate_url?doit=done&fr=bf-badge&trurl=http://www.mufts.com/acceptanceTerms.html&lp=en_fr", null, "height=600,width=800,status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=yes");

}else {
window.open("http://uk.babelfish.yahoo.com/translate_url?doit=done&fr=bf-badge&trurl=acceptanceTerms.html&lp=en_fr", null, "height=600,width=800,status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=yes");
}
}
if(tab == "2. The Service" ){
if(navigator.appName == "Microsoft Internet Explorer"){
		window.open("http://uk.babelfish.yahoo.com/translate_url?doit=done&fr=bf-badge&trurl=http://www.mufts.com/service.html&lp=en_fr", null, "height=600,width=800,status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=yes");
}else {
window.open("http://uk.babelfish.yahoo.com/translate_url?doit=done&fr=bf-badge&trurl=service.html&lp=en_fr", null, "height=600,width=800,status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=yes");
}

}
if(tab == "3. Member Responsibilities" ){
if(navigator.appName == "Microsoft Internet Explorer"){
		window.open("http://uk.babelfish.yahoo.com/translate_url?doit=done&fr=bf-badge&trurl=http://www.mufts.com/memberResponsabilities.html&lp=en_fr", null, "height=600,width=800,status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=yes");
}else {
window.open("http://uk.babelfish.yahoo.com/translate_url?doit=done&fr=bf-badge&trurl=memberResponsabilities.html&lp=en_fr", null, "height=600,width=800,status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=yes");
}
}
if(tab == "4. Buyers and Suppliers Transactions" ){
if(navigator.appName == "Microsoft Internet Explorer"){
		window.open("http://uk.babelfish.yahoo.com/translate_url?doit=done&fr=bf-badge&trurl=http://www.mufts.com/transactionRules.html&lp=en_fr", null, "height=600,width=800,status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=yes");
}else {
window.open("http://uk.babelfish.yahoo.com/translate_url?doit=done&fr=bf-badge&trurl=transactionRules.html&lp=en_fr", null, "height=600,width=800,status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=yes");
}
}
if(tab == "5. Limitation of Liability" ){
if(navigator.appName == "Microsoft Internet Explorer"){
		window.open("http://uk.babelfish.yahoo.com/translate_url?doit=done&fr=bf-badge&trurl=http://www.mufts.com/liability.html&lp=en_fr", null, "height=600,width=800,status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=yes");
}else {
window.open("http://uk.babelfish.yahoo.com/translate_url?doit=done&fr=bf-badge&trurl=liability.html&lp=en_fr", null, "height=600,width=800,status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=yes");
}
}
if(tab == "6. Intellectual Property Rights" ){
if(navigator.appName == "Microsoft Internet Explorer"){
	window.open("http://uk.babelfish.yahoo.com/translate_url?doit=done&fr=bf-badge&trurl=http://www.mufts.com/intellectualPropertyRights.html&lp=en_fr", null, "height=600,width=800,status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=yes");
}else {
window.open("http://uk.babelfish.yahoo.com/translate_url?doit=done&fr=bf-badge&trurl=intellectualPropertyRights.html&lp=en_fr", null, "height=600,width=800,status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=yes");
}
}
if(tab == "7. General" ){
if(navigator.appName == "Microsoft Internet Explorer"){
	window.open("http://uk.babelfish.yahoo.com/translate_url?doit=done&fr=bf-badge&trurl=http://www.mufts.com/general.html&lp=en_fr", null, "height=600,width=800,status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=yes");
}else {
window.open("http://uk.babelfish.yahoo.com/translate_url?doit=done&fr=bf-badge&trurl=general.html&lp=en_fr", null, "height=600,width=800,status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=yes");
}
}

}
});


