container = $('#drop-panel-container'),
contents = $(container).html();
if (isIE8) {
$(container).replaceWith(f+contents+b)
}
}
function dropPanelSetUp(data) {
/* buttons should be a dataobject of strings representing IDs
the hide and show functions are expecting IDs so passing a class will result in a
failure.
click as the action is assumed for now
the data object should look like this:
{ masterlistener:(string[dom id]),
panel:(string[dom id]),
eventgroup1:{ button:(string[dom id]),
content:(string[dom id]),
offset:{x:(int),y:(int)},
on_state_class: ''(string)
},
eventgroup2:{ button:(string[dom id]),
content:(string[dom id]),
offset:{x:(int),y:(int)},
on_state_class: ''(string)
} ... etc
}
The drop panel nodes should be placed so they share the same offset parent as the buttons that activate it.
NOTE: IE8 Got-chya: the ID for the panel is hard coded into the IE8 rouned corners code.
If you have changed the ID for the drop panel and are having trouble with IE8
change the ID in the template string in this function: ie8DropPanel()
*/
var speed = 300,
panel = $('#'+data.panel),
buttons = [];
for (var i=1,eg; eg=data[('eventgroup'+i)]; i++) {
var bp = $('#'+eg.button).position(), //button position
ph = $('#'+eg.button).height(), //button height
panelPos = [bp.top+ph, bp.left, eg.offset];
on_state_class = eg.on_state_class;
buttons.push([$('#'+eg.button),$('#'+eg.content),panelPos,eg.button,on_state_class]);
}
$('#'+data.masterlistener).bind('click',{speed:speed,panel:panel,buttons:buttons},function(event){
var org = event.target,
speed = event.data.speed,
panel = event.data.panel,
buttons = event.data.buttons,
panel_open = isPanelOpen(panel);
for (var i=buttons.length-1, b; b=buttons[i]; i--) {
/*
* b[0] = button DOM object
* b[1] = content DOM object
* b[2] = the display co-ord object:
* [0] = top (int)
* [1] = left (int)
* [2] = offset object
* {x,y}(int,int)
* b[3] = button ID (string)
* b[4] = button 'on' class
*/
var button_id = b[3],
same_content = isSameContent(panel,b[1]);
if ( $(org).attr('id') === button_id || $(org).parents('#'+button_id).attr('id')){
if(!same_content) {
hideAllContent(buttons);
movePanel(panel,b[2]);
if (panel_open) {
showContent(b[1],b[0],b[4]);
} else {
showContent(b[1],b[0],b[4]);
showPanel(panel,speed);
}
} else {
hidePanel(panel,speed,b[4]);
}
}
}
function isPanelOpen(panel) {
return ($(panel).css('display').toLowerCase() === 'block');
}
function isSameContent (panel,content) {
return ($(content, panel).css('display').toLowerCase() === 'block');
}
function movePanel(panel,b) {
// b[0] top, b[1] left, b[2] {x,y}
$(panel).css({
'top': (b[0] + b[2].x)
});
$(panel).css({
'left': (b[1] + b[2].y)
});
}
function showPanel(panel,speed) {
$(panel).slideDown(speed);
}
function hidePanel(panel,speed) {
$(panel).slideUp(speed, function() {hideAllContent(buttons);});
}
function showContent(content, button, btn_class) {
$(content).show();
$(button).addClass(btn_class);
}
function hideContent(content) {
$(content).hide();
}
function hideAllContent(buttons) {
for (var i = buttons.length-1, b; b=buttons[i]; i--) {
$(b[1]).hide();
$(b[0]).removeClass(b[4]);
}
}
})
}
return {
ieRoundedCorners:ieRoundedCorners,
ie8DropPanel:ie8DropPanel,
dropPanelSetUp:dropPanelSetUp
}
})();
var headerNavication = (function($,cw) {
var nav_item_list = $('.cw-header .main-nav ul.main > li'),
channel_id_list = '',
channel,
sub_channel;
var findChannel = function () {
var winloc = isIE ? document.URL.split('/') : document.documentURI.split('/') ,
channel_id = winloc[3],
sub_chanel_id = winloc.length > 5 ? '/'+winloc[4]+'/' : '',
reg_sub_find_id = new RegExp(sub_chanel_id,'ig'),
reg_removed_id = /^nav-/i;
for (var i=nav_item_list.length-1,n; n=nav_item_list[i]; i--) {
if ( channel_id === $(n).children('a').attr('id').replace(reg_removed_id,'') ) {
var list = $(n).children('ul').children('li');
if (sub_chanel_id.length > 0) {
for (var j=list.length-1,l; l=list[j]; j--) {
if (reg_sub_find_id.test($(l).children('a').attr('href'))) {
break;
} else {
l = false;
}
}
}
break;
}
}
findChannel = function () {
return [n,l];
}
return [n,l];
}
var init = (function() {
channel = findChannel()[0] || nav_item_list[0];
sub_channel = findChannel()[1];
if (sub_channel) {
highlightSubChannel();
}
clearNav();
if(isIE) {
cw.ieRoundedCorners();
if(isIE8) {
cw.ie8DropPanel();
}
}
if ($('#handle-header').attr('id')) {
cw.dropPanelSetUp({
masterlistener: 'handle-header',
panel: ('drop-panel-container'),
eventgroup1: {
button: 'btn-newspapers',
content: 'panel-newspapers',
offset: {
x: 5,
y: 0
},
on_state_class: 'newspapers-dropdown-on'
},
eventgroup2: {
button: 'btn-networks',
content: 'panel-networks',
offset: {
x: 5,
y: 0
},
on_state_class: 'networks-dropdown-on'
}
});
}
//need to check state of search radio buttons since firefox doesn't reset to the default checked radio button
if($('.cw-header #radio-btn-yp:checked').attr('id') != null){
$('.cw-header #header-search-form').attr('action','http://canadacom.yellowpages.ca/search/');
$('.cw-header #header-search-string').attr('name','what');
$('.cw-header #radio-btn-yp').siblings('label').removeClass('selected');
$('.cw-header #radio-btn-yp').next().addClass('selected');
}
eventSetUp();
}())
function highlightSubChannel() {
$(sub_channel).addClass('sub-nav-highlight');
}
function clearNav() {
clearTabs();
$(channel).children('ul').show();
$(channel).css('background-position', 'bottom right');
}
function eventSetUp() {
$('.cw-header .main-nav ').bind('mouseleave', function(event){
if (isIE) {
if ($(event.relatedTarget).parents('.main-nav').length 0)?"" + value.substring(0,pos) + "" + value.substring(pos, term.length) + "" + value.substring(pos + term.length) + "":value.substring(0, term.length) + "" + value.substring(pos + term.length) + ""; }, scroll: false, selectFirst: false }); });
?
?
?
?
?
FILE - In this Tuesday, June 18, 2013, file photo, Afghan President Hamid Karzai speaks at a press conference during a ceremony at a military academy on the outskirts of Kabul, Afghanistan. Karzai's office said he signed a decree on Saturday, July 20, 2013, approving a new law governing next year's presidential and provincial elections, an important step toward a smooth transition of power in 2014. (AP Photo/Rahmat Gul, File)
KABUL - The Afghan president on Saturday approved a new law governing next year's presidential and provincial elections, an important step toward a smooth transition of power in 2014 and the final withdrawal of all remaining foreign combat forces from the country.
Hamid Karzai's office said he signed a decree endorsing the law, which defines the legal framework for the elections and which was approved by parliament earlier this week.
The law is supported by Afghanistan's international sponsors and Karzai's approval was widely expected. Foreign donors have made holding free and transparent elections a key requirement for their continued funding.
In early July, representatives from 40 countries reaffirmed pledges of $16 billion in support for Afghanistan, but cited the approval of two new election laws as a condition.
Last week, Karzai approved another law defining the role and structure of the country's electoral watchdog and election commission. The two laws had been debated in parliament for months and were finally given the green light by a joint commission made up of Afghanistan's upper and lower house.
The balloting for a new president and council members for Afghanistan's 34 provinces will be held April 5. Under the new law, candidates have to submit nominations for the presidential election on Sept. 16.
Karzai, whose second five-year term ends next year, cannot seek a third term under the law. There have been worries that he could delay the laws, either to postpone the election in order to extend his term in office, or to have the polls on his own terms.
The European Union's ambassador to Afghanistan, Vygaudas Usackas, said the new laws show Afghans can take their future into their own hands.
"I am confident that President Karzai as a statesman of his nation will do everything possible to ensure a peaceful transfer of power in 2014 through inclusive and transparent elections," said Usackas, who had strongly lobbied both Karzai and the parliament to approve the legislation.
Karzai, who has the power to reject legislation, has expressed no interest in a third term, insisting he wants to retire after the elections. But it still remains unclear if he may seek to promote his own candidate, including a brother who is active in politics.
"We are encouraged by the adoption of the law," said Nader Nadery, founder and chairman of the Fair and Free Elections Foundation of Afghanistan, a local watchdog.
Nadery said the new law "is going to provide a better base than the previous legal structure" in place during the 2009 presidential elections.
Karzai's re-election was marred by widespread allegations of corruption, vote tampering and election fraud. He denied the charges but the acrimonious aftermath tainted his relationship with the West and the United States.
The U.S. was one of Karzai's most vocal critics and has been dealing with the aftermath of the 2009 vote to this day.
Much of Karzai's bitterness and testy relations with America is thought to stem from his expressed belief that Washington somehow sought to engineer his loss in the polls.
Afghanistan's international financial and military backers have said a smooth transition during the presidential election is necessary to ensure the country's stability once all foreign combat troops leave by the end of 2014.
NATO handed over the lead for security around the country to Afghan forces last June, as part of a phased withdrawal of foreign troops over the next year and a half.
The handover paved the way for the departure of coalition forces ? currently numbering about 100,000 troops from 48 countries, including 66,000 Americans.
By the end of the year, the NATO forces will be halved. At the end of 2014, all combat troops will have left and will be replaced, if approved by the Afghan government, by a much smaller force that will only train and advise the Afghans.
But violence has not abated around the country and the Taliban and other insurgents, emboldened by the withdrawal, have increased attacks against Afghan security forces, especially in places where coalition forces have already withdrawn.
A wave of bombings late Friday in southern Afghanistan killed 15 people, including six members of the country's security services, said Omar Zwak, a spokesman for the governor of Helmand province.
The most deadly of the attacks was when five members of the Afghan intelligence service and a policeman died when their vehicle hit a roadside bomb in the Sangin district, Zwak said on Saturday. Deputy head of Sangin's intelligence service was among those killed in the explosion.
Helmand police spokesman Shamim Noorzia said three other bombings killed six civilians and two police officers.
Insurgents have increased attacks in Helmand as foreign forces withdraw from the area.
___
Associated Press writer Rahim Faiez contributed from Kabul and Mirwais Khan from Kandahar, Afghanistan.
Follow Patrick Quinn on Twitter at: http://www.twitter.com/PatrickAQuinn
?
?
?
?
?
?
?
?
Story Tools
?
?
Font:
?
Image:
?
?
?
?
?
?
?
?
?
?
?
?
?
Also on Driving.ca
?
?
?
?
?
'); document.write('?
'); var i; // Display each ad in turn for(i = 0; i '); document.write(''); document.write('Source: http://feeds.canada.com/~r/canwest/F77/~3/LudhA_6ckjc/story.html
teresa giudice atlanta hawks 2012 white house correspondents dinner forrest gump bernard hopkins devils la riots
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.