<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes() ?>>
<head profile="http://gmpg.org/xfn/11">
<base href="<?bloginfo('wpurl')?>" />
	<title><?php wp_title( '-', true, 'right' ); echo wp_specialchars( get_bloginfo('name'), 1 ) ?></title>
	<meta http-equiv="content-type" content="<?php bloginfo('html_type') ?>; charset=<?php bloginfo('charset') ?>" />
	<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url') ?>" />
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url') ?>/css/confirm.css" />
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url') ?>/css/screen.css" />
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url') ?>/css/dd.css" />
    <link rel="icon" type="image/png" href="<?php bloginfo('template_url') ?>/img/favicon.png" />
        
    <script type="text/javascript" src="<? bloginfo('template_url') ?>/js/jquery.js"></script>
    <script type="text/javascript" src="<? bloginfo('template_url') ?>/js/jquery.validate.js"></script>
    <script type='text/javascript' src="<?php bloginfo('template_url') ?>/js/jquery.simplemodal.js"></script>
    <script type='text/javascript' src="<?php bloginfo('template_url') ?>/js/jquery.dd.js"></script>
    
<?php wp_head() // For plugins ?>
	<link rel="alternate" type="application/rss+xml" href="<?php bloginfo('rss2_url') ?>" title="<?php printf( __( '%s latest posts', 'sandbox' ), wp_specialchars( get_bloginfo('name'), 1 ) ) ?>" />
	<link rel="alternate" type="application/rss+xml" href="<?php bloginfo('comments_rss2_url') ?>" title="<?php printf( __( '%s latest comments', 'sandbox' ), wp_specialchars( get_bloginfo('name'), 1 ) ) ?>" />
	<link rel="pingback" href="<?php bloginfo('pingback_url') ?>" />
    

<!--[if gte IE 8]>
	<style type="text/css">
	.footer_contacts { margin-top:30px;}
	.content h1 { margin-top:35px;}
	</style>
<![endif]--> 


</head>

<body>
<div class="wrapper">

<!--Header
==========================================-->

	<div class="header">
		<h1 class="logo"><a href="index.php">Elliot Katsnelson</a></h1>

		<div class="lenguages" style="min-width:250px;">
        <?
            if(qtrans_getLanguage()=='en') { $lang_text = 'Select your language: '; $accept = ' I accept'; $no_accept = ' I do not accept'; }
            elseif(qtrans_getLanguage()=='ru') { $lang_text = 'Выберите язык: '; $accept = ' Я согласен'; $no_accept = ' Я не согласен '; }
            elseif(qtrans_getLanguage()=='es') { $lang_text = 'Seleccione su idioma: '; $accept = ' Acepto'; $no_accept = ' No Acepto'; }
        ?>
            <p style="text-align: right;"><span style=" margin:2px 10px 0 0; display: inline-block;"><?=$lang_text?></span>
            
                <select name="websites2" id="websites2" style="width:98px; float:right; margin-right:20px;" tabindex="1">
        <?
            if(qtrans_getLanguage()=='en') { $selected = "selected=''"; }
            elseif(qtrans_getLanguage()=='ru') { $selected2 = "selected=''"; }
            elseif(qtrans_getLanguage()=='es') {$selected3 = "selected=''"; }
        ?>                
                  <option value="http://<?=$_SERVER['HTTP_HOST']?>" <?=$selected?> title="<?bloginfo('template_url')?>/img/gb.png">English</option>
                  <option value="http://<?=$_SERVER['HTTP_HOST']?>/ru" <?=$selected2?> title="<?bloginfo('template_url')?>/img/ru.png">Русский</option>
                  <option value="http://<?=$_SERVER['HTTP_HOST']?>/es/" <?=$selected3?> title="<?bloginfo('template_url')?>/img/es.png">Español</option>
                </select></p>
		</div><!--/lenguages-->

	</div><!--/header-->

<!--Nav
==========================================-->
	<div class="nav" id='confirm-dialog'> 
		<ul>                
        <?
           if(basename(get_permalink()) == $_SERVER['HTTP_HOST'] || basename(get_permalink()) == 'ru' || basename(get_permalink()) == 'es'){ $current = 'current'; } 
           elseif(basename(get_permalink()) == 'ask-your-question'){$current2 = 'current'; }
           elseif(basename(get_permalink()) == 'areas-of-practice'){$current3 = 'current'; }
           elseif(basename(get_permalink()) == 'our-location'){$current4 = 'current'; }     
        ?>
        <?
            if(qtrans_getLanguage()=='ru') { $url = 'ru/'; }
            elseif(qtrans_getLanguage()=='es') { $url = 'es/'; }
        ?>
			<li><a class="<?=$current?>" href="<?=$url?>"><?=get_the_title(2)?></a><img src="<?bloginfo('template_url')?>/img/nav_line.png" alt="" /></li>
			<li><a class="<?=$current2?> confirm" href="<?=$url?>ask-your-question/" class='confirm'><?=get_the_title(15)?></a><img src="<?bloginfo('template_url')?>/img/nav_line.png" alt="" /></li>
			<li><a class="<?=$current3?>" href="<?=$url?>areas-of-practice/"><?=get_the_title(32)?></a><img src="<?bloginfo('template_url')?>/img/nav_line.png" alt="" /></li>
			<li><a class="<?=$current4?>" href="<?=$url?>our-location/"><?=get_the_title(41)?></a></li>
        </ul>
	</div><!--/nav-->

<!--Center
==========================================-->
	<div class="center"> 
		<span><?php
                 $post_id = 120;
                 $queried_post = get_post($post_id);
                 $title = qtrans_useCurrentLanguageIfNotFoundShowAvailable($queried_post->post_title);
                 echo $title;
                 $content = qtrans_useCurrentLanguageIfNotFoundShowAvailable($queried_post->post_content);
            ?></span>
		<p><?=$content?></p>
	</div><!--/center-->
    <div class="center_bottom">&nbsp;</div>

    <!-- modal content -->
	<div id='confirm'>
	
		<div class="disclaimer_header">
            <?php
                 $post_id = 141;
                 $queried_post = get_post($post_id);
                 $title = qtrans_useCurrentLanguageIfNotFoundShowAvailable($queried_post->post_title);
                 $content = qtrans_useCurrentLanguageIfNotFoundShowAvailable($queried_post->post_content);
            ?>
			<h1><?=$title?></h1>
			
			<div class="accept_content">
                <?=$content?>
			</div><!--/accept_content-->
		</div><!--/disclaimer_header-->
        <div class='buttons'>
			<div class='no simplemodal-close for_both'><img src="<?bloginfo('template_url')?>/img/no.png" alt="no" /><?=$no_accept?></div>
			<div class='yes for_both'><img src="<?bloginfo('template_url')?>/img/yes.png" alt="no" /><?=$accept?></div>
		</div>
	</div>
    
<script>
jQuery(function ($) {
	$('#confirm-dialog input.confirm, #confirm-dialog a.confirm').click(function (e) {
		e.preventDefault();

		// example of calling the confirm function
		// you must use a callback function to perform the "yes" action
		confirm("Continue to the SimpleModal Project page?", function () {
			window.location.href = '<?='http://' . $_SERVER['HTTP_HOST'] . "/$url/ask-your-question/"?>';
		});
	});
});

function confirm(message, callback) {
	$('#confirm').modal({
		closeHTML: "",
		position: ["5%"],
		overlayId: 'confirm-overlay',
		containerId: 'confirm-container', 
		onShow: function (dialog) {
			var modal = this;

			$('.message', dialog.data[0]).append(message);

			// if the user clicks "yes"
			$('.yes', dialog.data[0]).click(function () {
				// call the callback
				if ($.isFunction(callback)) {
					callback.apply();
				}
				// close the dialog
				modal.close(); // or $.modal.close();
			});
		}
	});
}
</script>    
<script type="text/javascript">
$(document).ready(function() {

try {
		oHandler = $("#websites2").msDropDown({mainCSS:'dd2'}).data("dd");
		//alert($.msDropDown.version);
		//$.msDropDown.create("body select");
		$("#ver").html($.msDropDown.version);
        $("#websites2").change(function(){
            window.location = $("#websites2").val();
        })
		} catch(e) {
			alert("Error: "+e.message);
		}
})

</script>
